Forum

Monster drop weapon and/or key

Discuss the construction of maps and the tools to create maps for 3D games.

Moderator: InsideQC Admins

Monster drop weapon and/or key

Postby Baker » Thu Feb 11, 2010 1:53 pm

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 ..
User avatar
Baker
 
Posts: 3666
Joined: Tue Mar 14, 2006 5:15 am

Postby Baker » Thu Feb 11, 2010 2:43 pm

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 ..
User avatar
Baker
 
Posts: 3666
Joined: Tue Mar 14, 2006 5:15 am

Postby frag.machine » Thu Feb 11, 2010 2:47 pm

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)
User avatar
frag.machine
 
Posts: 2090
Joined: Sat Nov 25, 2006 1:49 pm

Postby ceriux » Thu Feb 11, 2010 3:12 pm

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.
User avatar
ceriux
 
Posts: 2223
Joined: Sat Sep 06, 2008 3:30 pm
Location: Indiana, USA

Postby Spike » Thu Feb 11, 2010 3:24 pm

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.
Spike
 
Posts: 2892
Joined: Fri Nov 05, 2004 3:12 am
Location: UK

Postby Baker » Thu Feb 11, 2010 11:52 pm

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 ..
User avatar
Baker
 
Posts: 3666
Joined: Tue Mar 14, 2006 5:15 am


Return to Mapping

Who is online

Users browsing this forum: No registered users and 1 guest