unset line action?

Ask about ACS, DECORATE, ZScript, or any other scripting questions here!

Moderator: GZDoom Developers

Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.

Please bear in mind that the people helping you do not automatically know how much you know. You may be asked to upload your project file to look at. Don't be afraid to ask questions about what things mean, but also please be patient with the people trying to help you. (And helpers, please be patient with the person you're trying to help!)

unset line action?

Postby heidi2 » Thu Jan 13, 2022 5:29 pm

I have lets say a repeatable door action on a line.

I want to disable this action via script.

I found SetLineSpecial(lineid, special) but it doesn't seem to do what I want. I put the linedef id as lineid, right? Because only sectors have tags. I used 0 as special. But it doesn't change anything.
heidi2
 
Joined: 07 Jan 2022
Operating System: Other Linux 64-bit

Re: unset line action?

Postby Sir Robin » Thu Jan 13, 2022 5:36 pm

SetLineSpecial changes the special action of a line, like opening a door or teleporting, etc. That's not what you want to change. You want to change the activation. There is a SetLineActivation function but the wiki page doesn't mention anything about changing the repeatable property.
User avatar
Sir Robin
 
Joined: 22 Dec 2021
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: Intel (Modern GZDoom)

Re: unset line action?

Postby Sir Robin » Thu Jan 13, 2022 5:55 pm

So it looks like the actual property on the linedef is a boolean called repeatspecial but I don't see any zscript functions for checking or setting that property

Try this:
SetLineActivation(1, GetLineActivation(1) || 0x200);
change both of those 1s to be your linedef number. If it works, that would set the repeatable and something like this would clear it:
SetLineActivation(1, GetLineActivation(1) &&!0x200);
User avatar
Sir Robin
 
Joined: 22 Dec 2021
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: Intel (Modern GZDoom)

Re: unset line action?

Postby Enjay » Thu Jan 13, 2022 6:18 pm

User avatar
Enjay
Everyone is a moon, and has a dark side which he never shows to anybody. Twain
 
 
 
Joined: 15 Jul 2003
Location: Scotland

Re: unset line action?

Postby heidi2 » Fri Jan 14, 2022 4:41 am

Thanks for the answers! I actually used a global variable now, that way I can even disable the "door" action mid way (prevent it from closing again).

Code: Select allExpand view
script 5 (int tag) {
   if (trap_activated == false) {
      Ceiling_MoveToValue(tag, 16, 64);
      Delay(160);
      if (trap_activated == false) {
         Ceiling_MoveToValue(tag, 64, 24, 1);
      }
   }
}


The only problem left is that I can not cancel that action mid movement (because I want to force "open" even when it is currently in the process of closing). That's not possible, right?
heidi2
 
Joined: 07 Jan 2022
Operating System: Other Linux 64-bit

Re: unset line action?

Postby Enjay » Fri Jan 14, 2022 4:50 am

I think only door types can be reversed while they are moving. You can, of course, set a line to be a door type via ACS and that would work but I don't know how well that suits your particular setup.
User avatar
Enjay
Everyone is a moon, and has a dark side which he never shows to anybody. Twain
 
 
 
Joined: 15 Jul 2003
Location: Scotland


Return to Scripting

Who is online

Users browsing this forum: No registered users and 2 guests