Making Weapons respawn intantly

Need Help? The Day isnt going so well on the Mapping front?
Matt
Vertex
Vertex
Posts: 10
Joined: Sun Nov 05, 2006 10:05 pm

Making Weapons respawn intantly

Post by Matt »

I've checked valve's wiki, but I'm trying to figure out how you create weapons (weapon_357, etc) that re spawn instantly, when picked up.


I'm testing out my ideas on a new way to "Spawn" in a level, where your on a downwards slope when you spawn, and as soon as you get out of the slope you hit a trigger which slides a door in the ceiling open and the weapons fall out from there, and then your thrown out into the main "spawn room" which has ammo spawner's, which would be a picture of a box of 357 shells, then it would spawn one on top of you, thus supply yourself.

I'm working on this because I don't like the idea of "LOL AMMO WHORE!!!11one!" Where you just run around and have like 20x copy's of the AR2 or whatever.
Haii... D:
User avatar
Lark
npc_advisor
npc_advisor
Posts: 1077
Joined: Sat Jun 10, 2006 3:21 am
Location: Termina
Contact:

Re: Making Weapons respawn intantly

Post by Lark »

you could make it so the player spawns with the guns I hate runing around to get guns in spawn.
Matt
Vertex
Vertex
Posts: 10
Joined: Sun Nov 05, 2006 10:05 pm

Post by Matt »

How can you make them SPAWN with the weapons? I've looked in the flags and properties of the info_player_start and there isn't anything.
Haii... D:
User avatar
Lark
npc_advisor
npc_advisor
Posts: 1077
Joined: Sat Jun 10, 2006 3:21 am
Location: Termina
Contact:

Post by Lark »

Matt wrote:How can you make them SPAWN with the weapons? I've looked in the flags and properties of the info_player_start and there isn't anything.
useing the map add look at the one oc_cleanup_modify specking of witch will that be in the next update?
Matt
Vertex
Vertex
Posts: 10
Joined: Sun Nov 05, 2006 10:05 pm

Post by Matt »

Grrr! Damn hammer! Every time I alt-tab to Obsidian, then back, hammer has crashed. It had a bug a while ago that if you minimized it and unminimized it would crash. Anyone else having this bug?
Haii... D:
unconnected
Forum Moderator
Forum Moderator
Posts: 291
Joined: Sat Sep 30, 2006 4:27 am
Location: Manchester, UK
Contact:

Post by unconnected »

Matt wrote:Grrr! Damn hammer! Every time I alt-tab to Obsidian, then back, hammer has crashed. It had a bug a while ago that if you minimized it and unminimized it would crash. Anyone else having this bug?
Yeah I get that bug all the time, I now deliberately alt-tab to a browser or something before alt-tabbing to OC, so when I alt-tab back it comes back to the browser and Hammer doesn't crash. Sucks ass to be honest, but it works.

As for getting the players to spawn with weapons, you need to use a game_player_equip, I'd chuck together a quick .VMF with it in so you could see it in context. However, my main PC is dead at the moment so I will have to leave you with the wiki entry at the Valve Development Community:

http://developer.valvesoftware.com/wiki ... ayer_equip

Hope that helps.
I am the Devils Advocate
Matt
Vertex
Vertex
Posts: 10
Joined: Sun Nov 05, 2006 10:05 pm

Post by Matt »

Does your PC need shock paddles? *Grabs them from BF2* I love the shock paddles... D:

Quick Question: The wiki is not clear enough, how can i make it for MUTI PLAYER OC, the user's have to press E on the "game_player_equip"?
Haii... D:
unconnected
Forum Moderator
Forum Moderator
Posts: 291
Joined: Sat Sep 30, 2006 4:27 am
Location: Manchester, UK
Contact:

Post by unconnected »

Matt wrote:Does your PC need shock paddles? *Grabs them from BF2* I love the shock paddles... D:

Quick Question: The wiki is not clear enough, how can i make it for MUTI PLAYER OC, the user's have to press E on the "game_player_equip"?
Unfortunately I can't remember how to use that part of the functionality, it's also frustrating as frak as I can't launch Hammer to find out for you either.

Please accept my apologies.
I am the Devils Advocate
User avatar
Hyperjag3
npc_strider
npc_strider
Posts: 604
Joined: Mon May 29, 2006 8:54 am
Contact:

Post by Hyperjag3 »

Matt wrote:Does your PC need shock paddles? *Grabs them from BF2* I love the shock paddles... D:

Quick Question: The wiki is not clear enough, how can i make it for MUTI PLAYER OC, the user's have to press E on the "game_player_equip"?
I removed the "use" function on the game_player_equip entity because it is an invisible entity, and I don't know how you'd see it to use it. Instead, make a func_button, and add an output to the game_player_equip that tells it to EquipActivator. If you want it to immediately equip the players on spawn, name the game_player_equip "spawn_items_equip" or add it to a mapname_modify.txt like gtaiiilc said.
Matt
Vertex
Vertex
Posts: 10
Joined: Sun Nov 05, 2006 10:05 pm

Post by Matt »

Hyperjag3 wrote:
Matt wrote:Does your PC need shock paddles? *Grabs them from BF2* I love the shock paddles... D:

Quick Question: The wiki is not clear enough, how can i make it for MUTI PLAYER OC, the user's have to press E on the "game_player_equip"?
I removed the "use" function on the game_player_equip entity because it is an invisible entity, and I don't know how you'd see it to use it. Instead, make a func_button, and add an output to the game_player_equip that tells it to EquipActivator. If you want it to immediately equip the players on spawn, name the game_player_equip "spawn_items_equip" or add it to a mapname_modify.txt like gtaiiilc said.
I'm honored that you spoke to such a mortal. :P

