Scripts / Quick question about spawning

Author
Message
AuShadow
GameGuru TGC Backer
11
Years of Service
User Offline
Joined: 2nd Dec 2013
Location: Australia
Posted: 2nd Mar 2016 06:10
is it possible to spawn something by the name I give it in the properties panel instread of entity number as it would be so much simpler for optomizing my game closer to the end if I can go through and name all my enemies in one zone as Zone1Enemy then have scripted Spawn(Zone1Enemy).

Thanks for any help
PC Specs: Windows 10 home 64-bit, Amd 7900 3gb DDR5 graphics, 8gb DDR3 Ram, Intel i7 3.4ghz
smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 2nd Mar 2016 09:30
Yh that's kinda how it already works but you use "ActivateIfUsed(e)" rather than Spawn(e)

Put the name of the entities in the ifused field of the entity with the script.
lua guide for GG
https://steamcommunity.com/sharedfiles/filedetails/?id=398177770
windows 10
i5 @4ghz, 8gb ram, AMD R9 200 series , directx 11
AuShadow
GameGuru TGC Backer
11
Years of Service
User Offline
Joined: 2nd Dec 2013
Location: Australia
Posted: 2nd Mar 2016 09:39
Ahhhh sweet, so I should be able to use the if player in zone, activate if used, and in the if used field of the zone put enemyzone1 then all enemies with that name would spawn. Sorry for lack of syntax there but on my phone atm, sounds too easy will give it a go as soon as I get the chance
PC Specs: Windows 10 home 64-bit, Amd 7900 3gb DDR5 graphics, 8gb DDR3 Ram, Intel i7 3.4ghz
AuShadow
GameGuru TGC Backer
11
Years of Service
User Offline
Joined: 2nd Dec 2013
Location: Australia
Posted: 2nd Mar 2016 11:56
thanks smallg works a treat, found 5 mins to give a run today, and for all who dont know using the standard trigger marker under the markers tab you can do this without any coding at all, Just add the marker, write your desired name of spawn object in its If Used field under properties panel, then name the things you want to spawn the same and all done

PC Specs: Windows 10 home 64-bit, Amd 7900 3gb DDR5 graphics, 8gb DDR3 Ram, Intel i7 3.4ghz

Login to post a reply

Server time is: 2024-12-22 13:55:07
Your offset time is: 2024-12-22 13:55:07