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

Different sides for demons

Recommended Posts

Zdoom now has a Thing_Hate special which can probably do the things you want.

Randy said:
I just got done enhancing Thing_Hate with a third parameter you can set like this:

0. Same behavior as before.

1. Monsters work like normal, except instead of looking for players, they look for monsters with the TID they're supposed to hate. They won't go after a monster unless they can see it first. After finishing off one monster, they look for more with the same TID. If they can't find any, they go back to sleep. They will ignore you unless you attack them, in which case they will target you like normal.

2. Same as 1, except they will chase after other monsters without needing to see them first.

3 - Hunt actors with given TID and also players

4 - Same as 3, but will go after monsters without seeing them first

5 - Hate actors with given TID and ignore player attacks

6 - Same as 5, but will go after enemies without seeing them first

You can use Thing_Hate with either two or three arguments, the optonal third argument being those above. Example:

Thing_Hate (1, 2)

This makes the monster with TID #1 go after the monster with TID #2, with original Thing_Hate behavior...which I think has the monster turn on you as soon as it has dispatched it's hated target. It may also turn on you if you damage it while it's engaging the hate target.

As far as I know, Thing_Hate must be set by script. Monsters can exist with tags assigned from the start, or can be spawned at any time in the game with a tag number. Those tag numbers are used by Thing_Hate. You can also use the ThingSetSpecial script to assign and unassign Thing_Hate.

I have no idea about EdMap, whether or not it will allow you to access these features in a wad.

Share this post

Link to post

Yes, I know Zeth can handle this stuff, though I don't use Zeth.

For the basics of a wad with scripting, you might want to get a fairly simple zdoom map and look around in it with an editor to see what makes it tick. Here are some basics:

To use scripts, the wad has to be in zdoom or zdoom-hexen format. It's the same as you already know, with some stuff added. You will see that the wad contains a "behavior" data lump, which is the compiled scripts.

Wads can be created in these formats from the start, or can be converted with zwadconv.exe, which is available from the zdoom web page. Once a wad format is converted, the wad won't play with doom2.exe, a source port such as zdoom will be needed.

Scripts are written as text, then compiled with acc.exe, also available on the zdoom web site. The compiling can be done manually from the command line, such as acc myscript.lmp which will write the file myscript.o. Then, this .o file is put into the wad and named "behavior" with a tool such as XWE or Wintex. Don't know about Zeth, some other editors like DeePsea or WadAuthor let you compile from within the editor and will properly import the behavior lump into the wad.

Scripts are generally activated in the wad in ways that actions are caused in all doom maps. Walk over a line which is tagged to execute a script (acs_execute, x, x, x...), use a switch, pick up an object, kill a monster. For example, a monster can be given a "special" to active a particular script when it's killed, and the script can do just about anything or combination of things.

I'm not sure what an ideal wad would be to examine and see the use of simple scripts. I learned some from Randy's demo.wad which is probably still up on the web site. Then, I was really impressed with Cyb's offering, The Adventures of Massmouth, and was very pleased to see that the text files of the scripts were in the wad so I could see how he had done some things. Those text files (scripts) don't have to be in the wad to make scripts work, just the compiled behavior lump.

Maybe someone else here can point you to an ideal tutorial wad???

Share this post

Link to post

OK, I have perhaps a better idea - I'll make a small example wad for you, with the monsters taking sides like you say. You might be able to copy the scripts from it and put it in your own wad without much change.

What do you want the "third group" of monsters to do...act as usual in that they go after the player always, fighting other monsters only when they take damage from those others?

Share this post

Link to post

Yeah, I wanted them to whenever they encounter the players force or enemy's force to attack. Is there a way to make it so that they dont need activation and start wandering around at start?

Share this post

Link to post

Yes. None of the monsters need to be dormant at start. The third parameter of Thing_Hate controls some of the actions and I'd guess that 2 is the choice for your example. I'm at work right now (heh, on break) and I will put an example wad together tonight and mail it to you. I expect that Zeth will allow you to edit and re-compile the scripts in it (will be only a few very simple ones). You might need to get ACC version 1.28 from the zdoom web page and copy it over any older acc.exe that you have. You'll also need the files zcommon.acs, zdefs.acs, zspecial.acs and zwvars.acs, they are zipped with the executable.

Share this post

Link to post

script 1 OPEN
Thing_Hate (1, 100, 6);

script 2 (void)
Thing_Hate (1, 8, 6);
Thing_Hate (2, 1, 3);

script 3 (void)
Thing_Hate (9, 8, 0);
Thing_Hate (1, 9, 6);

Are those numbers inside the parenthesis tag numbers?

Share this post

Link to post

The first two numbers are tag numbers. The third number is the parameter which I list in my post above, controlling some aspects of how the monsters work.

Share this post

Link to post

You know, the original post didn't say "I'm using zdoom". Eternity has friendly monsters.

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