Modified Sequencer Charge COG: currently, primary fire lays a sequencer mine w/proximity option while secondary fire detonates the last mine that's been layed. Would like secondary fire to detonate ALL mines that have been layed (or preferably one at a time, 1st layed mine to most recent).
Here's the COG:
Any help is GREATLY appreciated...
Thanx...!
_K_
Here's the COG:
Code:
[Use code tags, please]
# Jedi Knight Cog Script # # WEAP_SEQCHARGE.COG # # WEAPON 8 Script - Sequencer Charge # # Heartier than the Thermals and the DF IM Mines, primary fire #provides proximity mode while secondary fire has been #modified to provide "manual detonation mode" similar to #the MotS Sequencers # -- but only for the last mine that's been dropped # # - Not affected by MagSealed sectors/surfaces. # # [YB & CYW] # # ======================================================================================== symbols model povModel=seqv.3do local model weaponMesh=seqg.3do local keyframe mountAnim=SeqVmnt.key local keyframe dismountAnim=SeqVdis.key local keyframe povfireAnim=SeqVpst1.key local keyframe holsterAnim=kyhlstr.key local flex mountWait local flex fireWait=0.8 local flex holsterWait local template projectile_tpl=+seqchrg2 local template detnt=+sequencer_exp local material flashing=seq0mtp3.mat local int cel local int mode local thing projectile local thing player local int trackID=-1 local int holsterTrack local int selectMode=1 local template detnt=+sequencer_exp local message startup message activated message deactivated message selected message deselected #message newplayer message autoselect message fire message timer end # ======================================================================================== code startup: // Setup delays and variables. mountWait = GetKeyLen(mountAnim); // Start the material flashing. MaterialAnim( flashing, 4, 1 ); GetInv(GetLocalPlayerThing(), 116); Return; # ........................................................................................ fire: player = GetSourceRef(); mode = GetSenderRef(); // Check that the player is still alive. if(GetThingHealth(player) <= 0) Return; if(mode == 0) { if((GetInv(player, 8) == 0) && (GetInv(player, 116) == 0)) { // If out of ammo try to autoswitch to another weapon // if autoswitch is enabled else just switch to fists. if(GetAutoSwitch() & 1) SelectWeapon(player, AutoSelectWeapon(player, 1)); else SelectWeapon(player, 1); Return; } if(GetInv(player, 8) > 0) { projectile = FireProjectile(player, projectile_tpl, -1, 16, '0 0.05 0.00', '0 0 0', 1.0, 0, 0.0, 0.0); jkPlayPOVKey(player, povfireAnim, 1, 0x38); ChangeInv(player, 8, -1.0); ChangeInv(player, 116, 1.0); SetTimerEx(30, 3, 0, 0); } } else { if(GetInv(player, 8) == 0) { if(GetAutoSwitch() & 1) SelectWeapon(player, AutoSelectWeapon(player, 1)); else SelectWeapon(player, 1); Return; } else if(GetInv(player, 116) > 0) DestroyThing(projectile); dummy = CreateThingAtPos(detnt,GetThingSector(projectile),GetThingPos(projectile),'0 0 0'); #ChangeInv(player, 116, -1.0); killTimerEx(3); Return; } Return; # ........................................................................................ activated: player = GetSourceRef(); mode = GetSenderRef(); if(mode > 1) Return; jkSetWaggle(player, '0.0 0.0 0.0', 0); ActivateWeapon( player, fireWait, mode ); Return; # ........................................................................................ deactivated: player = GetSourceRef(); mode = GetSenderRef(); jkSetWaggle(player, '10.0 7.0 0.0', 350); DeactivateWeapon( player, mode ); Return; # ........................................................................................ selected: player = GetSourceRef(); PlayMode(player, 40); { jkSetPOVModel(player, povModel); SetArmedMode(player, 0); jkSetWeaponMesh(player, weaponMesh); } trackID = jkPlayPOVKey(player, mountAnim, 0, 20); jkSetWaggle(player, '10.0 7.0 0.0', 350); SetMountWait(player, GetKeyLen(mountAnim)); jkClearFlags(player, 0x5); SetCurWeapon(player, 8); jkPrintUNIString(player, 8); Return; # ........................................................................................ deselected: player = GetSourceRef(); jkPlayPOVKey(player, dismountAnim, 0, 18); holsterWait = GetKeyLen(holsterAnim); SetMountWait(player, holsterWait); holsterTrack = PlayKey(player, holsterAnim, 1, 0x4); SetTimerEx(holsterWait, 2, 0.0, 0.0); if (trackID != -1) { jkStopPOVKey(player, trackID, 0); trackID = -1; } jkSetWaggle(player, '0.0 0.0 0.0', 0); Return; # ........................................................................................ //newplayer: // player = GetSourceRef(); // // // Make sure that if the player is respawning, the old mount isn't playing anymore. // if (trackID != -1) // jkStopPOVKey(player, trackID, 0); // // Return; # ........................................................................................ autoselect: selectMode = GetSenderRef(); player = GetSourceRef(); // If the player has ammo if(GetInv(player, 8) >= 0) { // query for ammo if(selectMode == -1) { ReturnEx(300.0); Return; } if((selectMode == 0) && !(GetAutoPickup() & 2)) { ReturnEx(300.0); Return; } if((selectMode == 1) && !(GetAutoSwitch() & 2)) { ReturnEx(300.0); Return; } if((selectMode == 2) && !(GetAutoPickup() & 2)) { ReturnEx(300.0); Return; } ReturnEx(-2.0); Return; } else { ReturnEx(-1.0); } Return; # ........................................................................................ timer: StopKey(player, holsterTrack, 0.0); Return; # ........................................................................................ end
Any help is GREATLY appreciated...
Thanx...!
_K_