• 0

How to make a linedef passable and remove midtex when you punch it?

Question

Hello :) I have started work on my first serious map, in eureka builder (cant use gzdoom builder atm, yes I know that i should use it but what you should do and what you can do are different sometimes lol) but I am running into a bit of an issue. Basically the player starts out in front of the entrance to what will be a primarily zombie-filled derelict military base (it will be a multi level wad, the demons will come later :D). Here is what I have so far, you can see a hell sky but the level in question will be on earth, its just a placeholder until i can find a better nighttime skybox:

 

Spoiler

Screenshot_Doom_20170920_164701.png.8fd5e76d0226c48ad113e479db05db0a.png

 

When you try to open the main gate you find that you need the red key. The path to the aforementioned red key is supposed to be behind a fence near the gate which you are supposed to punch through to open:

 

Spoiler

Screenshot_Doom_20170921_161200.png.53dd9e40c2cf2b6324b31f5d223b6027.png

 The problem is i dont know how to do that :/ The main issue is i don't know how to renove the midtex from the linedef and make it passable, i only know how to make basic noob doors lol. Do i have to use a script or is there some other way that can be done without scripting?

Share this post


Link to post

17 answers to this question

  • 0

You will need to use SetLineBlocking to change Blocking of the Linedef, aswell as SetLineTexture to replace textures with "-" (no textures).

 

Example :

#include "zcommon.acs"

//99 is Linedef tag

script 1 (void)
{
    SetLineTexture(99, SIDE_FRONT, TEXTURE_MIDDLE, "-"); //remove middle 
    SetLineTexture(99, SIDE_BACK, TEXTURE_MIDDLE, "-");
    SetLineBlocking(99, BLOCK_NOTHING);
}

 

Edited by dmg_64
1 person likes this

Share this post


Link to post
  • 0
30 minutes ago, dmg_64 said:

You will need to use SetLineBlocking to change Blocking of the Linedef, aswell as SetLineTexture to replace textures with "-" (no textures).

 

Example :


#include "zcommon.acs"

//99 is Linedef tag

script 1 (void)
{
    SetLineTexture(99, SIDE_FRONT, TEXTURE_MIDDLE, "-"); //remove middle 
    SetLineTexture(99, SIDE_BACK, TEXTURE_MIDDLE, "-");
    SetLineBlocking(99, BLOCK_NOTHING);
}

 

Thank you :) That is super simple lol, maybe if I had taken the couple of minutes required to look up those functions I woyodnt have even had to ask about that!

 

Another question, what linedef type would I use if I wanted the script to only activate when it is punched as opposed to say shot? I know g is for guns, P is for running into it, S is for pressing use on it and W is for walking over it but what do M and X do?

Edited by therektafire

Share this post


Link to post
  • 0
7 hours ago, therektafire said:

Another question, what linedef type would I use if I wanted the script to only activate when it is punched as opposed to say shot?

There is no way how an attack-activated line could detect which type of attack hit it, but you can use CheckWeapon within the script to detect whether the script's activator has the Fist selected, and make an if condition that would be entered and do the script's intended action only if he does.

Share this post


Link to post
  • 0

Though it should be noted that that's not foolproof; from my experiments with similar setups, you can shoot a rocket from a distance, then switch to your Fist before it collides with the linedef in question, and it'll count that as you punching it, by that logic. Probably better than nothing given the tools we've got, though.

Share this post


Link to post
  • 0

If you use the non-missile-attack activation type, only hitscan attacks will be able to activate the line, and since hitscan attacks are instantaneous, that should guarantee that the player will still have the same weapon selected when the attack impacts.

Edited by scifista42

Share this post


Link to post
  • 0
1 hour ago, scifista42 said:

If you use the non-missile-attack activation type, only hitscan attacks will be able to activate the line, and since hitscan attacks are instantaneous, that should guarantee that the player will still have the same weapon selected when the attack impacts.

Which one is that, G? Also when I go to import the script should all the scripts i write all be in the same behavior lump or can they/should they be in multiple ones?

Share this post


Link to post
  • 0

Well I got it to work but I had to do a bit of fiddling around with the area around the gate since I didn't realize those functions required line IDs and eureka doesnt support UDMF meaning i have to place the line id as a special and then put the trigger in a really thin sector in front of the gate which works well :)

Share this post


Link to post
  • 0
On 9/21/2017 at 5:39 PM, dmg_64 said:

You will need to use SetLineBlocking to change Blocking of the Linedef

