|
| /* How to add DropWeapon to the frogbot. By Gerard "numb" Ryan email: numb@numb.quakeintosh.com In DEFS.QC (at bottom): // MODIFICATION - [numb] float game_drop_items; float GAME_DROP_ITEMS = 32768; float IMP_DROPPED_ITEMS = XXX; // where XXX is the impulse you assign // MODIFICATION - [numb] save and close In PLAYER.QC: void() PlayerDie = { ClientObituary(); DropBackpack(); // MODIFICATION - [numb] DropWeapon(self); // MODIFICATION - [numb] ... ... save and close In BOTIMP.QC: void() SetGame = { game_drop_items = gamemode & GAME_DROP_ITEMS; ... ... void() PrintRules = { msg_entity = self; msg_level = PRINT_HIGH; sprint("deathmatch "); sprint_(deathmatch); sprint("\nteamplay "); sprint_(teamplay); sprint("\n"); // MODIFICATION - [numb] print_boolean(GAME_DROP_ITEMS , "drop_items "); // MODIFICATION - [numb] ... ... void() SetImpulses1 = { msg_entity = self; // MODIFICATION - [numb] alias("drop_items", IMP_DROPPED_ITEMS); // MODIFICATION - [numb] ... ... void() ImpulseCommands = { ... ... else if (impulse_ == IMP_POWERUP) ToggleGameMode(GAME_ENABLE_POWERUPS, "powerup"); // MODIFICATION - [numb] else if (impulse_ == IMP_DROPPED_ITEMS) ToggleGameMode(GAME_DROP_ITEMS , "drop_items"); // MODIFICATION - [numb] ... ... save and close In WEAPONS.QC: void() W_Precache = { // MODIFICATION - [numb] W_PrecacheDropped (); // dropped items // MODIFICATION - [numb] ... ... save and close In PREPROGS.SRC: #includelist defs.qc kascam.qc teamplay.qc subs.qc combat.qc items.qc // MODIFICATION - [numb] dropped.qc // MODIFICATION - [numb] observ.qc ... ... save, close and compile */ void () W_PrecacheDropped = { // Precache weapons here precache_model ("progs/g_rock2.mdl"); precache_model ("progs/g_rock.mdl"); precache_model ("progs/g_light.mdl"); precache_model ("progs/g_nail2.mdl"); precache_model ("progs/g_nail.mdl"); precache_model ("progs/g_shot.mdl"); }; void () BackpackTouch; void (entity e) DropWeapon = { local entity item; if (pre_game) return; if (!game_drop_items) return; if (deathmatch != 1) return; if (e.client_) { if (e.weapon == IT_AXE) return ; if (e.weapon == IT_SHOTGUN) return; item = spawn(); item.origin = e.origin - '0 0 24'; item.goal_respawn_time = time; item.classname = "dynamic_item"; item.items = e.weapon; e.weapon = 0; if (item.items == 2) { setmodel (item, "progs/g_shot.mdl"); item.netname = "Double-Barrel Shotgun"; item.desire = goal_supershotgun1; item.ammo_shells = 5; if (e.ammo_shells > 5) e.ammo_shells = (e.ammo_shells - 5); else e.ammo_shells = 0; } else if (item.items == 4) { setmodel (item, "progs/g_nail.mdl"); item.netname = "Nailgun"; item.desire = goal_nailgun1; item.ammo_nails = 30; if (e.ammo_nails > 30) e.ammo_nails = (e.ammo_nails - 30); else e.ammo_nails = 0; } else if (item.items == 8) { setmodel (item, "progs/g_nail2.mdl"); item.netname = "Super Nailgun"; item.desire = goal_supernailgun1; item.ammo_nails = 30; if (e.ammo_nails > 30) e.ammo_nails = (e.ammo_nails - 30); else e.ammo_nails = 0; } else if (item.items == 16) { setmodel (item, "progs/g_rock.mdl"); item.netname = "Grenade Launcher"; item.desire = goal_grenadelauncher1; item.ammo_rockets = 5; if (e.ammo_rockets > 5) e.ammo_rockets = (e.ammo_rockets - 5); else e.ammo_rockets = 0; } else if (item.items == 32) { setmodel (item, "progs/g_rock2.mdl"); item.netname = "Rocket Launcher"; item.desire = goal_rocketlauncher1; item.ammo_rockets = 5; if (e.ammo_rockets > 5) e.ammo_rockets = (e.ammo_rockets - 5); else e.ammo_rockets = 0; } else if (item.items == 64) { setmodel (item, "progs/g_light.mdl"); item.netname = "Thunderbolt"; item.desire = goal_lightning1; item.ammo_cells = 15; if (e.ammo_cells > 15) e.ammo_cells = (e.ammo_cells - 15); else e.ammo_cells = 0; } else { item.netname = "nothing"; item.classname = ""; item.touch = platform.touch; // NULL item.nextthink = time + 0.1; item.think = SUB_Remove; item.solid = 0; return; } item.velocity_z = 500; item.velocity_x = -250 + (random() * 300); item.velocity_y = -250 + (random() * 300); item.flags = FL_ITEM; item.solid = SOLID_TRIGGER; item.movetype = MOVETYPE_BOUNCE; setsize (item, '-16 -16 0', '16 16 56'); item.touch = BackpackTouch; item.frogbot_nextthink = time + 60; // remove after 1 minute InitDynamicItem(item); } }; |
The author of this page is Andrius 'Wrecker' Jovaisa. Page is made using Frontpage Express by Microsoft, and some .html code added with Notepad. Best viewed in 800x600 resolution with small fonts or 1024x768 with small fonts. Site was created in 26th of October, 1998. Page is hosted by Botepidemic, which is hosted by Telefragged - the best Quake/II/IIIarena news site on the net!