Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Sign in to follow this  
Ultraboy94

thing_hate making monsters go crazy....

Recommended Posts

i was trying to make a 'monster fight arena', where you could spawn monsters, by pressing switches, into a field which was unaccessable by the player but the player could see into (to watch). any monster spawned, in theory, would instantly start to infight with any other spawned monster. of course i used thing_hate extensively for this scripting.

however, when i finally came to test, the more monsters that spawned, the faster the monsters would move, until there was this massive storm of monsters which was moving so fast that it was impossible for them to land a hit on each other...

i am finding this hard to explain. if you want to see for yourself, download the file here:

http://wadhost.fathax.com/files/crazy_monsters.zip (11kb download size)

definitley requires zdoom, may require skulltag since i may have used skulltag textures.

just keep spawning monsters using the switches in front of you, and see for yourself... i did not edit the actual monsters in any way, the wad only includes a map.

it can be humourous to pick up a weapon, teleport into the arena, and kill a few spawned monsters. as long as you have an archvile in your 'monster storm', you can see the monster's corpse 'mopped up' in seconds!

i have decided to keep the arena as it is because this result is funnier than what was originally planned :)

to get a massive storm of monsters may slow down older computers.

Share this post


Link to post

What a weird bug; that's the type of thing I'd attempt to do deliberately, heh.

But I think I found the cause. Change delay(1) to delay(100).. or some higher number like that.
Apparently all of that code couldn't be executed in the time of 1 tic? Or something like that.. not sure why that'd affect monster speed. If 100 is too slow you might keep trying half that, like see if 50, 25 or 10 work ok.


Also this is a much more compact way to write all that (but it can sometimes be easier just doing it the long spammy way instead of getting a headache thinking about how a bunch of while/etc loops are working). Here the delay(1) happens much more frequently than yours since its in an inside 'for' loop, which is why it can be 1 instead of 100 (I think if translated to your code it'd be the same as putting a 'delay(1)' after EACH hate line). Also I'm not 100% sure this is equivalent to your code but seems to be.

#include "zcommon.acs"

script 1 open {
 while(1){
  for(int x = 17; x <= 31; x += 1){
   for(int y = 17; y <= 31; y += 1){
    if(y!=x){
     thing_hate(x,y,0);
    }
    delay(1);
   }
  }
 }
}

Share this post


Link to post

How bizarre!

However, look at your code:

thing_hate(17,18,0);
thing_hate(17,19,0);
thing_hate(17,20,0);
thing_hate(17,21,0);
thing_hate(17,22,0);
thing_hate(17,23,0);
thing_hate(17,24,0);
thing_hate(17,25,0);
thing_hate(17,26,0);
thing_hate(17,27,0);
thing_hate(17,28,0);
thing_hate(17,29,0);
thing_hate(17,30,0);
thing_hate(17,31,0);
You are changing the hate target for each enemy a number of times each tic. Every time the script loops you tell the monsters with tid 17 to hate tid 18 then 19 then 20 then 21 then 22... etc etc.

Share this post


Link to post
Enjay said:

You are changing the hate target for each enemy a number of times each tic.



.. good point, didn't think of that. I assumed thing 17 would hate ALL the other things simultaneously, but yeah, I guess it just alternately hates one at a time..

Share this post


Link to post

I thought it was obvious after 16 years of dooming that a monster can only target one other thing at a time. :p

Share this post


Link to post

Can't you give all the monster things the same TID and just make them "hate" themselves? Might not (read: probably won't) work, but that would be my first guess to try.

Share this post


Link to post

The arachnotron does not seem to move when spawned, no matter how many monsters are around. But it had no problem shooting at me when I went in.

Share this post


Link to post
r_rr said:

The arachnotron does not seem to move when spawned, no matter how many monsters are around. But it had no problem shooting at me when I went in.


that's odd, i checked the script and it is included in the thing_hate script, but it dosent move for me. it dosent shoot either though.

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
Sign in to follow this  
×