I need help in script!

Anything that doesn't fit into other forums.
User avatar
Alter
Posts: 851
Joined: Wed Oct 05, 2005 8:55
Location: Poland, Lodz

I need help in script!

Post by Alter »

How to code this script in way that if all 4 demons die then spawns next 8 demons i tried but doesn't work!

Code: Select all

SCRIPT 5 (void)
{
Setmusic("BOSS",0,0);
Door_close(15,64);
delay(35*4);
Floor_LowerToNearest(16,64);
ambientsound("voices/holyshit",127);
delay(35);
}

SCRIPT 6 OPEN
{
while (Thingcount("T_DEMON",1) == 0)
Delay(35);
Thing_spawnfacing(2,8,0,2);
}
User avatar
Sir_Alien
Posts: 80
Joined: Tue Sep 13, 2005 8:23
Location: Sydney, Australia
Contact:

Re: I need help in script!

Post by Sir_Alien »

This line:

Code: Select all

while (Thingcount("T_DEMON",1) == 0)
Should be:

Code: Select all

while (Thingcount("T_DEMON",1) != 0)
In your version you're telling it to delay if there are no demons when there are four, hence the condition is negated and it moves on to the next line of the script.

I assume you want it to delay while there are demons and then proceed when there are none, right?
User avatar
Alter
Posts: 851
Joined: Wed Oct 05, 2005 8:55
Location: Poland, Lodz

Post by Alter »

yeah to make it check every second instead of every tic!

EDIT it still doesn't work! dammit

EDIT What if i put while (Thingcount("T_DEMON",1) < 1) it will work that way if demon are dead then it will spawn next 8 demons? this is really crazy
User avatar
Sir_Alien
Posts: 80
Joined: Tue Sep 13, 2005 8:23
Location: Sydney, Australia
Contact:

Post by Sir_Alien »

When you say "it doesn't work", what exactly happens?
User avatar
Alter
Posts: 851
Joined: Wed Oct 05, 2005 8:55
Location: Poland, Lodz

Post by Alter »

8 Demons don't spawn on their spots with TID 2
User avatar
Sir_Alien
Posts: 80
Joined: Tue Sep 13, 2005 8:23
Location: Sydney, Australia
Contact:

Post by Sir_Alien »

Oh, T_DEMON shouldn't be in inverted commas... It's a defined constant, not a string, i.e.:

Code: Select all

Thingcount("T_DEMON",1)
Should be:

Code: Select all

Thingcount(T_DEMON,1)
User avatar
Alter
Posts: 851
Joined: Wed Oct 05, 2005 8:55
Location: Poland, Lodz

Post by Alter »

I'm a n00b at scripts :P
User avatar
Sir_Alien
Posts: 80
Joined: Tue Sep 13, 2005 8:23
Location: Sydney, Australia
Contact:

Post by Sir_Alien »

So does it work or not?
User avatar
Alter
Posts: 851
Joined: Wed Oct 05, 2005 8:55
Location: Poland, Lodz

Post by Alter »

yeah thanks sir_allen! I'm just new to using if,while,else :)
User avatar
Sir_Alien
Posts: 80
Joined: Tue Sep 13, 2005 8:23
Location: Sydney, Australia
Contact:

Post by Sir_Alien »

No worries.
Post Reply

Return to “Off-Topic”