Several ACS questions

Archive of the old editing forum
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.
Locked
User avatar
Amuscaria
Posts: 6634
Joined: Mon Jul 26, 2004 12:59 pm
Location: Growing from mycelium near you.

Several ACS questions

Post by Amuscaria »

Just a few things I need to clear up. An example solution to some of these would also be appreciated.

ACS:

1) When I ACS_Terminate (or whatever the command is) a script, does it remove the script the the map, stop it and reset it, or pause it where it's at at the time the termination is called?

2) Is it possible to make a monster follow another actor. However, these monsters only move when it's target moves, and stops when the target stops. Also, the will remain a certain distance from the target. Is that doable?

3) Is it possible to run multiple loops within several maps at the same time by activating a script from a map? I was wondering hwo to change the sky textures from time to time through out ALL the maps in a hub when entering the main map. Something like this?
Spoiler:
thanks for the help. :D
User avatar
HotWax
Posts: 10002
Joined: Fri Jul 18, 2003 6:18 pm
Location: Idaho Falls, ID

Re: Several ACS questions

Post by HotWax »

Eriance wrote:1) When I ACS_Terminate (or whatever the command is) a script, does it remove the script the the map, stop it and reset it, or pause it where it's at at the time the termination is called?
Using ACS_Terminate is exactly the same thing as using terminate within that script, except that it can be called on scripts that are currently "running" (see below) on other maps in the same hub. The target script, if it's in the same map, is immediately halted. A subsequent call to the same script will start it over from the beginning.
2) Is it possible to make a monster follow another actor. However, these monsters only move when it's target moves, and stops when the target stops. Also, the will remain a certain distance from the target. Is that doable?
Yes. Just used GetActorX/Y/Z to get the location of the target actor and spawn a mapspot a specified distance away, then have your follower use that mapspot as a goal. You can also run it in a loop and compare the X/Y/Z values from subsequent iterations to see whether the actor is moving and if so how far and fast he is moving. I'll try to provide an example of this later, after I get home from work.
3) Is it possible to run multiple loops within several maps at the same time by activating a script from a map? I was wondering hwo to change the sky textures from time to time through out ALL the maps in a hub when entering the main map.
No it's not. When a script is run on another map in a hub, the script doesn't actually start processing until the player reaches that map. The script is flagged to run, but is in a paused state until the map is entered. If the map is left while a script is running, it is paused at that point and resumed when the player re-enters the map. If ACS_Terminate is called on the paused script, it will be terminated as soon as the player re-enters the map. Calling ACS_Terminate on a script in another map in the hub, then executing it again should flag it to restart as soon as the player enters the map.
User avatar
Isle
Posts: 687
Joined: Fri Nov 21, 2003 1:30 am
Location: Arizona, USA

Post by Isle »

if you want the skys in a hub to cycle you can use timer()

Code: Select all

script 1 ENTER
{
	int time;
	while(1)
	{
		time = ((timer() / 35) % 60);
		if(time >= 30) changesky ("sky1", "sky1");
		else changesky ("sky2", "sky2");
		delay(1);
	}
}
put this in each map and it will change it every 30 seconds
User avatar
Amuscaria
Posts: 6634
Joined: Mon Jul 26, 2004 12:59 pm
Location: Growing from mycelium near you.

Post by Amuscaria »

Alrighty, then. Thanks for the help. :D
User avatar
Risen
Posts: 5263
Joined: Thu Jan 08, 2004 1:02 pm
Location: N44°30' W073°05'

Re: Several ACS questions

Post by Risen »

Eriance wrote:3) Is it possible to run multiple loops within several maps at the same time by activating a script from a map? I was wondering hwo to change the sky textures from time to time through out ALL the maps in a hub when entering the main map.
What HotWax says is correct, but this effect can still be accomplished. I believe this thread has details.
Locked

Return to “Editing (Archive)”