Two new ACS functions, please

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
HotWax
Posts: 10002
Joined: Fri Jul 18, 2003 6:18 pm
Location: Idaho Falls, ID

Two new ACS functions, please

Post by HotWax »

Yeah yeah, I know, more ACS feature requests. Hopefully these two will be easy though.

Okay, we already have Light_Stop, which is great for killing a light effect and starting another on cue. Now how about the same with the other two types of sector actions, Ceilings and Floors?

Code: Select all

Ceiling_Stop(tag);
Floor_Stop(tag);

Stops any ceiling/floor movement in the specified sector, immediately halting any ongoing action and allowing a new action to start.

Example:

script 10 (void) { // Broken door
     Door_Open(20, 16);
     delay(20);
     Ceiling_Stop(20);
     Thing_Activate(47); // Sparks
     delay(25);
     Thing_Activate(47);
     Ceiling_LowerInstant(47, 0, 8);
     delay(10);
     Thing_Activate(47);
}
User avatar
Ixnatifual
Posts: 2287
Joined: Fri Dec 12, 2003 6:44 pm
Contact:

Post by Ixnatifual »

lol hotwax u n00b. ur hed is missing.

Anyway, are you still working on the same wad? It sounds awfully complicated :shock:
User avatar
HotWax
Posts: 10002
Joined: Fri Jul 18, 2003 6:18 pm
Location: Idaho Falls, ID

Post by HotWax »

Ummm... Complicated? What? If you think that tiny insignificant script is complicated, well... wait until you see the monster attached to my level. :P
Cyb
Posts: 912
Joined: Tue Jul 15, 2003 5:12 pm

Post by Cyb »

since you can change a specified sector's floor/ceiling heights an arbitrary number of units at any time, I don't really see the need for this, and if you're having problems with delay timing and such, just use tagwait()
User avatar
kn
Posts: 28
Joined: Wed Jul 30, 2003 4:45 pm
Location: NRW
Contact:

Re: Two new ACS functions, please

Post by kn »

HotWax wrote:Yeah yeah, I know, more ACS feature requests. Hopefully these two will be easy though.

Okay, we already have Light_Stop, which is great for killing a light effect and starting another on cue. Now how about the same with the other two types of sector actions, Ceilings and Floors?
Hmm....

You could raise/lower a floor or ceiling 20 times 5 units or 100 times 1 unit instead of 1 time 100 units. Loop a script. To stop -> ACS_Terminate or you could loop within a "while" loop and terminate it by changing the value.

If you add a counter to the loop, you could even find out exactly
where the floor/ceiling level is at any time.

Ok, xxxx_stop command would be a lot easier to handle.
User avatar
cccp_leha
Posts: 1816
Joined: Wed Jul 16, 2003 7:21 am
Location: NJ, USA
Contact:

Post by cccp_leha »

Perhaps HotWax is talking about something similar to what I was talking about here (question #2).
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 »

Cyb wrote:since you can change a specified sector's floor/ceiling heights an arbitrary number of units at any time, I don't really see the need for this, and if you're having problems with delay timing and such, just use tagwait()


How about:

-stopping a perpetual crusher?
-simulating power failure with a lift/door stopping at the current position?
-aborting a sector action to start a new one?


It seems to me that there is some use for such functions.
User avatar
HotWax
Posts: 10002
Joined: Fri Jul 18, 2003 6:18 pm
Location: Idaho Falls, ID

Post by HotWax »

Okay, so my example wasn't the best. I should have mentioned that I know very well that there are other (unnecessarily complicated) ways to accomplish THAT script. The problem is I can't easily show what I'm trying to do with just a script. Therefore, we'll make it a story problem.

Imagine you have a room where you want to trap the player at a certain time. The trouble is, this room has a number of exits that will have to be shut off to do so. Each exit has a door, but if the player recently opened one of these doors, it may still be closing as the trap script executes, and if the player is ready for it, he'll dodge back through the door while it's still opening. There's nothing the script can do about this because it can't affect the door until the door is done raising/waiting/lowering.

Right now you're thinking of a hundred ways to get around this -- the script could wait for the door, or I could have bars or something come down to keep them out. For the sake of argument, let's just pretend none of these methods will work for this situation (because, frankly, they won't). Now how cool would it be if you could just do this?

Code: Select all

script 14 (void) { // Teh l33t trap
     Ceiling_Stop(40); // Each door is tagged 40
     Door_Close(40, 255); // Close the doors lightning fast if they're open
     // Do the rest
}
Cyb
Posts: 912
Joined: Tue Jul 15, 2003 5:12 pm

Post by Cyb »

I suppose they could have some use, though it's still entirely possible to do all that stuff without them, and isn't there already a function that stops a ceiling crusher?
User avatar
HotWax
Posts: 10002
Joined: Fri Jul 18, 2003 6:18 pm
Location: Idaho Falls, ID

Post by HotWax »

/me assassinates Cyb.

There're ways to get monsters to teleport in at the exact same time and ambush the player too, but that doesn't mean we have to get rid of the Thing_Spawn* commands, does it?!
User avatar
Bio Hazard
Posts: 4019
Joined: Fri Aug 15, 2003 8:15 pm
Location: ferret ~/C/ZDL $
Contact:

Post by Bio Hazard »

[quote="HotWax"]/me assassinates Cyb.[quote]

i have footage of this event!

Image <---- cyb being assassinated


:)
User avatar
HotWax
Posts: 10002
Joined: Fri Jul 18, 2003 6:18 pm
Location: Idaho Falls, ID

Post by HotWax »

Come to think of it, there are also ways to create custom light effects that you could stop at any time, and yet a Light_Stop() function was still added for convenience. It is so unreasonable to do the same for ceiling and floor movements?
User avatar
CodeImp
Posts: 456
Joined: Sun Dec 28, 2003 7:40 pm
Location: Netherlands
Contact:

Post by CodeImp »

Its not bad to have a function which can do something another function can too but in a more convient way.

In C/C++ there is a function FillMemory (or memset) which fills a block of memory with a given character. There also is a function ZeroMemory which fills a block of memory with zeros. FillMemory can do that just as well, giving the zero character it does exactly what ZeroMemory does, but the function was just added for convenience because filling with zeros is often required.
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 »

Cyb wrote:I suppose they could have some use, though it's still entirely possible to do all that stuff without them, and isn't there already a function that stops a ceiling crusher?


There's a function that halts a ceiling crusher. But it doesn't terminate it so no other ceiling movement is possible.

And what about your persistent arguing against a possibly useful feature? You are wrong anyway. It is NOT possible to simulate many possible applications of Floor/Ceiling_Stop() and even if they are possible some major hacks and convoluted scripting are often necessary to achieve them.

Some time ago, before there were source ports I had a problem with a level that was supposed to have a door trap. If you entered a room to get a key the door was supposed to close. The problem was that you could get to the key before the door was fully open if you moved quickly so the trap didn't work. With a Ceiling_Stop such an effect would be easily possible without any hacking around and circumventing 'normal' behavior (something I really hate!)
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:Come to think of it, there are also ways to create custom light effects that you could stop at any time, and yet a Light_Stop() function was still added for convenience. It is so unreasonable to do the same for ceiling and floor movements?

No, absolutely not. It would open up possibilities for mappers I can't even see right now. Complex and tightly controlled movement is possible but it's a pain to use so nobody does it. With these functions it will become really easy and I'm quite sure we'd see some maps that'll use it to great effect.

And if you add two ACS-Functions - getfloorheight and getceilingheight - the possibilities would become unlimited because then you could practically do anything you want to a sector - without excessive scripting!
Locked

Return to “Editing (Archive)”