Search Unity

Core GameKit! Pooling / Spawning / Combat

Discussion in 'Assets and Asset Store' started by jerotas, Jan 27, 2013.

  1. ChrisMaster

    ChrisMaster

    Joined:
    Dec 27, 2013
    Posts:
    87
    Triggered Despawner - its on my shot, checked invisible and checked on collision taged enemy - neither work.
     
  2. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Well first of all, why don't you use the Killable script instead of Triggered Despawner? In almost every case it does the same thing but has more options.

    If you want to stay with Triggered Despawner, each of the checkboxes could be a different problem. We can tackle Invisible first.
    Is there a renderer component on the same GameObject? If not, there will be no OnInvisible event, so that won't work. If there is a renderer, make sure that when the GameObject goes off the Game view screen, it's not still visible in Scene view. Unity thinks that's still "visible" - I disagree. I'll wait to hear back from you.
     
  3. Chibwemwn

    Chibwemwn

    Joined:
    Feb 6, 2013
    Posts:
    129
    So I've tried both solutions, and neither are working. How have you set things up in your scene and prefabs?
    Here's how I've set things up:

    $Screen shot 2014-01-24 at 11.30.36 AM.png
    $Screen shot 2014-01-24 at 11.33.14 AM.png
    $Screen shot 2014-01-24 at 11.33.57 AM.png
    $Screen shot 2014-01-24 at 11.35.01 AM.png
    $Screen shot 2014-01-24 at 11.35.46 AM.png
     
  4. ChrisMaster

    ChrisMaster

    Joined:
    Dec 27, 2013
    Posts:
    87
    $despawner.png

    take a look
     
  5. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    I can't read those, they're way too small. And it doesn't let me download them or anything...
     
  6. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Wow, why are you in "debug" mode? That syncro spawner is in debug mode. Go back to "normal" mode and set it up again. If you had set it up in debug mode I don't think it will work right. Also, level 1 wave 1 needs to be not over and the current wave for "Spawn One" to work, in case it's not.
     
  7. ChrisMaster

    ChrisMaster

    Joined:
    Dec 27, 2013
    Posts:
    87
    The renderer was a child - thanks! - is there a way to destroy parent? :)

    Our is should stick with boundry technique?
     
    Last edited: Jan 24, 2014
  8. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Use the Killable script on the parent, and "check" the despawn events you want there. Then put a KillableChildVisibility component on the child with the renderer. Then it should work.
     
  9. ChrisMaster

    ChrisMaster

    Joined:
    Dec 27, 2013
    Posts:
    87
    BTW: when importing a new ver 3.0 there was some alert I think about "Widget animation". What does your asset have to do with widgets?
     
  10. ChrisMaster

    ChrisMaster

    Joined:
    Dec 27, 2013
    Posts:
    87
    Thanks!
     
  11. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    There's a Syncro Spawner widget - 2 actually, red and green. They don't have any animations though so don't worry. That warning has been there since Unity 4.0. I'm not sure how to fix it - I'm not good with animations.
     
  12. Chibwemwn

    Chibwemwn

    Joined:
    Feb 6, 2013
    Posts:
    129
    So this is how it shows up once I parent the spawner to the player ship. I don't know how to change it to debug or "normal" mode. How do I change it to "normal" mode?
     
  13. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    You can't change the parent of a Syncro Spawner. That's not supported. A Triggered Spawner, sure, change the parent all you want. That's probably why it's not working. In the top right corner of Inspectors, there's an arrow next to the lock symbol. That arrow lets you switch between debug and normal mode.
     
  14. Chibwemwn

    Chibwemwn

    Joined:
    Feb 6, 2013
    Posts:
    129
    Alright, so it's spawning, now I want it to spawn from the player ship, wherever it is. At the moment it's spawning from the spawner and that doesn't work, for the game. How do I make it shoot from the player character?
     
  15. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Use a Triggered Spawner if you want to do that. Attach it to the player prefab. Then you'll just need to figure out which event type to use. Are you using NGUI? Or what are your sprites or 3d objects made in?
     
  16. Chibwemwn

    Chibwemwn

    Joined:
    Feb 6, 2013
    Posts:
    129
    I'm just using 2d sprites I made in Pyxel Edit and exported as .PNGs. I'm putting those in empty game objects. I'm not using NGUI. Does that change how I should go about it? I was thinking of using PlayMaker actions to trigger it. I'm thinking of using a code trigger event with the event type. How do I go about making that work?
     
  17. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    That sounds good, let me try it and let you know how. NGUI has an "onclick" event, but that probably wouldn't work for your game anyway because you'd have to click on the player to fire...
     
    Last edited: Jan 24, 2014
  18. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    I've submitted a hotfix version 3.0.1.1 because example scene #1 didn't have any enemies spawning. They were turned off. It should be live in a few minutes.
     
  19. ChrisMaster

    ChrisMaster

    Joined:
    Dec 27, 2013
    Posts:
    87
    Jerotas IMHO your asset is missing killable child visibility to long.
     
  20. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Piece of cake. So here's what you do to get it working.

    1) Add Triggered Spawner component to the Player (you already have) and set up a wave for Code-Triggered 1 (1 missile?).
    2) Somewhere add a Playmaker FSM to a gameObject that will have a state that knows when to make the player fire the projectile.
    3) To that step in the FSM, add action "Call Method" (normal Playmaker action).
    4) In the Behaviour field, drag in the Triggered Spawner component from the player.
    5) In the Method name field, type "ActivateCodeTriggeredEvent1".

    Done! Works on my computer.
     
  21. ChrisMaster

    ChrisMaster

    Joined:
    Dec 27, 2013
    Posts:
    87
    "TO LONG" is there? cant find it?
     
  22. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    I'm not sure what "To Long" is?
     
  23. ChrisMaster

    ChrisMaster

    Joined:
    Dec 27, 2013
    Posts:
    87
    If I set Not visible too long on parent, the child not visible script doesnt work.
     
  24. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    You shouldn't set that on the parent since it has no renderer. So we need to add it for the Child script right?
     
  25. ChrisMaster

    ChrisMaster

    Joined:
    Dec 27, 2013
    Posts:
    87
    Yes, this is what I wanted to say in my first post - sorry for my poor english :)
     
  26. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    No I misunderstood what you said. We will add that in the next version.
     
  27. ChrisMaster

    ChrisMaster

    Joined:
    Dec 27, 2013
    Posts:
    87
  28. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    No problem! Continue to help me make this product even more awesome by telling me what's missing.
     
  29. ChrisMaster

    ChrisMaster

    Joined:
    Dec 27, 2013
    Posts:
    87
    Also IMHO you could add an option to so attack point could get defined from world variable - so you could uprade damage on player for exaple (or maybe you can do it, but I dont see how).
     
  30. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    As long as you're using Killable, you can do this. The attack points field has a dropdown on the right that says "self". Change that to "Variable", then select a variable to the left of that.

    Note: ALL integer and float fields in Core GameKit now support this behavior.
     
  31. ChrisMaster

    ChrisMaster

    Joined:
    Dec 27, 2013
    Posts:
    87
    Cant find int :(
     
  32. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Did you change the dropdown to "Variable"? If you do, then all "whole number" variables will be shown in the variable dropdown that appears to the left.
     
  33. ChrisMaster

    ChrisMaster

    Joined:
    Dec 27, 2013
    Posts:
    87
    I dont knwo how to change the dropdown to Variable - no idea :)
     
  34. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Are you joking with me now? It's a blue dropdown.
     
  35. ChrisMaster

    ChrisMaster

    Joined:
    Dec 27, 2013
    Posts:
    87
    I am not kidding, I just spend 20 min looking for it. Can you send me screen?

    Where is that drop down? In the inspector? On the object that has killabe script on it? I cant see there anything there with dropdown and Variable.
     
    Last edited: Jan 24, 2014
  36. Chibwemwn

    Chibwemwn

    Joined:
    Feb 6, 2013
    Posts:
    129
    Oh wow! So it works!
    Thanks soooo much!! This ends two days of banging my head against the wall!!
     
  37. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Yeah, it's in the Inspector. You said you wanted to change Attack Points to use a World Variable. So go to Attack Points in your Killable Inspector. On the very right, there's a blue dropdown that's on "Self". Change that to "Variable". Maybe your Inspector isn't wide enough to see it? Make it wider.
     
  38. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    No problem!
     
  39. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Chris Master, there's a picture on page 24 of this thread, showing the blue dropdown...here it is again.

    $attachment.png

    See how I've used a variable for attack points?
     
  40. ChrisMaster

    ChrisMaster

    Joined:
    Dec 27, 2013
    Posts:
    87
    I dont see anything blue there ... I inreased size of the inspector to the max ...

    $variables.png


    Can you see my screen? Its diffrent, I am special somehow :(
     
    Last edited: Jan 24, 2014
  41. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    I think you said you're on V2.7 of this plugin right? The blue dropdown and Pooling is only available starting on V3.0. You'll need to upgrade to get those features. Make sure to read the "breaking" changes" parts of all versions above your before upgrading. There will be a few steps you have to do first.
     
  42. ChrisMaster

    ChrisMaster

    Joined:
    Dec 27, 2013
    Posts:
    87
    For some time, I felt like complite idiot, but there was no way I could find it :)
    Thanks
     
  43. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    No worries, it's not you!
     
  44. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Core GameKit 3.1 is submitted and will be live in a couple minutes. Changelog:

    • Performance upgrade: Changed all repeatedly called CoRoutines into looping CoRoutines.
    • Added wave offset field to Triggered Spawners and Syncro Spawners. This is a Vector3 field and is added to the Spawner position prior to any Incremental Settings and Post-Spawn Nudge Settings to choose a custom spawn location.
    • Added "disable event after" checkbox to Triggered Spawner events. That way you can make it only work once.
    • Added controls to Killable Child Visibility script to despawn the Killable if not visible too long - same as Killable controls.
     
  45. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Oh, the sale has been extended through the weekend. We noticed that Sunday is the 1st anniversary of launching this plugin, and we want to have the sale then, but it's already on, so we'll keep it on!
     
  46. Chibwemwn

    Chibwemwn

    Joined:
    Feb 6, 2013
    Posts:
    129
    These sound like good upgrades. How can I avoid breaking things if I were to update?
     
  47. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    There are no breaking changes upgrading from v3.0. You're already on 3.0 right?
     
  48. ChrisMaster

    ChrisMaster

    Joined:
    Dec 27, 2013
    Posts:
    87
    Why does Level Wave Settings prefab start now with 3 Spawners? Left, middle, right?
     
  49. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    That's a mistake. I may have applied my changes from Example scene 1. I'll submit a hotfix. There should be none.
     
  50. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    V3.1.1 hotfix submitted. It will be live in a couple minutes. This removes all Prefab Pools and Spawners from the default LevelSettings prefab.