Problem scripting a final battle.

Ask about mapping, UDMF, using DoomBuilder/editor of choice, etc, here!

Moderator: GZDoom Developers

Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.
Post Reply
AkitoCL
Posts: 3
Joined: Tue Feb 06, 2018 12:11 am

Problem scripting a final battle.

Post by AkitoCL »

I want to set the final battle with the Cyberdemon to end when every monster tagged 666 in a room is killed.
Problem is, the monsters tagged with 666 just spawn with the SpawnSpots scripted when Cyber takes damage and as such, the script think there are no 666 monsters yet.

http://www.hatebin.com/rzbzsmfuas

I have tried a lot of things including running the script on Cyber's death, adding a ACS_Execute after the final break;, going "script 23 ENTER" or open treats them like runaway scripts, tagging Cyber with 666, tagging the imps already on the room with 666 and everything failed.
User avatar
ReX
Posts: 1578
Joined: Tue Aug 05, 2003 10:01 am
Location: Quatto's Palace
Contact:

Re: Problem scripting a final battle.

Post by ReX »

Set your cyberdemon to trigger an ACS script (e.g., Script 20). Try the following script:

Code: Select all

script 20 (void)
{
	while (thingcount (0, 1))				//count Cyberdemon; wait until its dead
	{
		delay(8);
	}
{	
	Thing_Destroy (666);					//Destroys enemies tagged 666
}
Unless I'm misunderstanding you completely, and you want the reverse - kill all the tagged enemies and the cyberdemon dies with them. In which case the same script can be used with a bit of tweaking.
Post Reply

Return to “Mapping”