Monster drop weapon and/or key

Discuss the construction of maps and the tools to create maps for 3D games.
Post Reply
Baker
Posts: 3666
Joined: Tue Mar 14, 2006 5:15 am

Monster drop weapon and/or key

Post by Baker »

I think I've read it is possible to have a monster drop a key or a weapon upon death, but I can't seem to find this information.

Is it possible?
The night is young. How else can I annoy the world before sunsrise? 8) Inquisitive minds want to know ! And if they don't -- well like that ever has stopped me before ..
Baker
Posts: 3666
Joined: Tue Mar 14, 2006 5:15 am

Post by Baker »

Looks like you have an weapon and/or ammo appear in the monster backpack by adding, say,

"weapon" "8" // SNG
"ammo_nails" "10"

to the monster_whatever entity

But it doesn't actually throw the nailgun weapon model. But you get the weapon with the backpack.
The night is young. How else can I annoy the world before sunsrise? 8) Inquisitive minds want to know ! And if they don't -- well like that ever has stopped me before ..
frag.machine
Posts: 2126
Joined: Sat Nov 25, 2006 1:49 pm

Post by frag.machine »

You can make self drop a backpack with stuff simply adding the desired item to the entity's inventory and the callling DropBackPack() during its death sequence (see ogre.qc or soldier.qc for examples). Don't remember if it will work with keys, but things like ammo and weapons work fine. Of course, visually you'll always see a backpack model, so you may want to write your own function to drop the correct model according the item.
I know FrikaC made a cgi-bin version of the quakec interpreter once and wrote part of his website in QuakeC :) (LordHavoc)
ceriux
Posts: 2230
Joined: Sat Sep 06, 2008 3:30 pm
Location: Indiana, USA

Post by ceriux »

yeah, i would just make your own function which drops the exact same stuff (nother words a copy of the original) and just replace the .mdl with the key or what ever and make the inventory of the back pack the key, gun, what ever.
Spike
Posts: 2914
Joined: Fri Nov 05, 2004 3:12 am
Location: UK
Contact:

Post by Spike »

monsters drop stuff because they piggyback the player's drop code.
weapons, ammo can be dropped.
powerups and keys cannot normally be dropped.

that said, keys are not special, and you can probably achieve the same effect by setting the .weapon field to IT_KEY1 or so, by hijacking the weapon dropping code. I just hope it doesn't automatically switch...

Of course, it'll have the regular backpack model. It'll only last for 2 mins max, and it may fall down somewhere that is inaccessible (lava pit, anyone?).
If you want a key to drop properly, you'll need QC code to explicitly do it.
On the other hand, having the monster death trigger a massive drawbridge that swivels down out of the rockface over lava to reveal the much desired key would give a slightly more epic feel to your map. And it would slow down those quakedonequick people a bit, too. Its funny watching them wait.
Baker
Posts: 3666
Joined: Tue Mar 14, 2006 5:15 am

Post by Baker »

ceriux wrote:yeah, i would just make your own function which drops the exact same stuff (nother words a copy of the original) and just replace the .mdl with the key or what ever and make the inventory of the back pack the key, gun, what ever.
frag.machine noticed I'm trying to stick within the confines of stock progs 1.06.

I'm trying to stick with the base set of features and take them as far as they will go. ;)

If I were going to make QC modifications, I'd borrow the item throw from back2forwards. :D I think back2forwards is a super-classic single player release.
Spike wrote:On the other hand, having the monster death trigger a massive drawbridge that swivels down out of the rockface over lava to reveal the much desired key would give a slightly more epic feel to your map. And it would slow down those quakedonequick people a bit, too. Its funny watching them wait.
Heheh, well ...

My stock progs 1.06 soon-to-be single player release uses .alpha and rotating entities so I think I can safely assume that the speed runners will not like my map ;)
The night is young. How else can I annoy the world before sunsrise? 8) Inquisitive minds want to know ! And if they don't -- well like that ever has stopped me before ..
Post Reply