Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Quagsire

I just need a few reminders on certain ACS actions.

Recommended Posts

1. How do I do a basic loop?
2. How do I make it where you have to kill a certain amount/type of enemies before something occurs?

Share this post


Link to post

1. For loop done like this:

for(int x = 1; x < 10; x++)
{
	// Do stuff
}
More info here.

2. Using a while loop in conjunction with ThingCount:
While(ThingCount(0, TID) > 0) Delay(10);
// Do stuff after they are dead

Share this post


Link to post
Nevander said:

1. For loop done like this:

for(int x = 1; x < 10; x++)
{
	// Do stuff
}
More info here.

I believe there was another script for looping which involved an action repeating until there was 0 of something.

Share this post


Link to post
Sgt Ender said:

I believe there was another script for looping which involved an action repeating until there was 0 of something.

You could make an OPEN script and make it delay until a certain variable becomes true, and then give each monster a script to increment that value by one each time. Then once all dead, the OPEN script continues.

If the monsters needing to be killed are spawned via ACS also, you can use SetThingSpecial to give them the script. Thing scripts for monsters always execute on death IIRC.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×