Hammer Climbing Entity

Remember that scene from CODMOD2, where you get to climb up the cliff? I want to try and do something like that in Hammer. Basically, I want to modify the func_usableladder, so that one of my custom weapons (the ice axes) show up when the players starts to climb.

Anyone have any suggestions? Not much of a coder yet, just need some advice.

Create a lua_run entity and name it something like “lua_processor” then on the func_useableladder set the output OnPlayerGotOnLadder to trigger the lua_run entity’s RunPassedCode input, with a value of “SwitchToSwep(ACTIVATOR)” then in a lua file in your lua/autorun make a function called “SwitchToSwep( ply )” and put the code to change the players swep to your climbing swep.

and for the reverse use the output on the ladder OnPlayerGotOffLadder with another call to the lua_run entity and a function to switch off the swep

Edit:
Was just reading on the valve wiki you might need to use CALLER instead of ACTIVATOR

I haven’t test this but it should work in concept, i’ve used lua_run in conjunction with map events before and it worked pretty well.

We need the good idea rating back. I’m not sure if that would all work perfectly - you’d have to test it, but it sure sounds good.

Here’s a more thorough example on how to use lua_run that I did a while ago:
http://www.facepunch.com/threads/1043754-How-to-make-a-quot-no-prop-zone-quot?p=27079245&viewfull=1#post27079245

Edit: And yeah ACTIVATOR would work, CALLER would get you the ladder. Though the best one to use would be TRIGGER_PLAYER.