Two questions (activator TIDs & crushers)

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.
User avatar
cccp_leha
Posts: 1816
Joined: Wed Jul 16, 2003 7:21 am
Location: NJ, USA
Contact:

Two questions (activator TIDs & crushers)

Post by cccp_leha »

Question 1: how can I determine that a thing with a TID of 3 has crossed a linedef (i.e.: a monster has entered a room and I want to execute a script)?

Question 2: I used the code below to try and make a crusher which slows down, but it doesn't work (keeps going at the same speed).

Code: Select all

for (int i = 10; i > 0; i--) {
	ceiling_crushAndRaiseA(57, i*2, i*2, 10);
	delay(35);
	print(s:"going at: ", d:i);
}
I also tried sticking a ceiling_crushStop() in there, but that didn't work either.

Thanks.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49234
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Post by Graf Zahl »

Q1: ACS has a function 'activatortid()' for exactly that purpose.
Q2: What you attempt is not possible. Once you start a crusher in a sector there is no way to create a new one because you cannot delete the old one.
User avatar
HotWax
Posts: 10002
Joined: Fri Jul 18, 2003 6:18 pm
Location: Idaho Falls, ID

Post by HotWax »

I knew #2 was something like that, but had forgotten. Stopping a crusher with either a line special or ACS command only pauses the action. The ceiling of that sector is considered to have an action for the rest of the level and cannot be told to do anything else, including changing to a different type of crusher. :(
User avatar
cccp_leha
Posts: 1816
Joined: Wed Jul 16, 2003 7:21 am
Location: NJ, USA
Contact:

Post by cccp_leha »

OK, the activatorTID() works, but how do I execute the script if a monster has crossed the line?
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49234
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Post by Graf Zahl »

You have to give the line either a monster cross activation type (if the player should not be able to activate the line) or set the flag 'Monsters can activate' (if the player should be able to.)
User avatar
HotWax
Posts: 10002
Joined: Fri Jul 18, 2003 6:18 pm
Location: Idaho Falls, ID

Post by HotWax »

So, you'd just make a walk-repeatable line that monsters can activate, then check the TID of the activator. If it's the right one, you could clear the line's special and do whatever else you want to happen. If it's not, you can just terminate the script, leaving the line special intact for the next monster to cross it. Also, make sure to use ExecuteAlways if its crucial that a monster crossing the line with the right TID executes the script every time. Otherwise two monsters (one with TID, one without) crossing at near the same time might cause the script to not trigger for the right one.
User avatar
cccp_leha
Posts: 1816
Joined: Wed Jul 16, 2003 7:21 am
Location: NJ, USA
Contact:

Post by cccp_leha »

I couldn't find the "mosnters crosses" activation in WA... because it was the first one in the listbox without a scrollbar; I thought it coudn't go up any higher :oops: . So I did it now and it doesn't work; attached below.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49234
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Post by Graf Zahl »

Of course this doesn't work. Print only prints to the activator's screen and a monster doesn't have one. Use printbold instead.
User avatar
cccp_leha
Posts: 1816
Joined: Wed Jul 16, 2003 7:21 am
Location: NJ, USA
Contact:

Post by cccp_leha »

Haha, thanks. One last thing (hopefully): how would I go about incorporating barrels into all this?
User avatar
cccp_leha
Posts: 1816
Joined: Wed Jul 16, 2003 7:21 am
Location: NJ, USA
Contact:

Post by cccp_leha »

Actually what I meant was that I want a script to execute when a barrel has crossed a line.
User avatar
HotWax
Posts: 10002
Joined: Fri Jul 18, 2003 6:18 pm
Location: Idaho Falls, ID

Post by HotWax »

Give the barrel(s) the TID and set the line to monster cross and you should be in business.
User avatar
The Ultimate DooMer
Posts: 2109
Joined: Tue Jul 15, 2003 5:29 pm
Location: Industrial Zone

Post by The Ultimate DooMer »

So, something like this would work:

Code: Select all


script 1 (void)

{
if (activatorTID(666))
{
Do_StuffHere
}
else
{
terminate;
}
}
That gives me an idea...
User avatar
cccp_leha
Posts: 1816
Joined: Wed Jul 16, 2003 7:21 am
Location: NJ, USA
Contact:

Post by cccp_leha »

In the attached WAD, I give spawned imps and then spawned barrels TIDs, but the barrels don't seem to have one.
Last edited by cccp_leha on Tue Dec 30, 2003 1:40 pm, edited 1 time in total.
User avatar
HotWax
Posts: 10002
Joined: Fri Jul 18, 2003 6:18 pm
Location: Idaho Falls, ID

Post by HotWax »

It may be that barrels cannot trigger monster-cross lines because they're not monsters. Try setting the "counts as kill" flag and see if that helps. (Of course this will also upset the totals..)
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49234
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Post by Graf Zahl »

HotWax wrote:It may be that barrels cannot trigger monster-cross lines because they're not monsters. Try setting the "counts as kill" flag and see if that helps. (Of course this will also upset the totals..)
No it won't. You have to set the MCROSS flag for them to trigger the line.
Locked

Return to “Editing (Archive)”