Thanks. Is there a way the "person" can only use it 1 time per spawn? So say we have 2 people.

Person A: I WANT MEH GUNS!!lol!!!11, So he goes to the picture of the guns, and presses E.

Person B. Comes along and does the same, both getting their weapons.

Now person A want's more. But he cannot get any, as it is a "one time use"
Then person a dies. (Too greedy, broke his finger hitting E)
Now he has respawned and he can get a new set of weapons from it. Is this possible?
Haii... D:
skidz
Obsidian Gold
Obsidian Gold
Posts: 3228
Joined: Mon May 29, 2006 6:36 am
Location: Maple Ridge, BC
Contact:

Post by skidz »

The hardcore entmasters out there.... *cough... Zteer... *cough might know of a way of doing that. Fortunatly for me if I want a feature I just code it, but unfortunatly you dont have that option. :wink:
Creating a trigger once per live state wouldnt be tricky. If you dont find another way ill put it on my list.
Matt
Vertex
Vertex
Posts: 10
Joined: Sun Nov 05, 2006 10:05 pm

Post by Matt »

Well, i've got a idea. Just make you get your weapons, "OnTouch" And have a steep slope that you can't crawl up, So you spawn, and are flying down a slope and you pickup your weapons and land in the main area, and can't get any more things. I'll look at the entites tonight, if i get time.
Haii... D:
Zteer
Entity Master
Entity Master
Posts: 46
Joined: Sun Jul 30, 2006 5:34 am
Location: JAPAN

Post by Zteer »

I thought of the method using the "AddOutput" input of a player.
Since it is difficult to explain, please see the attached file.

http://www.geocities.jp/yahjyss/hl2mp/m ... p_once.zip
DaMaN
npc_combinegunship
npc_combinegunship
Posts: 782
Joined: Tue Nov 07, 2006 12:03 am
Location: Parent's Basement
Contact:

Post by DaMaN »

Matt wrote:
Hyperjag3 wrote:
Matt wrote:Does your PC need shock paddles? *Grabs them from BF2* I love the shock paddles... D:

Quick Question: The wiki is not clear enough, how can i make it for MUTI PLAYER OC, the user's have to press E on the "game_player_equip"?
I removed the "use" function on the game_player_equip entity because it is an invisible entity, and I don't know how you'd see it to use it. Instead, make a func_button, and add an output to the game_player_equip that tells it to EquipActivator. If you want it to immediately equip the players on spawn, name the game_player_equip "spawn_items_equip" or add it to a mapname_modify.txt like gtaiiilc said.
I'm honored that you spoke to such a mortal. :P

Thanks. Is there a way the "person" can only use it 1 time per spawn? So say we have 2 people.

Person A: I WANT MEH GUNS!!lol!!!11, So he goes to the picture of the guns, and presses E.

Person B. Comes along and does the same, both getting their weapons.

Now person A want's more. But he cannot get any, as it is a "one time use"
Then person a dies. (Too greedy, broke his finger hitting E)
Now he has respawned and he can get a new set of weapons from it. Is this possible?
Perhaps I can help with this dillema


Ok, so what I'm getting is that you want the players to spawn normally, then when they press E on a picture with a gun on it (or walk through a trigger), they pick up their guns and carry on slaughtering hoards of monsters. If they die, then they can get more weapons, otherwise they can't.

I'm unfortunately away from my home computer at the moment, but I'll see what I can do:

First, you'll need a button (or a trigger, but let's just go with a button for now). Let's call this button "button1". Make it look however you want, sound how you want, etc. Leave the outputs blank for now.

Next, you should probably make a spawn. So... do that.

After that, you need to make a game_player_equip entity. Let's call it "player_equip". Now, declare what weapons you want it to give the player. You can do this by clicking "SmartEdit" off, click "Add", then in the first textbox, type the name of the weapon/item (E.g. weapon_crowbar). In the other textbox (below the first), put the number of the weapon/item you want to give (E.g. 1). Finally, ensure that the "Use Only" flag is ticked.

Now you want to set up the input. For the button "button1", make a new output "OnIn" (or OnPressed or whatever). Set the target entity to player_equip, and leave the input blank! <-- This is critical! The game_player_equip entity is leftover from HL1 as legacy support, and really wasn't used in HL2. As such, the developers never got around to doing anything with the inputs/outputs. And since in HL1 there were no inputs, (you just had a target), there are no inputs in the HL2 version of game_player_equip.

So, what will happen: when the game_player_equip is targetted, it will give the player who originally triggered it whatever weapons are entered into it's values. If the player tries to trigger it again, nothing will happen, though other players can also trigger it. After the player dies, he/she can trigger it again to get the weapon(s).

Note: I have not thoroughly tested the game_player equip entity. I know for a fact that it will only give players a weapon once, until they respawn and trigger it again. However, I'm not positive about ammo or healthpacks or batteries (you could check this). But it works for weapons.


Also, if you merely have a game_player_equip entity set up in the map with the OnUse flag off (and with no inputs, etc), the players will spawn initially with whatever the game_player_equip has been entered with.

Hope that helps!
-DaMaN

P.S. Also, you cannot just directly press use on the game_player_equip entity itself, as it's invisible with no hitbox. The confusingly-named flag "On Use" refers to when the player should be equiped: as soon as they spawn, or when they trigger it.
Svanrog
Combine Rebel
Combine Rebel
Posts: 1319
Joined: Tue Jul 25, 2006 9:17 pm

Post by Svanrog »

Damned! This is one classy mapper ^ :D
Post Reply