.qc (dot qc) - the group for quake c coders of all denominations. If you make quake one mods and write code in quake c, join our group! I'll try to answer any quake c questions - please post your inquiry in the forums...
Posts | ||
---|---|---|
Random monsters - the call | Locked | |
Thread Options | ||
|
Oct 23 2014 Anchor | |
The wandering monster is a concept from roleplaying games - an unplanned encounter with random consequences. With a slight retool of quake-c you can have random monsters in singleplayer or deathmatch. The first thing you need is a spawn function. For all the standard monsters - the code is almost done! Why almost? When a map monster is spawned, vintage quake engines had to do something called precache. This thread explains precache in detail: Moddb.com Suffice to say if you wanted to use a model or sound in quake, you had to tell the engine so it could pre-load the resource and index it. So, you might have: precache_sound ("knight/kdeath.wav"); // code to set up monster in qc follows }; If you call that function after map load in most quake engines - they will crash. With an engine like Darkplaces, you could simply comment out all precache. If your mod or game is darkplaces only, that is a good idea. For many other engines, however, you need precache, so you need qualifier code: void(float ign) monster_knight = precache_sound ("knight/kdeath.wav"); // may want to obey server var nomonsters // code to set up monster in qc follows }; Update: Since darkplaces has dynamic precache, I decided to null out the precache function. I found out I already put a "wrapper" on it. Go here: Moddb.com to see how it works. What does this mean? And with some maps (those with minimal items and monsters) dynamic precache loads them like lightning. |
Only registered members can share their thoughts. So come on! Join the community today (totally free - or sign in with your social account on the right) and join in the conversation.