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

HUD message

Recommended Posts

I would like to know if it is possible to make a script that will trigger only from one side of the line, I want to make a script for each sector in my map but only when the player enters so only from one side, then a HUD message will appear telling his location, also what position for HUD message is center of the screen slightly below top. Thanks for reply's.

Share this post


Link to post

ah, thanks a lot that is exactly what I was looking for

Edit: Not working as I wanted to, as I pass the line it triggers both lines, I created 2 lines near door, the one inside and one outside. But whenever I pass them they activate both.

I used this:


script 2 (int angle)
{
if (LineSide() == LINE_FRONT)
setfont("BIGFONT");
HUDMessage(s:"The Reception"; HUDMSG_FADEOUT, 0, 3, 0.5, 0.25, 0, 3.5);
}

Share this post


Link to post

Unfortunately, I have no clue what you want to achieve.

The best would be screenshots of the editor map layout and editor preview.
Or better still, send me a map of just the problem area
or publish it here for anyone else to help you.

Share this post


Link to post
Kappes Buur said:

Unfortunately, I have no clue what you want to achieve.


Linedefs get triggered regardless what direction you walk over them, except for teleport linedefs. He wants his linedefs to work like teleport linedefs. He wants them to be triggered only from one side. For example, if you had a linedef with sidedef 1 facing east and sidedef 2 facing west, he would want it to be activated only when walking from west to east, not from east to west. But linedefs are activated regardless what direction you walk over them except for teleport linedefs. Simply put, he wants his linedefs to behave like teleport linedefs--they only work if you walk over them when the first sidedef is facing you.

Share this post


Link to post
Ra02 said:

ah, thanks a lot that is exactly what I was looking for

Edit: Not working as I wanted to, as I pass the line it triggers both lines, I created 2 lines near door, the one inside and one outside. But whenever I pass them they activate both.

I used this:


script 2 (int angle)
{
if (LineSide() == LINE_FRONT)
setfont("BIGFONT");
HUDMessage(s:"The Reception"; HUDMSG_FADEOUT, 0, 3, 0.5, 0.25, 0, 3.5);
}


The problem here is that you're missing curly braces.

The "if" conditional only affects the next instruction. So what happens is that the only difference between the front line and the back line is that from the back, the setfont call isn't run.

Try this:

script 2 (int angle)
{
    if (LineSide() == LINE_FRONT)
    {
        setfont("BIGFONT");
        HUDMessage(s:"The Reception"; HUDMSG_FADEOUT, 0, 3, 0.5, 0.25, 0, 3.5);
    }
} 

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
×