Undo Line Special

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.
Locked
User avatar
Tormentor667
Posts: 13556
Joined: Wed Jul 16, 2003 3:52 am
Preferred Pronouns: He/Him
Operating System Version (Optional): Windows 11
Graphics Processor: nVidia (Modern GZDoom)
Location: Germany
Contact:

Undo Line Special

Post by Tormentor667 »

Well, let's say I have given one line a walkover linespecial, which displays a text everytime you try to walk over it.

Now, I want, that this script is no more displayed, if I have executed a special script. How to do?
User avatar
Enjay
 
 
Posts: 27274
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

Post by Enjay »

Two ways spring to mind.

Make the text line a line id (type 121 I think) and use an open script to set the line special to run the text script. Then when your special script executes, it has an instruction in it to either change or remove the special from the line that prints the messages.

or

Have the text script check for a variable. If false, print the text, if true print nothing. Have your special script change the variable.
User avatar
Bio Hazard
Posts: 4019
Joined: Fri Aug 15, 2003 8:15 pm
Location: ferret ~/C/ZDL $
Contact:

Post by Bio Hazard »

just set the line to not be repeatable...
User avatar
Tormentor667
Posts: 13556
Joined: Wed Jul 16, 2003 3:52 am
Preferred Pronouns: He/Him
Operating System Version (Optional): Windows 11
Graphics Processor: nVidia (Modern GZDoom)
Location: Germany
Contact:

Post by Tormentor667 »

Thx but I need the acs command to remove a special from a linedef :) That's the mainproblem, sorry for not being clear enough :|
Cyb
Posts: 912
Joined: Tue Jul 15, 2003 5:12 pm

Post by Cyb »

clearlinespecial(); will clear the special of the line that activated the script
User avatar
Tormentor667
Posts: 13556
Joined: Wed Jul 16, 2003 3:52 am
Preferred Pronouns: He/Him
Operating System Version (Optional): Windows 11
Graphics Processor: nVidia (Modern GZDoom)
Location: Germany
Contact:

Post by Tormentor667 »

And what do I have to do, if I want to clear another line's specia`l?
User avatar
Hirogen2
Posts: 2033
Joined: Sat Jul 19, 2003 6:15 am
Operating System Version (Optional): Tumbleweed x64
Graphics Processor: Intel with Vulkan/Metal Support
Location: Central Germany
Contact:

Post by Hirogen2 »

SetLineSpecial(id, 0 /* nothing heh */);
User avatar
Enjay
 
 
Posts: 27274
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

Post by Enjay »

Bio Hazard wrote:just set the line to not be repeatable...
I thought he wanted the line to be repeatable until the second script had been run because of this...
Tormentor667 wrote:which displays a text everytime you try to walk over it.
Tormentor667 wrote:And what do I have to do, if I want to clear another line's specia`l?
I usually use Hirogen2's way of clearing a line. If you want to clear multiple lines, either give them the same id, or just list them all in the script that is clearing the special.

eg
setlinespecial(1, 80, 10, 0, 0, 0, 0);
setlinespecial(2, 80, 11, 0, 0, 0, 0);

that sets up 2 lines (id 1 and 2) to run 2 different scripts (10 and 11). To clear them use:

setlinespecial(1, 0, 0, 0, 0, 0, 0);
setlinespecial(2, 0, 0, 0, 0, 0, 0);

Not sure if all the 0's are needed, but it works.
User avatar
Tormentor667
Posts: 13556
Joined: Wed Jul 16, 2003 3:52 am
Preferred Pronouns: He/Him
Operating System Version (Optional): Windows 11
Graphics Processor: nVidia (Modern GZDoom)
Location: Germany
Contact:

Post by Tormentor667 »

Thx, I'll try this :)
User avatar
Tormentor667
Posts: 13556
Joined: Wed Jul 16, 2003 3:52 am
Preferred Pronouns: He/Him
Operating System Version (Optional): Windows 11
Graphics Processor: nVidia (Modern GZDoom)
Location: Germany
Contact:

Post by Tormentor667 »

Just one more question: How can I set a wall impassible, blocking everything or normal by acs?
User avatar
Enjay
 
 
Posts: 27274
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

Post by Enjay »

You need to use Setlineblocking.

eg

Setlineblocking(200,BLOCK_EVERYTHING); //Block anything from crossing lines with id 200

Setlineblocking(200,off); //removes blocking from lines with id 200

You'll find the details here:

http://zdoom.doomworld.com/reference/acsintern.html
User avatar
Tormentor667
Posts: 13556
Joined: Wed Jul 16, 2003 3:52 am
Preferred Pronouns: He/Him
Operating System Version (Optional): Windows 11
Graphics Processor: nVidia (Modern GZDoom)
Location: Germany
Contact:

Post by Tormentor667 »

Thx alot :D
User avatar
Hirogen2
Posts: 2033
Joined: Sat Jul 19, 2003 6:15 am
Operating System Version (Optional): Tumbleweed x64
Graphics Processor: Intel with Vulkan/Metal Support
Location: Central Germany
Contact:

Re: Undo Line Special

Post by Hirogen2 »

Tormentor667 wrote:Well, let's say I have given one line a walkover linespecial, which displays a text everytime you try to walk over it.
Sounds like you need ACS_ExecuteAlways.
No, the zeroes are usually not needed. ACS_Execute(script, map, arg1) also works if the script only takes one arg. Try.
Locked

Return to “Editing (Archive)”