Search Unity

Core GameKit! Pooling / Spawning / Combat

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

  1. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    No, you don't use those arrays - that's for layer/tag filters. What you want is
    Code (csharp):
    1.  
    2. enemyHitBy.tag
    3.  
    Just the normal Unity tag, not anything CGK specific.
     
  2. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Here, I had a few minutes so I did it for you. Use a KillableListener Subclass like this (maybe you name it a little better after whatever enemy it's going on). How I have it set up, you get 20 points if an NPC kills this, or 200 if anything else does. The script is pretty short. Hopefully you understand it. DeterminingScenario is called by Killable before it uses the World Variable Modifiers of whichever Scenario. So you just need to tell it the name of the Scenario based on whatever logic. The "base" calls aren't strictly necessary because the base class methods of KillableListener don't do anything, but it's a good habit to get into when overriding methods, in case that changes later. You can have as many Scenarios as you want. You just have to write logic to determine which is used. By default only the top one is until you add some code.


    Code (csharp):
    1.  
    2. using UnityEngine;
    3. using System.Collections;
    4.  
    5. public class KillableListenerSub : KillableListener {
    6.     private bool lastHitByNPC = false;
    7.  
    8.     public override void TakingDamage (int pointsDamage, Killable enemyHitBy) {
    9.         base.TakingDamage(pointsDamage, enemyHitBy);
    10.  
    11.         lastHitByNPC = (enemyHitBy.tag == "NPC_Weapon");
    12.     }
    13.  
    14.     public override string DeterminingScenario (Killable deadKillable, string scenario) {
    15.         if (lastHitByNPC) {
    16.             return "Destroyed_By_NPC";
    17.         }
    18.  
    19.         return base.DeterminingScenario (deadKillable, scenario);
    20.     }
    21. }
    22.  
    upload_2015-1-27_16-59-39.png

    I added a thread in the support forum covering this, because it's a really great example of Listeners.

    Here's the support forum: http://darktonic.freeforums.net/board/2/core-gamekit-pooling
     
    Last edited: Jan 28, 2015
  3. Deleted User

    Deleted User

    Guest


    I did see that in the drop down...my fault...I was looking for CGK specefics..duuh!

    now I see!

    Thanks....again..sorrry...

    Really....I appreciate it!

    Patrick
     
  4. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Not a problem. This plugin is extremely adaptable as we continue to see. We certainly don't attempt to build any sort of game without it :)
     
  5. efreet

    efreet

    Joined:
    Sep 2, 2009
    Posts:
    34
    Hey, nice plugin.
    I've run into a problem I can't seem to work out. My asteroids(spawned from a wave) use OnDespawn() to spawn a TriggeredSpawner object, setup with only a Spawned Event that spawns asteroids chunks from a pool (PoolBoss) and has "Despawn This" set. From what I can tell I have everything setup properly.
    The problem is it only works for a certain amount of time. Than they fail to trigger and the TriggeredSpawner object does not despawn. There are enough objects preloaded in poolboss for all objects in use.
    A thing I noticed is it seems to depend on the wave timer. Wave timer is 20 seconds, it stops triggering at about 22 seconds. Wave 30, stops at 33 ect. Tried setting to wave to elimination and got 43 seconds out of it.

    Any help would be appreciated.

    A working TriggeredSpawner :
    Code (CSharp):
    1. PoolBoss spawned 'ChunkRockSpawnerSmall' at 18.10411
    2. UnityEngine.Debug:Log(Object)
    3. PoolBoss:Spawn(Transform, Vector3, Quaternion, Transform) (at Assets/DarkTonic/CoreGameKit/Scripts/PoolBoss/PoolBoss.cs:214)
    4. PoolBoss:SpawnInPool(Transform, Vector3, Quaternion) (at Assets/DarkTonic/CoreGameKit/Scripts/PoolBoss/PoolBoss.cs:143)
    5. AsteroidController:OnDespawned() (at Assets/_Game/_Scripts/Asteroid/AsteroidController.cs:183)
    6. UnityEngine.Component:BroadcastMessage(String, SendMessageOptions)
    7. PoolBoss:Despawn(Transform) (at Assets/DarkTonic/CoreGameKit/Scripts/PoolBoss/PoolBoss.cs:264)
    8. Actor:Despawn() (at Assets/_Game/_Scripts/Actor/Actor.cs:160)
    9. AsteroidController:ApplyDamage(Single) (at Assets/_Game/_Scripts/Asteroid/AsteroidController.cs:138)
    10. PlasmaBeamProjectile:Raycast() (at Assets/_Game/_Scripts/Projectiles/PlasmaBeamProjectile.cs:105)
    11. PlasmaBeamProjectile:Update() (at Assets/_Game/_Scripts/Projectiles/PlasmaBeamProjectile.cs:54)

    Code (CSharp):
    1. A False | True | False
    2. UnityEngine.MonoBehaviour:print(Object)
    3. TriggeredSpawner:IsWaveValid(TriggeredWaveSpecifics, EventType, Boolean) (at Assets/DarkTonic/CoreGameKit/Scripts/Spawners/TriggeredSpawner.cs:1464)
    4. TriggeredSpawner:_OnDespawned(Boolean) (at Assets/DarkTonic/CoreGameKit/Scripts/Spawners/TriggeredSpawner.cs:638)
    5. TriggeredSpawner:OnDespawned() (at Assets/DarkTonic/CoreGameKit/Scripts/Spawners/TriggeredSpawner.cs:632)
    6. UnityEngine.Component:BroadcastMessage(String, SendMessageOptions)
    7. PoolBoss:Despawn(Transform) (at Assets/DarkTonic/CoreGameKit/Scripts/PoolBoss/PoolBoss.cs:264)
    8. TriggeredSpawner:AfterSpawnWave(TriggeredWaveMetaData) (at Assets/DarkTonic/CoreGameKit/Scripts/Spawners/TriggeredSpawner.cs:2140)
    9. TriggeredSpawner:SpawnFromWaveMeta(TriggeredWaveMetaData, EventType) (at Assets/DarkTonic/CoreGameKit/Scripts/Spawners/TriggeredSpawner.cs:2132)
    10. TriggeredSpawner:_OnSpawned(Boolean) (at Assets/DarkTonic/CoreGameKit/Scripts/Spawners/TriggeredSpawner.cs:626)
    11. TriggeredSpawner:OnSpawned() (at Assets/DarkTonic/CoreGameKit/Scripts/Spawners/TriggeredSpawner.cs:604)
    12. UnityEngine.Component:BroadcastMessage(String, SendMessageOptions)
    13. PoolBoss:Spawn(Transform, Vector3, Quaternion, Transform) (at Assets/DarkTonic/CoreGameKit/Scripts/PoolBoss/PoolBoss.cs:221)
    14. PoolBoss:SpawnInPool(Transform, Vector3, Quaternion) (at Assets/DarkTonic/CoreGameKit/Scripts/PoolBoss/PoolBoss.cs:143)
    15. AsteroidController:OnDespawned() (at Assets/_Game/_Scripts/Asteroid/AsteroidController.cs:183)
    16. UnityEngine.Component:BroadcastMessage(String, SendMessageOptions)
    17. PoolBoss:Despawn(Transform) (at Assets/DarkTonic/CoreGameKit/Scripts/PoolBoss/PoolBoss.cs:264)
    18. Actor:Despawn() (at Assets/_Game/_Scripts/Actor/Actor.cs:160)
    19. AsteroidController:ApplyDamage(Single) (at Assets/_Game/_Scripts/Asteroid/AsteroidController.cs:138)
    20. PlasmaBeamProjectile:Raycast() (at Assets/_Game/_Scripts/Projectiles/PlasmaBeamProjectile.cs:105)
    21. PlasmaBeamProjectile:Update() (at Assets/_Game/_Scripts/Projectiles/PlasmaBeamProjectile.cs:54)
    22.  
    Code for Log above
    Code (CSharp):
    1.  
    2. //TriggeredSpawner.cs
    3. private bool IsWaveValid(TriggeredWaveSpecifics wave, EventType eType, bool calledFromSelf) {
    4.         //print(eType);
    5.         if (GameIsOverForSpawner || !wave.enableWave || !SpawnerIsActive) {
    6.             print("A " + GameIsOverForSpawner + " | " + !wave.enableWave + " | " + !SpawnerIsActive);
    7.             return false;
    8.         }
    A failed TriggeredSpawner: Trace logs are the same as above
    Code (CSharp):
    1. PoolBoss spawned 'ChunkRockSpawnerSmall' at 22.66075
    2. A True | False | False
     
  6. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    You're getting "True" for GameIsOverForSpawner. So that means you are using Global Waves (set up in LevelWaveSettings prefab), and your last wave is over. The default is that "Game Over Behavior" for Killables and Triggered Spawners is set to "disable" so that when the game is over they don't do anything anymore.

    You need to do one of the following:
    1) Makes more global waves because the game isn't really over.
    2) Change the Game Over Behavior to "Behave as Normal" on every Killable and Triggered Spawner that you want to continue to work after the last Global Wave is completed.
     
  7. efreet

    efreet

    Joined:
    Sep 2, 2009
    Posts:
    34
    Ah, can't believe I didn't work that out o_O
    Thanks for that
     
  8. jerotas

    jerotas

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

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Core GameKit returns to its already bargain price of $50.
     
  10. electroflame

    electroflame

    Joined:
    May 7, 2014
    Posts:
    177
    I've gone through the docs, but I'm still having a bit of trouble, so forgive me if this is a dumb question.

    How would I go about having one infinite wave per level? Essentially having the spawners maintain a certain number of spawned objects (i.e. if one is despawned/killed it'll immediately spawn another).

    I'm currently using Syncro spawners, as I thought they would work for something like this, but they don't really have an "infinite" option. If this requires some code, I've got no problem digging in -- I'm just a little confused by all of the options.

    Thanks!
     
  11. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    It's not a dumb question at all. Something that may work for you is to just use the "Respawn Settings" on everything you're spawning. That section is on the Killable script, last section. Hopefully you're using Killable scripts. You could make settings there such as "whenever this dies or despawns, respawn it 1 second later from its last recorded spawn point". If you wanted the spawn point to be repeatedly randomized or something, you could add a KillableListener and a couple lines of code to do that part.
     
  12. electroflame

    electroflame

    Joined:
    May 7, 2014
    Posts:
    177
    Actually I'm already inheriting from the Killable script so I can override functions if needed.

    Is there a way to reset the cached spawn point? Currently I was thinking of using Reflection to get the private Killable field "spawnLocationSet" and set it to false, but I'm not sure if that would actually have the Killable pick a random respawn point (I'm using the Random position aspect of the Syncro spawners, by the way).

    As a bit of further explanation, I've got four Syncro spawners that are all using the same Level/Wave data. Ideally when something is despawned or killed, it would be spawned from one of the spawners (ideally not the same one) and a random position within the spawner's random X, Y, Z fields.

    I'm probably missing something really basic here, so I'm sorry if this is a bit confusing.
     
  13. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    It won't pick a random one no matter what you do, you will have to set that yourself with some code.

    The spawn position is just a public field in Killable, you can set it to whatever you like at any time. By default, it's set to the spawn point every time it spawns though. You could set it after that to some random Vector3. The property is named RespawnPosition.

    This is just the easiest way to do what you wanted. But yeah it doesn't really involve spawners at all. If you wanted to spawn a random thing from a random spawner , you could do it like this:

    1) Don't use the Respawn Settings on Killable.
    2) Add this code to LevelSettings.cs (I'll add it in the next update).

    Code (csharp):
    1.  
    2. /// <summary>
    3. /// This property returns a list of all Syncro Spawners in the Scene.
    4. /// </summary>
    5. public static List<WaveSyncroPrefabSpawner> SyncroSpawners {
    6.     get { returnInstance._syncroSpawners; }
    7. }
    8. /// <summary>
    9. /// This property returns a random Syncro Spawner in the Scene.
    10. /// </summary>
    11. public static WaveSyncroPrefabSpawner RandomSyncroSpawner {
    12.    get {
    13.       varspawners=Instance._syncroSpawners;
    14.       if (spawners.Count==0) {
    15.          returnnull;
    16.       }
    17.       varrandIndex=Random.Range(0, spawners.Count);
    18.       returnspawners[randIndex];
    19.    }
    20. }
    21.  
    3) Override the Despawn method in Killable (make sure to call base.Despawn first though). Add code to get a random spawner and spawn one.

    Code (csharp):
    1.  
    2. var randSpawner = LevelSettings.RandomSpawner;
    3. randSpawner.SpawnOne();
    4.  
    The SpawnOne method only works if the spawner is already configured to use the current global wave. Does this do what you want?
     
  14. electroflame

    electroflame

    Joined:
    May 7, 2014
    Posts:
    177
    It does, thanks! Is there some kind of code docs that I missed? I'm going to end up doing a lot of this stuff via code, I think, so it'd be very helpful to have an overview of what's available.

    Thanks for your help!
     
  15. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Awesome. There's an API website, which is linked from our support forum (stickied post called "important links") and I think in the readme on page 2. If you can't find it let me know.
     
  16. electroflame

    electroflame

    Joined:
    May 7, 2014
    Posts:
    177
    Wow, how did I miss that? That should be useful, thanks!
     
  17. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    I'm guessing you never visited our forum :) Good place for answers, roadmap, etc.
     
  18. electroflame

    electroflame

    Joined:
    May 7, 2014
    Posts:
    177
    Another question, if you don't mind. What would be the best way of ensuring that I have a set number of objects of a certain type?

    For example, one level can have
    1. 50 of ObjectA
    2. 5 of ObjectB
    3. 1 of ObjectC
    etc.

    It looks like I could just specify the Min and Max spawning amounts to the same thing to guarantee a set amount of objects spawned, but this doesn't really work when using multiple spawners (as each spawner thinks that it can, for example, spawn 50 of ObjectA, rather than divide the 50 objects between them).

    This is also supposed to be happening concurrently (all of these objects present in the level). Do I have to have a spawner per-enemy type (as I can't just throw all of them into a prefab pool, I would need them to be separate).

    Thanks! These things seem trivial if I was rolling my own system, but I'm trying to do things the "Core Gamekit" way to ensure I can use the features to the fullest. Hopefully this isn't too dumb of a question.
     
  19. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    You could do one spawner per enemy type (as you thought), if that's acceptable. If you need/want to split it up among spawners, then you should probably just set up a Prefab Pool that has 3 items in it.

    1) ObjectA: weight 50
    2) ObjectB: weight: 5
    3) ObjectC: weight:1

    Then just set up your spawners to spawn a total of 56 items between them all (set min / max spawn fields to the same for each spawner). For each spawner wave, you select "Prefab Pool" for Prefab Type instead of "Specific" and then select the Pool you made. Spawning 56 items will go through the Prefab Pool exactly once, and then the Pool will automatically refill for any later waves you may have.

    Kinda surprised you haven't used Prefab Pools. They are useful for so many things and easy to use :)
     
  20. electroflame

    electroflame

    Joined:
    May 7, 2014
    Posts:
    177
    I actually am using prefab pools! I just meant that having them all in one pool didn't really work very well for my particular case.

    I'll give the separate spawners for each type a shot. Is there an easy way to store spawners as prefabs so I can try to centralize most of my spawner editing (rather than have to manage common settings across multiple objects, as I'll end up having a couple spawners with the same or very similar settings)? Currently it looks like the custom inspector for the spawners doesn't work if it's stored in a prefab, which complicates editing the prefabbed spawners. If not I can do it per-object, but I just wanted to make sure I wasn't overlooking something simple that could simplify the process.

    Thanks again! Your support truly is amazing. :)
     
  21. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Let's get to the bottom of this. Prefab Pools should work the way I outlined. What about it wasn't working well?

    Rather than prefabbing spawners, you can just duplicate a spawner where it sits, under LeveWaveSettings (press CTRL+D), and you'll have a copy of a spawner including its waves. Correct that they can't be prefabbed without including the LevelSettings parent in the prefab, because they have to read the global wave info from the parent. So if the parent isn't there they don't work.
     
  22. electroflame

    electroflame

    Joined:
    May 7, 2014
    Posts:
    177
    I'm sure that they do work the way you outlined, but in my case I would need them separated into pools by type of object, I think, due to the SpawnOneItem method of respawning we discussed above. If I need to make sure that when ObjectB dies another ObjectB spawns, I've come to the conclusion that I should probably use a separate spawner and pool to ensure an object of the same type is respawned. This is especially true if I end up having sub-types of the same object, so they can be weighted in their own pool. Am I not understanding things correctly?

    That's an acceptable alternative, thanks!
     
  23. kathode

    kathode

    Joined:
    Jan 15, 2013
    Posts:
    63
    Hi,
    I'm trying to update from an older version (3.0) and the standard unity import doesn't seem to be taking. The graphic still shows 3.0 in the editor, and I don't see any new PoolBoss methods (which is the part I'm interested in). I somewhat remember an old post of yours that said there was an issue with the plug-in importer, but I can't find it. Should importing a new version just work?

    Thanks!
     
  24. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Ah yeah, because you want to respawn the same thing. But a prefab pool of one item is useless I think. Ok well that alternative that should work for you.
     
  25. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    It usually just works. If not, then just delete the entire CoreGameKit folder, then reimport from Asset Store. Standard practice for all plugins :)
     
  26. electroflame

    electroflame

    Joined:
    May 7, 2014
    Posts:
    177
    Well, I'm spawning the same thing right now, but I might be doing different objects of the same type, etc. down the line.

    Anyway, thanks again. I'll give it a go and see if there's any other issues. Cheers!
     
  27. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Cool.
     
  28. electroflame

    electroflame

    Joined:
    May 7, 2014
    Posts:
    177
    Alright, I'm back (if the following is asking too much, feel free to let me know, as I feel kind of bad that I'm giving you so much trouble).

    Is there a way to get something similar to the SpawnOneItem method from the Syncro spawners to work with Triggered spawners as well?

    I've checked the source and it looks like Triggered spawners use a vastly different spawning method than Syncro spawners, so I'm not sure if this is even possible. I'm trying to do the same thing as the Syncro spawners (i.e. when an object dies, it'll immediately spawn another one) but with Triggered spawners in addition to the Syncro spawners. I'm checking out the SpawnFromWaveMeta method to try and base a custom method off of, but I'm running into trouble. Here's my train of thought:

    Use custom events to fire off a custom triggered spawner (inheriting the base TriggeredSpawner).
    When an object from that spawner dies, it'll call a call a custom method in my child class that will respawn another item immediately.

    I didn't see anything built-in that could do this, so forgive me if this is a dumb problem. If you could point me in the correct direction I would greatly appreciate it.
     
  29. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Of course you can't "SpawnOne" from a Triggered Spawner because they can have any number of different waves, all based on *events*, not based on anything set up in Global Waves in the LevelSettings game object. So if you said "spawn one", they wouldn't know which of their 30 possible waves to use.

    So there are two things you could use Triggered Spawners for:

    1) Set up specific waves for "Code-Triggered Event 1" (or code-Triggered Event 2) for a wave of 1 if you like and fire that from code with:
    Code (csharp):
    1.  
    2. yourTriggerSpawnerVariable.ActivateCodeTriggeredEvent1();
    3.  
    OR

    2) Fire a Custom Event from code and set up a wave in the Triggered Spawner that will spawn a wave of one from that Custom Event.

    #2 is cool because any number of Triggered Spawners could respond to the same event (in case you wanted to spawn loot or weapons or something as well).
     
  30. electroflame

    electroflame

    Joined:
    May 7, 2014
    Posts:
    177
    I was thinking of passing in the name of the custom event to grab the prefabs from.

    The more I've thought about it, the more I feel that I should probably just roll my own spawning solution at this point. It's probably me, but I feel like I'm trying to force the framework to do things that it really wasn't designed for and me, coming from a code background, feel that the spawners in particular were designed for more of a code-free approach.

    Sorry about that. It may just be that I'm trying to use the framework for something it really wasn't designed for, and I end up frustrated and feeling like I could've rolled my own solution in the time I've spent wrangling it to sort-of do what I want (but never fully accomplishing anything).
     
  31. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    We put as many things as possible into the Inspectors so that most people can use them code-free.
    However, we extend the subclass the Spawners and Killables all the time in our games. Not the exact same scenarios you're trying to do though.

    Anyway, those 2 options should work fine that I just gave.

    The plugin is modular, so if you want to use your own spawners, you could. You could use CGK for pooling, prefab pools and Killables only if that's of help. And Triggered Spawners are nearly always useful, even if you don't use the Syncro Spawners.
     
  32. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    We're cleaning up the UI, as we just did for Master Audio. All linked controls will be grouped visually. Coming soon in the next version!
     
  33. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Core GameKit V 3.2.3.7 will be live in 20 minutes! Changelog:

    • Used ReSharper to fix all warnings and errors in the entire code base. Should not affect any of your settings.
    • Fixed Killable Respawn bug where it would sometimes spawn you the first time in the wrong position.
    • Made the Respawn section of Killable not respawn if "Game Is Over" unless you switched Game Over Behavior to "Behave as normal". No more unlimited respawns unless you want it!
    • Added properties to LevelSettings.cs: SyncroSpawners (returns all Syncro Spawners), and RandomSyncroSpawner, which returns a random spawner.
    • Fixed Playmaker custom actions package errors.
    • Fixed Pool Boss so that uGUI elements are parented correctly if you're spawning them.
    • Added new methods to Pool Boss to spawn a prefab by name instead of needing a Transform reference.
    • Added Spawned and Despawned methods to KillableListener
    • Made it possible to use normal width Inspectors now. "Killer Variables" didn't need to be nearly as wide.
    • UI makeover showing grouped controls within boxes, just like we just did for Master Audio plugin. Much easier to tell what control goes with what now.
     
  34. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    We're currently working on integrating Core GameKit with Bolt Engine! So soon we'll have a guide for getting things working for multiplayer games. So far it's going great! Sorry no Photon support since we don't use it ourselves (we aren't networking guys) - Bolt makes it easy!
     
  35. danreid70

    danreid70

    Joined:
    Aug 28, 2010
    Posts:
    225
    How about TNet (Tasharen Network) support? ;) I've been looking at integrating this powerful spawning system with TNet as it is also a very powerful networking tool...
     
  36. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Even less likely than Photon, I'm afraid. The only reason we will support Bolt is because we're using it. However, the little changes we are making to Core GameKit to make it more "multi-player able" should work with any of them.
     
  37. danreid70

    danreid70

    Joined:
    Aug 28, 2010
    Posts:
    225
    Very good news! Yes, if multiplayer at even a generic level is targeted, I'm sure i could leverage it into how I'm using TNet. Thank you for quick reply. Great asset!
     
  38. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Cool :) Stay tuned as we get more done!
     
  39. RowdyMrB

    RowdyMrB

    Joined:
    Dec 8, 2012
    Posts:
    83
    After importing the latest version I receive the following error:
    Assets/DarkTonic/Editor/DTPlaymakerUtility.cs(27,52): error CS0117: `DTInspectorUtility' does not contain a definition for `ShowRedError'
     
  40. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    I fixed it a couple days ago, but it's not in the live version. Here's the new Playmaker package.
     

    Attached Files:

  41. RowdyMrB

    RowdyMrB

    Joined:
    Dec 8, 2012
    Posts:
    83
    Thank you for the quick response!
     
    jerotas likes this.
  42. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Core GameKit V 3.2.3.8 will be live in 20 minutes. Changelog:
    • Fixed bug with Console spamming with certain Damage Prefab settings.
    • Added overridable methods to Killable so you can subclass and use network Instantiate commands if you like!
    • Added overridable methods to TriggeredSpawner so you can subclass and use network Instantiate commands if you like!
    • Fixed Playmaker package.
    • Fixed World Variable inspector. It wasn't showing the correct starting value for float types.
    • Inspector for Pool Boss now updates counts automatically when things spawn or despawn.
    • Added drag area for Prefab Pool's Inspector so you can add multiple items at once (by locking Inspector).
    • Added drag area for Pool Boss' Inspector so you can add multiple items at once (by locking Inspector).
    • Added "Alpha Sort" button to Prefab Pool' Inspector.
     
  43. MetallimaN

    MetallimaN

    Joined:
    Mar 11, 2015
    Posts:
    20
    Hi,
    I am new to your Core GameKit and have a quick question.
    Is there a way to know which spawner my game object was spawned from at runtime?
    For example lets say I have 2 spawners, one of which is on the left side of my screen and one on the right side of my screen.
    Assuming I am using the same object prefab for both spawners, I would always like the objects coming out of my left spawner to move right and I only want objects from my right spawner to move left.
    I have different movement patterns set up on my object prefab but I can't figure out how to see which spawner they are coming from to set the correct movement pattern.
    Thanks.
     
  44. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    There's a property on spawned Killable game objects (called Spawner? I'm not at my computer right now), that holds the Transform object of the spawner. However, you may want to just make a public field on your prefab to toggle between "left spawner behavior and right spawner behavior". Might be easier.
     
  45. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Core GameKit V 3.2.3.9 will be live in 20 minutes. Awesome stuff this time! Changelog:

    • Fixed gap in some Inspectors' button rows with 0 items.
    • Added overridable methods to Syncro Spawner so you can subclass and use network Instantiate commands if you like!
    • Added a #define BOLT_ENGINE in LevelSettings.cs that you can uncomment to use GlobalWaves on Bolt Engine for multiplayer games (requires other changes too, which will be detailed soon).
    • Added Knockback Damage section to Killable!
    • Made LevelSettings.WaveRemainingItemCount public in case you want to display something for "enemies remaining".
    • Added visualization capability in Syncro Spawners! Shows you visually where the things will be spawned (Incremental Settings / Post-nudge, etc) as you tweak. Very useful!
     
  46. I am da bawss

    I am da bawss

    Joined:
    Jun 2, 2011
    Posts:
    2,574
    Just updated it and got 2 warnings and 1 errors on console.
    I am on Unity 5.0 OS X Yosemite.


    Warnings:
    Created unique file for imported asset as file exists with different GUID (Assets/DarkTonic/Editor/UndoHelper.cs => Assets/DarkTonic/Editor/UndoHelper 1.cs)

    Model 'KillerWaveSpawnWidget' contains animation clip 'Default Take' which has length of 0 frames (start=-1, end=-1). It will result in empty animation.

    Error:
    Assets/DarkTonic/Editor/UndoHelper.cs(11,21): error CS0101: The namespace `global::' already contains a definition for `UndoHelper'
     
    Last edited: Mar 20, 2015
  47. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    I have no idea why this is happening (some sort of Asset Store delivery problem). Delete UndoHelper 1.cs. It's a duplicate and I don't have that file name in the package.

    Or, delete the entire Core GameKit folder at: "Assets/DarkTonic/Core Gamekit" before importing an update, every time. This helps to avoid weird errors like this.

    That 2nd warning will probably always be there, you can ignore it.
     
  48. I am da bawss

    I am da bawss

    Joined:
    Jun 2, 2011
    Posts:
    2,574

    Hi Jerotas,
    The thing is, I didn't have Core Gamekit installed - it was a new project with nothing except Master Audio installed.
    I tried it again, same thing, only Master Audio installed. Perhaps it conflicts with Master Audio's installed "undohelper"?
     
  49. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    If so, again there's nothing we can do except suggest you first delete the Assets/DarkTonic/Master Audio folder before upgrading every time. Looks like "new behavior" for Unity 5.
     
  50. I am da bawss

    I am da bawss

    Joined:
    Jun 2, 2011
    Posts:
    2,574
    Okay, after deleting Master Audio and then installing Core Gamekit, I get the following warnings/errors:

    Error importing folder (The pathName assets/darktonic is already mapped to 01643fbeadafc8a419865720b0c88770. But the meta data wants it to be mapped to 91b858cf15dcd2a4297c58c39cdf0f4e)

    Error importing folder (The pathName assets/darktonic/editor is already mapped to 82c034e056770e84c9374f0e905f9d8a. But the meta data wants it to be mapped to 350842e209f3e1041b5edec7e8ffcea1)

    Model 'KillerWaveSpawnWidget' contains animation clip 'Default Take' which has length of 0 frames (start=-1, end=-1). It will result in empty animation.


    That last one as you said before, is unavoidable.

    And even after deleting Master Audio and then installing Core Gamekit - when I try to install Master Audio I get the following error/warnings:

    Created unique file for imported asset as file exists with different GUID (Assets/DarkTonic/Editor/UndoHelper.cs => Assets/DarkTonic/Editor/UndoHelper 1.cs)

    Assets/DarkTonic/Editor/UndoHelper.cs(9,21): error CS0101: The namespace `global::'
    already contains a definition for `UndoHelper'