Re: Spawn weapons on demand
Posted by Leperous on
Mon Jan 10th 2005 at 10:50pm
Posted
2005-01-10 10:50pm
Leperous
Creator of SnarkPit!
member
3382 posts
1635 snarkmarks
Registered:
Aug 21st 2001
Occupation: Lazy student
Location: UK
Does anyone know how to spawn weapons/items when triggered? The only way I can think of right now is to make an invisible func_breakable, but these create gibs and sound when broken. I want the weapons to drop to the floor, so a game_player_equip isn't really feasible (it also can't be parented or enabled/disabled...)
Re: Spawn weapons on demand
Posted by Bobv on
Mon Jan 10th 2005 at 10:54pm
Posted
2005-01-10 10:54pm
Bobv
member
198 posts
40 snarkmarks
Registered:
Jan 9th 2005
Occupation: n/a
Location: USA
What if you had the weapons in glass boxes so the player could see but
not touch, at the push of a button the bottom of this glass box
(func_door) opens, and the weapon drops down..... it'll be like a
vending machine :biggrin:
Re: Spawn weapons on demand
Posted by Leperous on
Tue Jan 11th 2005 at 12:32am
Posted
2005-01-11 12:32am
Leperous
Creator of SnarkPit!
member
3382 posts
1635 snarkmarks
Registered:
Aug 21st 2001
Occupation: Lazy student
Location: UK
Well, I had a look at it and it uses a monster_maker to spawn weapons.
Unfortunately, it would seem that trying to get an npc_maker to spawn a weapon causes the game to crash :sad:
Re: Spawn weapons on demand
Posted by Rof on
Tue Jan 11th 2005 at 1:10am
Rof
member
210 posts
41 snarkmarks
Registered:
Dec 3rd 2004
Use point_template and env_entity_maker.
You make your inital entity, and set the "Template XX" field of a point_template to it's name.
Then you set the env_entity_maker's "Point_template to spawn" to the
name of the point_template, and you can fire the env_entity_maker's
"ForceSpawn" input to spawn an item.
Works with every entity I tried with it, anyway. Weapons, oilbarrels, rollermines, etc.
What's really cool is you can spawn mutiple entites at once (using the various
Template fields of point_template), and they'll keep working.
i.e. you can spawn a func_physbox that has a phys_thruster and an
env_spark parented to it, and all I/O connections etc. will still work.
Re: Spawn weapons on demand
Posted by Leperous on
Wed Jan 12th 2005 at 10:35pm
Posted
2005-01-12 10:35pm
Leperous
Creator of SnarkPit!
member
3382 posts
1635 snarkmarks
Registered:
Aug 21st 2001
Occupation: Lazy student
Location: UK
Excellent, thanks :smile: This will even help with my Combine prison pod problems!
The only problem is that the weapons will keep respawning, but that can be easily fixed with some sort of trigger that kills them soon after.