how to use spawn order ?

jonsilva

New member
hello
iam trying to spawn all enemies groups at 0
but i cant get the order working..sometimes it works others it doesnt ?

iam using the noscpos script to make all entities spawn in the same place...and using ghost enemies to seperate the groups
ghost1 has 5 lifespan
ghost2 has 10
ghost3 has 15
ghost4 has 20

this is an example of the level.txt
#---------------------////--------------------------

group 1 1
at    0

spawn  ghost4
spawnscript data/scripts/noscpos.c
coords  360 255 10
at      0

spawn  ghost3
spawnscript data/scripts/noscpos.c
coords  360 255 10
at      0

#---------------------////--------------------------

group 2 2
at    0

spawn  ghost2
spawnscript data/scripts/noscpos.c
coords  360 255 10
at      0

spawn  slay
spawnscript data/scripts/noscpos2.c
map    1
flip    1
health  230
coords  360 250 155
at      0


spawn  ghost1
spawnscript data/scripts/noscpos.c
coords  360 255 10
at      0

spawn  vigo
spawnscript data/scripts/noscpos2.c
map    1
flip    1
health  160
coords  360 250 180
at      0

spawn  ghost1
spawnscript data/scripts/noscpos.c
coords  360 255 10
at      0

spawn  vigo
spawnscript data/scripts/noscpos2.c
map    2
item    cheese
health  160
coords  360 250 180
at      0

spawn  ghost1
spawnscript data/scripts/noscpos.c
coords  360 255 10
at      0

spawn  psycho
spawnscript data/scripts/noscpos2.c
map    1
item    ring
flip    1
health  190
coords  355 250 145
at      0

#-----------------------
group 1 1
at    0

spawn  ghost1
spawnscript data/scripts/noscpos.c
coords  360 255 10
at      0

#-----------------------

group 3 3
at    0

spawn  samuel
spawnscript data/scripts/noscpos2.c
map    1
flip    1
health  190
coords  355 255 135
at      0

spawn  ghost1
spawnscript data/scripts/noscpos.c
coords  360 255 10
at      0

spawn  ghost1
spawnscript data/scripts/noscpos.c
coords  360 255 10
at      0

spawn  ghost1
spawnscript data/scripts/noscpos.c
coords  360 255 10
at      0


spawn  slay
spawnscript data/scripts/noscpos2.c
map    2
flip    1
item    food3
health  230
coords  360 250 155
at      0

spawn  ghost1
spawnscript data/scripts/noscpos.c
coords  360 255 10
at      0


spawn  samuel
spawnscript data/scripts/noscpos2.c
map    2
flip    1
health  190
coords  355 255 135
at      0

spawn  ghost1
spawnscript data/scripts/noscpos.c
coords  360 255 10
at      0

spawn  mrwhite
spawnscript data/scripts/noscpos2.c
map    1
flip    1
item    money1
health  270
coords  355 250 135
at      0

spawn  ghost1
spawnscript data/scripts/noscpos.c
coords  360 255 10
at      0


spawn  vigo
spawnscript data/scripts/noscpos2.c
map    3
flip    1
item    apple
health  160
coords  360 250 180
at      0

spawn  ghost1
spawnscript data/scripts/noscpos.c
coords  360 255 10
at      0

spawn  psycho
spawnscript data/scripts/noscpos2.c
map    3
health  190
coords  355 250 145
at      0

#-----------------------

i cant uderstand whats happening sometimes the enemies spawn well with a diference of 5 seconds between them
but sometimes when i use group 3 3 they all seem to spawn at the same time no matter how many ghosts i put between them...

anyone knows how the group order works... if i want to spawn all groups at 0... ???









 
You should delay entity instead, Read Tricks n Tutorials on how to make one.

As for your problem, I don't quite get on how you want the enemies to appear especially when group 3 3 is activated. What is exacly your plan?

BTW since ghost enemies you have are invisible, you don't need noscpos.c. You can just spawn them in middle of screen and noone would notice ;)
 
ive already got it working !!!

iam spawning all the enemies with an altitude 140/180 using a follow10 animation (its like they are coming from a hole in the ceiling)

****---noscpos2
// Removes scroll pos effect
void main()
{
    void self = getlocalvar("self"); //Get calling entity.
    int x = getentityproperty(self,"x"); //Get character's x coordinate
    int XPos = openborvariant("xpos");
    changeentityproperty(self, "position", x - XPos);
    performattack(getlocalvar("self"), openborconstant("ANI_FOLLOW10"));
}





the level has wall from 0 to 200 with a 5000 heigh to prevent entities from moving out of the playing area and to prevent the player from spawning out of the area....

when the noscpos.c script finds a wall in front of it the entities die cause they spawn inside the wall...for example if you set them to spawn in coords 300 255, they have to move from 0 to 300 and when they find a wall in front they die

so ive set all entities to subject_to_wall 0
and made this script for follow10 and spawn anim
void subwall(int wall)
{// Set's subject to wall
    void self = getlocalvar("self");
    changeentityproperty(self, "subject_to_wall", wall);
}


but in the ghosts spawn animtion ive use it like this
anim spawn
loop 0
delay 3
offset 40 60
bbox 0 0 0 0
@cmd subwall 1                        <-------subject_to_wall 1
frame data/chars/misc/food/empty.gif
frame data/chars/misc/food/empty.gif

this was making the ghosts die when i moved 50 pixels foward in the level
but all the enemies were spawning fine and couting in groups...

the problem was in the ghost spawn anim the @cmd subwall 1 was activated very fast on top of all frames this made the wall kill the ghosts
ive change it 1 frame below...
loop 0
delay 3
offset 40 60
bbox 0 0 0 0
frame data/chars/misc/food/empty.gif
@cmd subwall 1                        <-------subject_to_wall 1
frame data/chars/misc/food/empty.gif

now its working
iam using this ghosts in previous levels so i whanted to make them subjecto_to_wall 1 has fast has possible so whem they spawned on top of walls they wouldnt fall down...


 

 
thanks beatie
that delay looks good you can set the health has time in spawn level


hum, I liked that idea. So I can use this to make multiple spawn animations?

yes this is a way utunnels mentioned
you can use it in the level txt and set whatever anim follow you whant

spawn  MrX
@script void main() {
  performattack(getlocalvar("self"), openborconstant("ANI_FOLLOW10"));
} @end_script
flip    1
map    1
item    food4
health  550
coords  -1480 470 71
at      1010




 
Back
Top Bottom