|
Post by antoripa on Feb 28, 2017 16:19:53 GMT
Hi, I bought your asset yesterday and I am really happy. In my game ( that is in a procedural world ) an engine at the beginning of the level assign a bunch of points those are eligible to spawn one enemy or a bunch of enemies according to few parameteters, How can I inject in runtime to your asset ? Thanks Antonio
|
|
|
Post by DarkTonic Dev on Feb 28, 2017 17:13:56 GMT
In general, it's not supported.
However, here's the general idea. If you use Triggered Spawners, just use code to move them to random positions. Or, you could use Triggered Spawners with say 20 spawners in different locations, and fire a Custom Event that picks 4 of them at random and spawns things (no code required for this).
If you use Syncro Spawners, you also could do either of the things above (random subset of spawners doesn't need Custom Event though).
In either case, the "number to spawn" can use a World Variable, which you set by code.
|
|
|
Post by antoripa on Feb 28, 2017 17:47:55 GMT
mmm ... Can I use my own script but accessing to the pool and with killable features ?
|
|
|
Post by DarkTonic Dev on Feb 28, 2017 18:06:48 GMT
Sure, you can use PoolBoss.SpawnInsidePool anywhere and add Killable script to any prefab.
|
|
|
Post by antoripa on Feb 28, 2017 19:57:43 GMT
Thinking to less code solution. I will use the Triggered Spawners as you mentioned
|
|
|
Post by DarkTonic Dev on Feb 28, 2017 20:21:10 GMT
Yeah it should work and give you a lot more options without you having to code them yourself.
|
|
|
Post by antoripa on Feb 28, 2017 20:46:41 GMT
Agree. So I am using the Survivor Shooter by Unity I create the level wave setting and configured pool boss adding Elephant. I created a custom event : 1) Send to receivers : When distance less than 10 2) Distance tr. : F 10 ( self ) 3) Valid rec. : All
To one prefab on the scene, I added a Triggered Spawner. Selected the Custom event and added the one created. So I Added the prefab to spawn "Elephant"- I expect that when my player is close to less than 10 , CHK spanws an enemy. But I feel something is wrong and it does not spawn . and no log or error
|
|
|
Post by DarkTonic Dev on Feb 28, 2017 20:49:34 GMT
I think you misunderstand how Custom Events work. You didn't mention how / when you are firing the Custom Event. You have to actually fire it for it to do something.
You can manually fire it by clicking "Fire!" in the Inspector at runtime - for testing, or you can add a line of code:
LevelSettings.FireCustomEvent(yourParams);
And there are various place in the Inspectors that you can fire a Custom Event when certain things happen, without needing to code (wave completion / killable dying / etc).
|
|
|
Post by antoripa on Feb 28, 2017 21:05:08 GMT
Yep ... I suspected that trigger was missing. In my case trigger is the player and condition is distance is less than a value.
Fire! from inspector works. What do you suggest as mechanism to fire the event ?
|
|
|
Post by DarkTonic Dev on Feb 28, 2017 21:10:46 GMT
Well that depends on when you want it to happen. If you want it to happen as soon as CGK is initialized after pressing play, you can set that up to fire in the Inspector, top section.
If you want it to happen at other times, let me know when (what would happen that causes it to fire) and we'll see if you need to put it in one of your scripts or somewhere else.
|
|
|
Post by antoripa on Feb 28, 2017 21:19:56 GMT
" CGK is initialized after pressing play, you can set that up to fire in the Inspector, top section." ...what component ? I did not get that
|
|
|
Post by DarkTonic Dev on Feb 28, 2017 21:24:13 GMT
It's the 2nd section from the top of LevelWaveSettings Inspector. It says "Use Initialization Options".
Check that box and you can add one or more Custom Events from a dropdown to fire automatically after CGK is ready.
|
|
|
Post by antoripa on Feb 28, 2017 21:36:49 GMT
Your asset is really impressive. Just doing that it works. So what I did : 1) Create an prefab with an empty object and the triggered spawner script. 2) Created the custom event with the random option fro Valid Receiver 3) Setup all the other stuff 4) Setp the inspector like your last reply
So my level start, my engine create my procedural world and spawn randomly the prefab from above point 2. CGK send the event to a random number of spanwed points and I see my npc working. Even if I could write code, I bought your asset yesterday beacase I prefer focus my effort on my "core" code and use more specifica asset like your. And last but not least .. great support from you ...
Now I will go ahead ( always with Survival shooter "expanded" sample ) adding killable, lives and score.
Any suggestion ? I see the below points :
1) I think that I should change few script to use the raycast 2) I would bind the GUI from the Survival Shooter Unity demo to the World Varible for score, health and lives .
Cheers, Antonio
|
|
|
Post by DarkTonic Dev on Feb 28, 2017 21:49:52 GMT
Sounds good.
Yes you can add some raycast code if you like (maybe to kill Killables with "instant" weapons or something). If you have any suggestions for ray cast stuff, it's possible we may add support for it. Just ask for your particular need here.
If you need any scripting help (where is the method for X?) let us know.
Yes, Core GameKit can do a lot of complicated things. It's set up to be very very flexible. It can do many things that you wouldn't know unless you have used it for awhile or ask us. I know it inside and out of course.
|
|
|
Post by antoripa on Feb 28, 2017 22:17:43 GMT
What I have seen so far is that raycast is used in shooter game ( like gun ) and magic spell ...from my side I can handle adding few code lines . but if you get more request on this feature , it should be nice to have out of box.
Is there any script to update the UGUI with World variable ?
|
|