andymul
New Member
Posts: 2
Posts: 2
|
Post by andymul on Nov 12, 2014 11:04:42 GMT
Hi,
Does the kit support two different types of hit points, such as shield and armor?
I wanted to have a system where the shield acts as a first layer against enemy projectiles After the shield is exhausted, then the armor will take any further hits. When the armor is exhausted, then the player will explode.
Is it possible to do this out of the box?
|
|
|
Post by DarkTonic Dev on Nov 12, 2014 23:42:54 GMT
No, but if the shield is visible you could do a Child Killable thing, where the player can't be damaged until the shield is destroyed. The Player would be a child of the shield. Check out the Composite Killables example scene for an example of that.
|
|
andymul
New Member
Posts: 2
Posts: 2
|
Post by andymul on Nov 13, 2014 10:44:06 GMT
What if I want to set it so that the shield can run out of hit points, but will recharge again after 5 seconds.
Would I have to use the respawn method?
|
|
|
Post by DarkTonic Dev on Nov 13, 2014 17:15:18 GMT
What if I want to set it so that the shield can run out of hit points, but will recharge again after 5 seconds. Would I have to use the respawn method? You'll have to spawn it again and parent it under the Player again.
|
|
|
Post by christougher on Jan 21, 2016 3:52:25 GMT
So, I have a player that has a spawnable shield. When spawned the shield is childed to the player killable object. The first time it is spawned it works correctly, making the player invincible until the shield runs out of hit points. The player then takes damage like normal. When the shield is spawned agan it no longer becomes invincible. The only CoreGameKit scripts that are on either object are killable scripts. I use the playmaker action CGK Pool Boss Spawn to spawn it. Am I missing something? I could have sworn it worked correctly before, but I'm totally baffled here.
|
|
|
Post by DarkTonic Dev on Jan 21, 2016 4:02:55 GMT
You would need to send me an example. Perhaps it doesn't check for child killables at the right times.
|
|
|
Post by christougher on Jan 21, 2016 18:20:52 GMT
I fixed it by adding a 'send message' playmaker action to the Player object to "RegisterChildKillable" after the shield was spawned and it works everytime now. But you might want to look into why it wouldn't work everytime like clockwork. Thanks for offering to dig into an example though! Chris
|
|
|
Post by DarkTonic Dev on Jan 21, 2016 19:47:31 GMT
Ok thanks!
|
|
Oshigawa
Full Member
 
Posts: 228
Posts: 228
|
Post by Oshigawa on Mar 14, 2016 10:37:06 GMT
Is there anything i'm missing here? I made a shield which is a child of player so it moves with the player, and checked the player with inv. while children alive, but the player perishes along with the shield. When i check invincible, it also dies, so i'm doing something wrong probably Also, it works fine when i collide with enemy, the shield disappears. But how do i spawn it as a player child again, it spawns as a separate entity.
Any advice on these two?
|
|
|
Post by DarkTonic Dev on Mar 14, 2016 19:35:15 GMT
Is there anything i'm missing here? I made a shield which is a child of player so it moves with the player, and checked the player with inv. while children alive, but the player perishes along with the shield. When i check invincible, it also dies, so i'm doing something wrong probably Also, it works fine when i collide with enemy, the shield disappears. But how do i spawn it as a player child again, it spawns as a separate entity.
Any advice on these two?Are you spawning the shield as part of the player prefab? If you are, it should work properly until it dies the first time. If not (this method is better), you need to parent it to the ship from code, and you also need to tell Killable about its children for the "invincible when children exist" part to work. That is done by calling this method in the parent Killable from the child (shield): (Pseudo-code) parentKillable.RegisterChildKillable(shieldKillable);
|
|
Oshigawa
Full Member
 
Posts: 228
Posts: 228
|
Post by Oshigawa on Mar 15, 2016 14:04:01 GMT
Yes, i'm spawning the shield as a part of prefab. I even tagged them differently and put them in a different layer in the collision matrix, but the player blows up with the shield.
I'm not so good at coding, but i'll give it a try!
|
|
|
Post by DarkTonic Dev on Mar 15, 2016 15:38:36 GMT
Sounds good
|
|