Spawning items at player location

Any aspects of level design for the Source engine.

Spawning items at player location

Postby TorQueMoD on Fri Jul 15, 2011 4:24 am

Hey everyone!

Wondering if its possible to have an item spawn at the player's location rather than simply where its placed in Hammer?

Basically I'm using a point_template to force some ammo to spawn, but I'd like it to actually spawn at the player's location so he automatically gets it rather than an arbitrary spot.

Thought of using a teleporter to re-locate the ammo, but apparently ammo cannot be teleported :(

Thanks!
-TorQue[MoD]
Environment and Game designer
http://www.torquemod.com
User avatar
TorQueMoD
Been Here A While
Been Here A While
 
Joined: Wed Oct 19, 2005 7:15 am
Location: Vancouver, Canada

Re: Spawning items at player location

Postby Welsh Mullet on Fri Jul 15, 2011 1:07 pm

Use a point_clientcommand and do "give item_(whatever the name of the item is)" ?

for example "give item_suit" gives gordon the suit. You can also "give weapon_smg1" for the smg
That's what she said.
User avatar
Welsh Mullet
Regular
Regular
 
Joined: Mon Jul 12, 2010 10:37 am
Location: Reading... Or sometimes Wales for the weekend.

Re: Spawning items at player location

Postby Zecrah on Fri Jul 15, 2011 1:47 pm

Will that require sv_cheats 1 to be on or does point_clientcommand override that?
Major Banter wrote:Zecrah, you've come from nowhere yet have rapidly become a Hammer God.

Wtf.


Check out my weapons tutorial
User avatar
Zecrah
Design Section Moderator
 
Joined: Sat Sep 27, 2008 10:56 am
Location: *Waves vaguely*

Re: Spawning items at player location

Postby LordDz on Fri Jul 15, 2011 2:20 pm

Can't you spawn a weapon with the template at his position?
Somehow.
User avatar
LordDz
Sir Post-a-lot
Sir Post-a-lot
 
Joined: Mon Sep 01, 2008 12:28 pm
Location: Not a serious post ---->

Re: Spawning items at player location

Postby TorQueMoD on Fri Jul 15, 2011 5:06 pm

I forgot to mention that this is for Single player so I'm not sure if you can run client commands in SP?
And yes, you'd also have to turn cheats on and off again in order for that to work, but its definitely a possible hack if I can't get it working any other way.
-TorQue[MoD]
Environment and Game designer
http://www.torquemod.com
User avatar
TorQueMoD
Been Here A While
Been Here A While
 
Joined: Wed Oct 19, 2005 7:15 am
Location: Vancouver, Canada

Re: Spawning items at player location

Postby omnicoder on Fri Jul 15, 2011 5:52 pm

Parent an env_entity_maker set to spawn a point_template with your stuff to the player.
Image
If only the future implemented IForeseeable...
"whats threading? does it have to do with strings?" - stegarootbeer
User avatar
omnicoder
Been Here A While
Been Here A While
 
Joined: Sun Feb 07, 2010 8:35 am

Re: Spawning items at player location

Postby TorQueMoD on Sun Jul 17, 2011 12:01 am

Great idea Omni, I'll try that out on Monday when I'm back at work!

Thanks!
-TorQue[MoD]
Environment and Game designer
http://www.torquemod.com
User avatar
TorQueMoD
Been Here A While
Been Here A While
 
Joined: Wed Oct 19, 2005 7:15 am
Location: Vancouver, Canada

Re: Spawning items at player location

Postby Smurftyours on Sun Jul 17, 2011 12:40 am

You will most likely need to use a trigger_once on top of where the player spawns with an output like "Ontrigger>env_entity_maker>set parent >!activator" To make sure the entity maker gets parented to the player on the map spawn.
jangalomph wrote:Wise words from a wise man. ^
User avatar
Smurftyours
Senior Member
Senior Member
 
Joined: Tue Aug 04, 2009 6:11 pm
Location: California, US.

Re: Spawning items at player location

Postby TheFuzz on Sun Jul 17, 2011 11:36 pm

Why don't you just place the specific ammo type at the feet, he will pick it up automatically.. If you trying to do a timed thing like a dispenser or like a checkpoint then the entity make would work or client command
Image
Image
Image
Image
User avatar
TheFuzz
Member
Member
 
Joined: Sat Jul 16, 2011 7:54 am

Re: Spawning items at player location

Postby nub on Mon Jul 18, 2011 1:39 am

Like Fuzz mentioned, use a point_clientcommand to do a "give" command for whatever ammo entity you wish to spawn. That would be the easiest and most effective route I think.
User avatar
nub
Veteran
Veteran
 
Joined: Tue Nov 15, 2005 1:11 am
Location: Charlotte, NC, US

Re: Spawning items at player location

Postby TorQueMoD on Tue Jul 19, 2011 3:49 am

does point_clientcommand work in Single Player? And again, having to enable cheats to do this isn't the best solution.

And yes Fuzz, I'm trying to place the ammo at his feet... I simply don't know where he's going to be at any given time and don't want to place ammo all over the map.
-TorQue[MoD]
Environment and Game designer
http://www.torquemod.com
User avatar
TorQueMoD
Been Here A While
Been Here A While
 
Joined: Wed Oct 19, 2005 7:15 am
Location: Vancouver, Canada

Re: Spawning items at player location

Postby uuk on Tue Jul 19, 2011 5:42 am

What about "game_player_equip"?
or is this only used for multiplayer games?
Image
Image
uuk
Member
Member
 
Joined: Mon Oct 27, 2008 8:53 am

Re: Spawning items at player location

Postby TorQueMoD on Tue Jul 19, 2011 6:11 am

yeah, game_player_equip only works in MP and either at spawn time, or when the player "uses" it so it doesn't work for me. Didn't get a chance to try Omni's suggestion but I'll do it asap and let you know how it worked.
-TorQue[MoD]
Environment and Game designer
http://www.torquemod.com
User avatar
TorQueMoD
Been Here A While
Been Here A While
 
Joined: Wed Oct 19, 2005 7:15 am
Location: Vancouver, Canada

Re: Spawning items at player location

Postby TorQueMoD on Thu Jul 21, 2011 6:01 am

With my initial test, Omni's idea and smurftyours' suggestion of setting the parent to !activator doesn't seem to work. I'll probably need to play around with a setup in a stand along map to figure out definitively if it will work but I'm in crunch mode at the moment so it'll have to wait.

I'll keep everyone posted
-TorQue[MoD]
Environment and Game designer
http://www.torquemod.com
User avatar
TorQueMoD
Been Here A While
Been Here A While
 
Joined: Wed Oct 19, 2005 7:15 am
Location: Vancouver, Canada

Re: Spawning items at player location

Postby Gary on Thu Jul 21, 2011 6:24 am

After about 20 seconds of playing around in Hammer, I believe I have solved your problem and it doesn't involve parenting anything to the player or to anything.

Env_entity_maker has a "ForceSpawnAtEntityOrigin" input with a parameter override option. Just give it "!player".

The stuff you want to spawn need to have a similar origin for it to be effective. Just mess with it a little.
Have a question related to modding or something I posted? Something that needs staff attention? PM me or message me on Steam(link below)

User avatar
Gary
Interlopers Staff
Interlopers Staff
 
Joined: Wed Dec 16, 2009 12:40 am
Location: USA, FL
Next

Return to Hammer Editor Help

Who is online

Users browsing this forum: Bing [Bot], Google Adsense [Bot]