Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Andreas

Opening a cage door (with FraggleScript?)

Recommended Posts

So I built a cage in a room, using the "Midgrate" texture. I want it to open when the player walks across a line. But, since these transparent textures can only be applied on the middle part of the linedef, a simple "open door" special does not work.

 

I'm working with Eureka, so ACS is not an option.

 

As I was racking my brain trying to figure out a way to do this, I came across FraggleScript, which Eureka does support. Information on this is very sparse though, so I'm having difficulty setting it up.

 

The code needs to do two things:

1) change the texture (so that the bars in that section disappear)

2) make that particular linedef "passable" (it's by default set to impassible)

 

I got the first part working, but the second is giving me trouble.

 

Here's my code:

 

script 1
	{
	setlinetexture(6, "-", 0, 2);
	setlinetexture(6, "-", 1, 2);
	lineflag(556, 1, 0);
	lineflag(568, 1, 0);
	lineflag(580, 1, 0);
	}

 

Two things puzzle me about the lineflag thing. The command syntax is like this:

 

int lineflag(int linenum, [int flagnum], [int flagvalue])

 

First thing that bugs me is the "linenum" thing which apparently is supposed to be the linedef's number within the editor (if I understood correctly) rather than a tag. But this seems odd to me as this number can easily change as I edit the map, and thus break the code.

 

Secondly, and more problematic, is the flagnum. I believe the flag I want to lift is ML_BLOCKING, but I can't find anywhere what its "flagnum" is supposed to be. I went with 1 at random, because it always seems to be the first flag listed when I see it mentioned somewhere, but likely I got this wrong, which would explain that the code doesn't work.

 

If someone could help me with this, I would greatly appreciate it.

 

BTW, it bugs me that Fraggle is not supported by every port. This cage thing is *not* a major device in the map, so it wouldn't hinder playability for non-Fraggle players, but if someone can think of a vanilla way to achieve the same thing, I'm all ears!

 

 

Share this post


Link to post

A vanilla compatible way to do this is to have a door sector but:

  1. have a headroom of 1 unit
  2. set the door texture to "-" (will show up as the orange missing texture in Eureka)
  3. put the midgrate on the same line as "-" door texture
  4. clear lower unpeg flag, adjust Y offset to put midgrate in right position

It is tricky to get right, and you want to avoid situations where the player could see the bottom of the closed door, and it probably needs some sector juggling to ensure the midgrate is hidden when the door opens, also the door has to be once-only (if it closes fully, nothing behind will be drawn).

Share this post


Link to post

Thanks Andrew!

 

I came across the video below after posting my message, that essentially does what I was trying to achieve. However, he does it very fast and without giving any explanation, so I couldn't figure out HOW  he was doing it, even after multiple watches. After reading your answer though it all fell into place. You're pretty much describing what he's doing in there.

 

So I gave it a shot and... it works. Kinda. The problem is that in my specific case I am also using an upper texture. So when I do the "door sector" with this technique, the upper texture is skipped, so I end up with an empty space on top, which doesn't look good.

 

That video got me thinking, though... When I first watched it and saw that he was making a dummy sector, my first thought was that he was going to use 3D. So I wondered if I could use that.

 

So here's what I ended up doing:

 

1. Remove all textures from the "door sector", making it an opening in the cage. Tag it.

2. Create a dummy sector with a 3D floor representing the "volume" of the door. Set one of the lines to the same tag as the "door sector".

3. Create a second small sector next to the dummy one with the floor and ceiling heights of an imaginary upper level.

4. Set my W1 special to "elevator up", so that it moves both floor and ceiling at the same time.

 

This worked out perfectly ;)

 

On a side note though, I still can't figure out why the guy in the video made that dummy sector, since he deleted it a few seconds later!

 

 

 

 

 

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×