Page 1 of 2
Spawning an entity
Posted: Thu Oct 23, 2014 12:16 am
by Faerghail
Hi ,
What is the correct solution to spawn an entity ? in the exemple i would like to spawn a deamon head on a wall with name "head1"
I know i have to enter the coordonates ,the height, the facing ... what else ?
spawn("daemon_head",14,19,-1,1,"head1")
Thx
Re: Spawning an entity
Posted: Thu Oct 23, 2014 12:20 am
by NutJob
Level
Re: Spawning an entity
Posted: Thu Oct 23, 2014 12:27 am
by Faerghail
and what is the order plz ?
Re: Spawning an entity
Posted: Thu Oct 23, 2014 12:42 am
by NutJob
-1 is wrong also.
Re: Spawning an entity
Posted: Thu Oct 23, 2014 12:43 am
by Skuggasveinn
Code: Select all
spawn("torch", 8, 15, 16, 1, 0,"DazUberTorch")
spawn("asset", X, Y, Facing, Elevation, "name")
first is the asset you wan't to spawn
8 is the level, in the order that they are listed in your dungeon editor, the top most level being 1 and then going 2,3,4 as they descend down (don't mix this up with coordinates the tell the game how your levels and the minimap interact)
15 is the X
16 is the Y
1 is the facing (from 0 to 3 )
0 is the elevation
and then comes the name (and that's optional if you never need to call this again.)
Re: Spawning an entity
Posted: Thu Oct 23, 2014 8:27 am
by Faerghail
Super ! Thank you very much

Re: Spawning an entity
Posted: Thu Oct 23, 2014 9:18 am
by Hianloun
Hey guys.
i have a question:). Its pretty the same but i just want to know how to let things "Despawn".
But for the editor Despawn is a nil value

.
Thanks
Re: Spawning an entity
Posted: Thu Oct 23, 2014 3:27 pm
by Faerghail
Use Destroy(). In my example if i want to destroy my entity i use
head1:destroy()
for a monster , use kill()
Re: Spawning an entity
Posted: Thu Oct 23, 2014 3:44 pm
by petri
Instead of fiddling with the coordinates, an easier way is to use an existing entity as an anchor, like this:
Works with any entity.
Another trick is to use the script as the anchor:
Re: Spawning an entity
Posted: Thu Oct 23, 2014 4:21 pm
by Faerghail
oh that's great , thanks for this trick
what "Anchor" can i use for a spawn on a wall ?