Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
  • 0
Esham the Unholy

How do I get monsters to battle each other?

Question

I want to make a wad with zombies and demons from different "factions" fight each other in big battles whilst the player is in the middle of it fighting on his own side. Is there some kind of UCS script or something for it?

Share this post


Link to post

4 answers to this question

Recommended Posts

  • 0
On 5/16/2017 at 7:15 PM, Esham the Unholy said:

....I'm a horrible scripter but I'll teach myself.

Look at the example in the ZDooM wiki page to which scifista42 linked, and you'll see that the basic Thing_Hate special is very easy to use. Say you have an imp and a demon, and you want them to fight each other. Assign the imp a Thing_ID (TID), and assign the demon a different TID. Then, decide if you want the two monsters to hate each other at map start, or when an event is triggered (e.g., the player presses a switch or enters a room, another monster dies, etc.) If you want the monsters to hate each other at map start, use the script shown in the example on the ZDooM wiki page, as follows:

 

#Include "ZCommon.Acs"

script 1 ENTER
{
	Thing_Hate(1, 2, 0);
	Thing_Hate(2, 1, 0);
}

In the example above, imps have TID 1 and demons have TID 2. The third parameter is set to 0 in the example, which represents the following: "The monster will waken and attack the target. If distracted it will also attack the player. Assuming it wins and is not distracted, it will return to being a normal monster afterwards." If you want the monster to behave differently (e.g., it will never attack the player before or after), use a different value for that parameter. Read the wiki article for the options.

 

If you want the monsters to hate each other upon some event occurring, (say, player pressing a switch), then do the following:

1. Assign the ACS script number to the switch (e.g., Script 1). Make sure it is appropriately activated (e.g., player shoots, player uses, etc.)

2. Create and compile the following ACS code:

 

#Include "ZCommon.Acs"

script 1 (VOID)
{
	Thing_Hate(1, 2, 0);
	Thing_Hate(2, 1, 0);
}

 

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
×