Make a switch desapear...

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
Ravick
Posts: 1977
Joined: Sun Aug 22, 2010 10:59 pm
Location: Tubarão, Brasil

Make a switch desapear...

Post by Ravick »

Hi there,

So, I have a Switch that is actually a mid texture in a double sided wall. When player presses "use" at it, it calls a script that, among other things, make the texture of the switch itself desappear using:

Code: Select all

SetLineTexture(230, SIDE_FRONT, TEXTURE_MIDDLE, "-");
It works, but, because of the way the swithce's textures works, it comes to appear again in less then a second.

Of course, I can call one or more Delay function at the script and keep repeating the command, making it re-desappear. But I wonder if would it be a 'legit' way of doing this. (?)

Thanks in advanced.
User avatar
Jekyll Grim Payne
 
 
Posts: 936
Joined: Mon Jul 21, 2008 4:08 am
Graphics Processor: nVidia (Modern GZDoom)

Re: Make a switch desapear...

Post by Jekyll Grim Payne »

There are some workarounds I can think of. Like, you could place a line very close to the switch, without any textures, and then add a function into the script that gives this line a texture which would just cover the while thing. Kind of a lazy method, I guess.
Nevander
Posts: 2254
Joined: Mon Jan 06, 2014 11:32 pm

Re: Make a switch desapear...

Post by Nevander »

Perhaps a better solution would be to set the line's middle vertical offset to something ridiculous using [wiki]Line_SetTextureOffset[/wiki] so it goes off the visible area and then don't wrap the texture. The offset should stay and the texture "disappears." This is a theory though, but I don't see why it wouldn't work in any scenario as long as the offset is far enough.
User avatar
Jimmy
 
 
Posts: 4715
Joined: Mon Apr 10, 2006 1:49 pm

Re: Make a switch desapear...

Post by Jimmy »

[wiki]TranslucentLine[/wiki]?
User avatar
cocka
Posts: 1520
Joined: Sat Jul 02, 2011 7:21 am
Location: Hungary

Re: Make a switch desapear...

Post by cocka »

I would say when you want the switch to disappear just use setlinespecial at the same time and delete its special. Then when you need it again just reset the line special again.
User avatar
Ravick
Posts: 1977
Joined: Sun Aug 22, 2010 10:59 pm
Location: Tubarão, Brasil

Re: Make a switch desapear...

Post by Ravick »

Thanks for the very good ideas, folks! :)
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 48041
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Make a switch desapear...

Post by Graf Zahl »

If you want to manipulate the texture, use a one-time switch which doesn't start a thinker on the texture.
And if you need to reset it, use setlinespecial and setlinetexture to restore everything.

Return to “Editing (Archive)”