Entwining eventscripts and hammer to triger events

Shows u how to use eventscripts to open a door in hammer.

[u][b]Introduction[/b][/u]

Ok Well you are probably scratching your wondering what this tutorial is all about. Well it is quite simple. We are going to use a combination of Hammer editor and Mattie's EventScripts to trigger events in the map. For those of you who do not know what EventScripts is, I suggest you read through it and learn the basics before attempting this tutorial, as I am going to assume you have some basic knowledge when I explain the steps. All the information about EventScripts can be found here: [url]http://www.eventscripts.com/pages/Main_Page[/url] Ok, our goal for today is to create an admin only door. The door will open when the user says a command.

[u][b]STEP ONE: Entities Needed[/b][/u]

Ok what you will need to do is create a door in your map, untick all the flags except for toggle and name the door [b]Adminonlydoor[/b].

We are also going to need a [b]logicauto[/b] entity, and a [b]pointservercommand[/b] entity.

[b][u]STEP TWO: Configuring the script[/b][/u]

Ok we will need to get the basic script done before we do continue in hammer. First thing is first, open up a notepad document and add the following:

[code] block load { // Add as many as you want. People with these SteamIds will be able to access the door. esxsetinfo adminonlydoorcheck "STEAM:X:X:XXXXXX ; STEAM:X:X:XXXXXX" esxmsg Admindoor Loaded }

event playersay { if (eventvar(text) == "!open") do { if (eventvar(essteamid) in servervar(adminonlydoorcheck) do { esfire eventvar(userid) Adminonlydoor open estell eventvar(userid) #multi #greenThe door #lightgreenopens! } else do { estell eventvar(userid) #multi #greenYou lack the permission to use this command! } } if (eventvar(text) == "!close") do { if (eventvar(essteamid) in servervar(adminonlydoorcheck) do { esfire eventvar(userid) Adminonlydoor close estell eventvar(userid) #multi #greenThe door #lightgreenopens! } else do { estell event_var(userid) #multi #greenYou lack the permission to use this command! } } } [/code]

Ok now in this code you will be able to see there is a space that needs configuring. Just change the Steam ID's in there to the ones desired.

What is going to happen, is when the command !open is typed by a verified steam id, it will open the door, and same for !close.

Save the above script under the name: [b]esadmindoor[/b] then save it into a folder called [b]admin_door[/b]

[b][u]STEP THREE: piecing it all together[/b][/u]

Create the [b]point_servercommand[/b] anywhere in your map and name it "Command".

Now, we will get back into hammer, and create the entity [b]logicauto[/b]. In this entity, we want to add the specified output: [b] OnMapSpawn Command Command esload admin_door 0.00 [/b] This tells the game to load the script on map spawn, so the server host does not need to manually put it in the cfg files etc.

[b][u]Summary[/b][/u] Ok we have basically created a script giving authorization to a handful of players to open a special door. This is useful on maps like surf, zombie etc, but can be transformed into anything, like triggers etc. All the trigger work is done in the script, but the results show in the map.

Anyway, I hope this helped, and if it did, leave some feed back and approve it :)

Thanks guys, happy mapping/scripting.

Oh noes! You're not a Member!

Want access to cool stuff? As a member you can:

  • Post. Give the submitter your thoughts on this Tutorial.
  • Say Thanks. Show your appreciation by sending the submitter points.
  • Stamp Posts. Let other posters know what you think of their posts.
  • Rate. Give this Tutorial a rating out of 10.
  • Flag. Alert moderators and warn members of a problem with this Tutorial.
  • Vote. Vote the submitter for the Monthly Awards.
  • Subscribe. Get notified when this submitter submits again.

Interested? Register or Login

Comments

  • im_the_new_guy's Levels
    • P2: Drudge
      Points: 2,025
    • C1: Member
    • A5: Veteran
      Account Age: 4 years
    Posted 3 years ago

    @gippo

    For those of you who do not know what EventScripts is, I suggest you read through it and learn the basics before attempting this tutorial, as I am going to assume you have some basic knowledge when I explain the steps.

    That is what we classify as the basics; knowing where to put ur scripts...

    Creator of Hide N Seek mod
  • gippo's Levels
    • P1: Beggar
      Points: 120
    • C1: Member
    • A5: Veteran
      Account Age: 5 years
    Posted 3 years ago

    There is a problem with this tutorial, you did not tell us what to do with the admin_door folder after saving the txt file in there.

    Also, is there a way to pakrat the script into the map. I would like to use an eventscripts that will make my map only playable in my server.

    Bananite
  • HellRaisedSurfer's Levels
    • P1: Beggar
      Points: 927
    • E1: Helper
      EF: 10
    • C1: Member
    • A5: Veteran
      Account Age: 5 years
    Posted 3 years ago

    @Exfridos

    in that case its easier to:

    1: Create trigger 2: give trigger settings/name 3: create logictimer 4: set time to your delay (in seconds) 5: Add output "ontimer, triggerteleport disable/enable"

    if thats what you meant, pretty simple tutorial, you could have explained the different inputs to, to explain what it does. even tho i use "equalto" instead of "=="

    Surfing Fevah!
  • im_the_new_guy's Levels
    • P2: Drudge
      Points: 2,025
    • C1: Member
    • A5: Veteran
      Account Age: 4 years
    Posted 3 years ago

    I'm unsure what it is you want to do. The event_var is in reference to the player who is typing !open into chat. It then checks the players steam id and fires the door to be open.

    So if you wanted the teleport to enable on the start of the round. You would do: [code] event roundstart { esxset randplayer 0 es getrandplayer randplayer #all esfire servervar(randplayer) triggerteleport enable 180 }

    [/code]

    Just post back if I missed your question completely.

    Creator of Hide N Seek mod
  • Exfridos's Levels
    • C1: Member
    • A5: Veteran
      Account Age: 6 years
    Posted 3 years ago

    Great tutorial. I just have a question.. How do I set it up under event roundstart? I'm not sure about the eventvar part. Cause its not a specific player? I tried like this: event roundstart { esdelayed 180 esfire triggerteleport enable } (note that the trigger IS named that)

    Do I need some kind of eventvar or servervar?

    Thanks.

    Exi
  • im_the_new_guy's Levels
    • P2: Drudge
      Points: 2,025
    • C1: Member
    • A5: Veteran
      Account Age: 4 years
    Posted 3 years ago

    I'm not entirely sure if pack rat will work, personally I haven't tried. I would recommend uploading them as a pair, that way the admin can simply extract the files in the correct locations and your done.

    Creator of Hide N Seek mod
  • Sergesosio's Levels
    • P1: Beggar
      Points: 145
    • C1: Member
    • A5: Veteran
      Account Age: 4 years
    Posted 3 years ago

    So do you have to Pakrat the script or do you have to put it on the server?

  • im_the_new_guy's Levels
    • P2: Drudge
      Points: 2,025
    • C1: Member
    • A5: Veteran
      Account Age: 4 years
    Posted 3 years ago

    Haha. I am actually working on a method of being able to interact with the map as though it was all scripted. For example, walking up to a shop and selecting a weapon, and having the money come out of the players cash. Also, being able to walk into the bank and deposite money and also allowing players to purchase real estate etc using the filters in hammer and other methods in es. Fucken hard at the moment, but I think I have an idea of how to do it.

    Creator of Hide N Seek mod
  • The Distraction's Levels
    • P1: Beggar
      Points: 59
    • E1: Helper
      EF: 1
    • C1: Member
    • A4: Graduate
      Account Age: 4 years
    Posted 3 years ago

    Yay [adds secret teleporter to map]

    Battle Medic
  • im_the_new_guy's Levels
    • P2: Drudge
      Points: 2,025
    • C1: Member
    • A5: Veteran
      Account Age: 4 years
    Posted 3 years ago

    As long as you edit the steam ids in the txt file it all runs off map because of the logic_auto.

    Creator of Hide N Seek mod

Credits

Submitter
im_the_new_guy's Levels
  • P2: Drudge
    Points: 2,025
  • C1: Member
  • A5: Veteran
    Account Age: 4 years
im_the_new_guy (Creator/Co-creator)
Studio
Studio
Hide N Seek Studios
Key Authors
I'm the new guy, go easy :D
Writer

Rating

?/10
Not yet rated.

Additional Info

Genre
Mapping
Difficulty Level
Intermediate

Stats

Post Count
12
ViewCount
2,558
Date Added
3 years ago
Date Modified
3 years ago

Share

Embed Code
Code to use:

More embeddable images

Bookmark and Share