give !player weapon_crowbar ?

give !player weapon_crowbar ?

Re: give !player weapon_crowbar ? Posted by Dark Tree on Sat Nov 8th 2008 at 1:33pm
Dark Tree
646 posts
Posted 2008-11-08 1:33pm
646 posts 264 snarkmarks Registered: Apr 30th 2004 Occupation: DigiPen student Location: USA
Is there a way to give the crowbar to the player other than the traditional "picking it up?" I was hoping there would be a flag that prevents the player from picking it up until he does something else, 'unlocking' it. There is no such flag. Basically, I want the user to only be able to pick up the crowbar after he gets the suit.

Is there a way to execute console commands in-game? If so, I could use a prop_dynamic with the crowbar world model surrounded by a disabled trigger that when enabled, would kill the prop_dynamic and run the command "give weapon_crowbar"

Any thoughts?
Re: give !player weapon_crowbar ? Posted by amanderino on Sat Nov 8th 2008 at 6:20pm
amanderino
205 posts
Posted 2008-11-08 6:20pm
205 posts 21 snarkmarks Registered: Nov 13th 2006 Location: United States
Couldn't you use a game_player_equip or point_template entity?
Re: give !player weapon_crowbar ? Posted by Campaignjunkie on Sat Nov 8th 2008 at 8:56pm
Campaignjunkie
1309 posts
Posted 2008-11-08 8:56pm
1309 posts 329 snarkmarks Registered: Feb 12th 2002 Occupation: Student Location: West Coast, USA
I would avoid console command hacks. (Though for the record, there's point_clientcommand and point_servercommand)

Instead, you can do what amanderino suggests: spawn a crowbar with env_entity_maker.
Re: give !player weapon_crowbar ? Posted by Dark Tree on Sun Nov 9th 2008 at 5:03am
Dark Tree
646 posts
Posted 2008-11-09 5:03am
646 posts 264 snarkmarks Registered: Apr 30th 2004 Occupation: DigiPen student Location: USA
Woohoo! Thank you amanderino and Campaignjunkie! It got the desired effect I want.
amanderino said:
Couldn't you use a game_player_equip or point_template entity?
I can't use a game_player_equip, as it automatically gives you a crowbar on level spawn, unless you set it to "use" only. When I set it to use, I'm not sure exactly how to trigger it to give the player a crowbar.

I used a setup consisting of:

1x point_template
1x env_entity_maker
1x logic_case
1x prop_dynamic (world model: w_crowbar.mdl)
1x trigger_once
1x weapon_crowbar

Walking into the trigger_once immediately kills the prop_dynamic and initiates the logic_case. The logic_case triggers the point_template, which is linked to the env_entity_maker. The env_entity_maker spawns the weapon_crowbar on top of the player, giving him the crowbar. So that more crowbars dont spawn, The original trigger_once kills all of the entities after .25 seconds. This all happens instantly except for the killing of entities, because I added the delay to make sure it spawns a crowbar first.

Whether or not that makes sense, I got it to work! Thanks guys.
Campaignjunkie said:
I would avoid console command hacks.
It was hard... but I resisted. :D
Re: give !player weapon_crowbar ? Posted by amanderino on Sun Nov 9th 2008 at 5:49pm
amanderino
205 posts
Posted 2008-11-09 5:49pm
205 posts 21 snarkmarks Registered: Nov 13th 2006 Location: United States
"Dark Tree" said:
amanderino said:
Couldn't you use a game_player_equip or point_template entity?
I just posted how to do this in another thread, actually.
Just set a trigger brush to the "Use" input whenever triggered (you might want to set it to Fire Once if it's single player). Hammer will tell you that the Use input is invalid, but it does work in game.
Here is the post from the other thread, detailing how to change starting weapons.
Just modify it a bit for your purposes (you won't need the weapon_strip for example):
amanderino said:
Alright!
I've figured out how to change starting weapons:

1.) As I had said before, you still create a large brush over your entire map. It's not really important to name it, but you might want to just for organization.

2.) Create a game_player_equip entity. Name it whatever you'd like, you will need to refer to it in the I/O. After you've named it, turn off smart edit to input what you would like it to equip. To do this: Click "Add". Now you fill out the boxes here. In my little map, I had it equip an RPG. So, the key was weapon_rpg. and the value was 1. If you set a higher value it will spawn more RPGs. I believe that when it equips you with a weapon it gives you full ammo for said weapon. I do not know a way around this yet, and there may not be a way.
Next, go to the flags tab and check "Use only.".
Click apply and close.

3.) Lastly, set the Output for the trigger_weapon_strip like so:
My Output Named > OnStartTouch
Target Entities Named > (name of the game_player_equip)
Via This Input > Use

Apply and Close.
Note: Hammer will try to tell you that Use is an incorrect Input for the game_player_equip entity by turning the Use command red in the Via This Input box. It is a liar. It works fine in game.
Re: give !player weapon_crowbar ? Posted by Dark Tree on Mon Nov 10th 2008 at 1:35am
Dark Tree
646 posts
Posted 2008-11-10 1:35am
646 posts 264 snarkmarks Registered: Apr 30th 2004 Occupation: DigiPen student Location: USA
Ummm... amanderino rocks my cock off. This simplified my crazy entity setup of like eight or so entities into two. the trigger_once and the game_player_equip. Epic. Valve for serious needs to update Hammer to have 'Use' as one of game_player_equip's options, and not have it in red as if it's wrong :/.

Thanks to both of you for looking into this for me.
Re: give !player weapon_crowbar ? Posted by amanderino on Mon Nov 10th 2008 at 3:26am
amanderino
205 posts
Posted 2008-11-10 3:26am
205 posts 21 snarkmarks Registered: Nov 13th 2006 Location: United States
:lol:
No problem.

It's said that you can modify your .fgd file but I don't know where you add a new line. I've never really looked into it, because I don't think it's really worth the time to just change the word Use from red-colored font to black. As long as it works.