Actually you should probably use Line_SetBlocking since SetLineBlocking is apparently deprecated for some reason.

Edited by Nevander

Share this post


Link to post
  • 0

If I was using UDMF I would probably care more about using the most up to date code but I'm already only using Hexen format which is pretty old as it is, plus the code has already been compiled and put in :D though I probably will patch over/replace the current behavior lump with new scripts when I need them which I know I will so I'll probably just change it then

Share this post


Link to post
  • 0

Help :/ I tried adding some basic logic to the script to only make it open when you punch it 3 times but it is not working... Here is the code i am using:

 

#include "zcommon.acs"

bool alreadyopened = false;
int timespunched = 0;

script 1 (void)//gate punch open script
{
    if (CheckWeapon("Fist") && timespunched < 3) //gate is not punched open yet
      {
       timespunched = timespunched++;
     
      }

    if (CheckWeapon("Fist") && timespunched >= 3) //gate has been punched 3 or more times, check if already opened 
      {
       if (alreadyopened == true) //already opened, do nothing
        {
         terminate;
        }
       //gate has not been opened yet, so do that
       alreadyopened = true;
       SetLineTexture(21, SIDE_FRONT, TEXTURE_MIDDLE, "-");
       SetLineTexture(21, SIDE_BACK, TEXTURE_MIDDLE, "-");
       SetLineBlocking(21, BLOCK_NOTHING);
      }
}

For some reason when I try to do it this way it won't work and idk why unless the fist isn't actually called "Fist" in the inventory or something? The wiki entry for CheckWeapon is almost exactly the same thing i'm trying to do and I'm assuming it is correct...

Edited by therektafire

Share this post


Link to post
  • 0

Check if you set the line action as repeatable. Also:

timespunched = timespunched++;

Should be just:

timespunched++;

Share this post


Link to post
  • 0

Crap I did not set it as repeatable LOL. There's the problem right there

Share this post


Link to post
  • 0

Ok scifista I have 3 more questions, 2 about scripting 1 about mapping. So

 

1. How do I make a sound play when you punch the fence, right now there is no sound that plays which I definitely dont want in the final map

 

2. Are there any ACS highlighting and autocomplete/intellisense files available for code editors like notepad++

 

3. How do you add dynamic lights to a map? I tried putting a thing with a value of 9800 (the value of a point light according to the zdoom wiki) and filling out the arguments properly but it didn't work, when I went into the game I wanted to see a bright yellow light but I didn't see anything :(

Share this post


Link to post
  • 0
52 minutes ago, therektafire said:

1. How do I make a sound play when you punch the fence, right now there is no sound that plays which I definitely dont want in the final map

 

2. Are there any ACS highlighting and autocomplete/intellisense files available for code editors like notepad++

 

3. How do you add dynamic lights to a map? I tried putting a thing with a value of 9800 (the value of a point light according to the zdoom wiki) and filling out the arguments properly but it didn't work, when I went into the game I wanted to see a bright yellow light but I didn't see anything :(

1: http://zdoom.org/wiki/PlaySound

 

2: https://forum.zdoom.org/viewtopic.php?f=3&t=46674

 

3: Doesn't Hexen format only have 3 arguments instead of 5...? And PointLight needs the 3 RGB values + intensity, adding up to 4. Hm.

Share this post


Link to post
  • 0

Well there are definitely more than 3 argument slots under the special which is where I assume they are supposed to go. The wiki just says you need to put the values in "the arguments" so thats where I put them in the order specified, maybe the eureka dev fucked up and put in too many slots for thing specials, idk. I know line specials can have 5 slots because acs_execute uses all of them for script number map number and 3 optional script arguments

Edited by therektafire

Share this post


Link to post
  • 0

Actually after reading other posts about dynamic lights on here I think I might know why they didn't work initially, apparently generic base light actors like pointlights need to be manually activated with scripts and they start deactivated by default unless you use gldefs to add lights to preexisting actors which I did not know. And the wiki mentioned nothing about that either, it just said you can turn them on and off with thing_activate/thing_deactivate... I can't really test out this theory right now but I will tomorrow for sure

Edited by therektafire

Share this post


Link to post
  • 0

Wait, nvm, I didn't need a script, I realized eureka indeed did fuck up and erased some of the values of the arguments when I put 0 in them >:( Putting 1 instead worked fine! Now I have dynamic lights :D Having lights.pk3 and brightmaps.pk3 autoload probably helped too

Screenshot_Doom_20170926_171550.png

Edited by therektafire

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