Hi!
I have a really big problem. For the first, weapon 5 can't be selected. I know that in a pulse of 0.1 I SetInv(GetLocalPlayerThing(), 5, 1); but in ONE level, weapon 5 doesn't exist. I know it's not a problem in the weapon cog because, if that was the case, the previous weapon would be looping in its Dismount animation.
This is where I set the weapons you may only have in this perticular level.
This would be the start of the one level.
And this is the weapon COG.
I know you'd like the whole level to check out all phenomenons, but it's a bit of a secret project. And I can't think of anything in the level that would do it, nor did I have anything to do with the weapons in any of my other COGs. I could give you level status: 138 things and 776 sectors.
Oh, I do take powercells but still nothing happens. Oh, and also, this weapons COG was taken from the ST-rifle cog, because I wanted them to do the same thing only with different power sources and bolts. One with energy and one with power. AND, when I switch between ST-rifle, and Crossbow, the pick-out animation (which is the same) goes all hay wire. I pick out ST-rifle, it's normal. I pick out Crossbow straight after, it's down in the corner, hard to see, with the hand looping in its put-away animation.
/Edward
[This message has been edited by Edward (edited February 26, 2004).]
I have a really big problem. For the first, weapon 5 can't be selected. I know that in a pulse of 0.1 I SetInv(GetLocalPlayerThing(), 5, 1); but in ONE level, weapon 5 doesn't exist. I know it's not a problem in the weapon cog because, if that was the case, the previous weapon would be looping in its Dismount animation.
Code:
# Always do this: # # By Edward symbols message startup message pulse model pl=newman.3do local model weaponmesh=transportTRAIN_small.3DO local end # code startup: SetPulse(0.1); SetThingModel(GetLocalPlayerThing(),pl); ChangeInv(GetLocalPlayerThing(), 13, 1000.0); sleep(0.2); jkSetWeaponMesh(GetLocalPlayerThing(),weaponmesh); return; pulse: SetInv(GetLocalPlayerThing(), 2, 0); // briar SetInv(GetLocalPlayerThing(), 3, 1); // STRifle SetInv(GetLocalPlayerThing(), 5, 1); // Crossbow SetInv(GetLocalPlayerThing(), 6, 0); // Repeater SetInv(GetLocalPlayerThing(), 7, 0); // Railgun SetInv(GetLocalPlayerThing(), 9, 0); // Concussion Rifle SetInv(GetLocalPlayerThing(), 15, 0); // Railcharges return; end
This is where I set the weapons you may only have in this perticular level.
Code:
#Level master COG #Generated by JED 0.95 beta symbols message startup int player local material WhiteSaberSide=WhiteSaberSide.mat local material WhiteSaberTip=WhiteSaberTip.mat local template Wall=+ssparks_wall local template Blood=+ssparks_blood local template Saber=+ssparks_saber local end code startup: sleep(1); // Register COG as master COG SetMasterCOG(GetSelfCOG()); player = GetLocalPlayerThing(); JKSetSaberInfo(player,WhiteSaberSide,WhiteSaberTip,0.002,0.002,0.125,Wall,Blood,Saber); // Initialise Goals SetInv(player, 99, 5000); SetGoalFlags(player, 0, 1); SetGoalFlags(player, 1, 0); // Give player weapons and ammo SetInv(player, 1, 1); // fists SetInv(player, 2, 0); // briar SetInv(player, 3, 1); // ST Rifle SetInv(player, 4, 0); // TD SetInv(player, 5, 1); // Crossbow SetInv(player, 6, 0); // Repeater SetInv(player, 7, 0); // Railgun SetInv(player, 8, 0); // Sequencer charges SetInv(player, 9, 0); // Concussion Rifle SetInv(player, 10, 0); // Lightsaber SetInv(player, 11, 0); // Energy SetInv(player, 12, 0); // Power SetInv(player, 15, 0); // Railcharges // Initialize weapon. SetFireWait(player, -1); SetMountWait(player, 0); SetCurInvWeapon(player, 0); SelectWeapon(player, AutoSelectWeapon(player, 1)); sleep(1); SetGoalFlags(player, 0, 2); SetGoalFlags(player, 1, 1); // Force ranking SetInv(player, 20, 8); SetInv(player, 14, 300); SetInv(player, 21, 4.0); SetInv(player, 22, 4.0); SetInv(player, 24, 4.0); SetInvAvailable(player, 21, 1); SetInvAvailable(player, 22, 1); SetInvAvailable(player, 24, 1); SetInvActivated(player, 21, 1); SetInvActivated(player, 22, 1); SetInvActivated(player, 24, 1); sleep(3); SetInvActivated(player, 21, 0); SetInvActivated(player, 22, 0); SetInvActivated(player, 24, 0); jkSyncForcePowers(); Return; end
This would be the start of the one level.
Code:
# Jedi Knight Cog Script # # WEAP_STRIFLE.COG # # WEAPON 5 script - Crossbow # # The standard rifle used by the tuskans. Not as accurate as the Bryar Pistol. # This weapon has only one type of fire. # # - Affected by MagSealed sectors/surfaces. # # [YB & CYW] # # (C) 1997 LucasArts Entertainment Co. All Rights Reserved symbols model povModel=strv.3do local model newguy=newmang.3do local model guy=newman.3do local keyframe mountAnim=STRvUP.key local keyframe dismountAnim=StrVdis.key local keyframe povfireAnim=STRvshoot.key local keyframe holsterAnim=putaway.key local sound mountSound=df_rif_ready.wav local sound dismountSound=PutWeaponAway01.wav local sound fireSound=bcfire01.wav local sound outSound=pistout1.wav local template projectile=+crossbowbolt4 local thing player local flex fireWait=0.1 local flex holsterWait local flex powerBoost local flex autoAimFOV=25 local flex autoAimMaxDist=5 local int dummy local int trackID=-1 local int fireChannel=-1 local int holsterTrack local int mode local message activated message deactivated message selected message deselected message autoselect message fire message timer message pulse end # ======================================================================================== code fire: player = GetSourceRef(); mode = GetSenderRef(); // Check that the player is still alive. if(GetThingHealth(player) <= 0) { Return; } // Check Ammo - If we are out, autoselect best weapon. // It should always use two energy cells, but -- as in DF -- // allow the last fire if there is only one left... if(GetInv(player, 12) < 1.0) { PlaySoundThing(outSound, player, 1.0, -1, -1, 0x80); if((GetAutoSwitch() & 1)) SelectWeapon(player, AutoSelectWeapon(player, 1)); Return; } // Get random aiming error SetPOVShake('0.0 -.003 0.0', '1.5 0.0 0.0', .05, 80.0); dummy = FireProjectile(player, projectile, fireSound, 8, '0.0368 0.0896 0.00','0 0 0', 1.0, 0x30, autoAimFOV, autoAimFOV*2); // SetThingVel(dummy, vectorScale(GetThingVel(dummy), 0.01)); ChangeInv( player, 12, -1.0 ); jkPlayPOVKey( player, povfireAnim, 1, 0x38 ); powerBoost = GetInv(player, 63); ChangeFireRate(player, fireWait/powerBoost); Return; # ........................................................................................ activated: player = GetSourceRef(); mode = GetSenderRef(); if(GetInv(player, 12) < 1.0) { if((GetAutoSwitch() & 1)) SelectWeapon(player, AutoSelectWeapon(player, 1)); else PlaySoundThing(outSound, player, 1.0, -1, -1, 0x80); Return; } jkSetWaggle(player, '0.0 0.0 0.0', 0); powerBoost = GetInv(player, 63); ActivateWeapon(player, fireWait/powerBoost, mode); Return; # ........................................................................................ deactivated: player = GetSourceRef(); jkSetWaggle(player, '10.0 7.0 0.0', 350); DeactivateWeapon(player, mode); Return; # ........................................................................................ selected: // Play external animation PlayMode(player, 41); // Set up meshes and models. jkSetPOVModel(player, povModel); SetArmedMode(player, 1); jkSetWaggle(player, '10.0 7.0 0.0', 350); // Play sound and animation. PlaySoundThing(mountSound, player, 1.0, -1, -1, 0x80); trackID = jkPlayPOVKey(player, mountAnim, 0, 20); SetMountWait(player, GetKeyLen(mountAnim)); // Set flags, etc. jkClearFlags(player, 0x5); SetCurWeapon(player, 5); // Check Ammo - If we are out, autoselect best weapon. if(GetInv(player, 12) < 2.0) { if((GetAutoSwitch() & 1)) SelectWeapon(player, AutoSelectWeapon(player, 1)); } SetActorFlags(player, 0x2000); SetThingModel(player,newguy); Return; # ........................................................................................ deselected: PlaySoundThing(dismountSound, player, 1.0, -1, -1, 0x80); 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); SetThingModel(player,guy); Return; # ........................................................................................ autoselect: // If the player has the weapon if(GetInv(player, 5) != 0.0) { // If the player has ammo if(GetInv(player, 12) > 1.0) { ReturnEx(700.0); } else { ReturnEx(-1.0); } } else { ReturnEx(-1.0); } Return; # ........................................................................................ timer: StopKey(player, holsterTrack, 0.0); Return; pulse: jkSetWaggle(player, '0.0 0.0 0.0', 0); return; end
And this is the weapon COG.
I know you'd like the whole level to check out all phenomenons, but it's a bit of a secret project. And I can't think of anything in the level that would do it, nor did I have anything to do with the weapons in any of my other COGs. I could give you level status: 138 things and 776 sectors.
Oh, I do take powercells but still nothing happens. Oh, and also, this weapons COG was taken from the ST-rifle cog, because I wanted them to do the same thing only with different power sources and bolts. One with energy and one with power. AND, when I switch between ST-rifle, and Crossbow, the pick-out animation (which is the same) goes all hay wire. I pick out ST-rifle, it's normal. I pick out Crossbow straight after, it's down in the corner, hard to see, with the hand looping in its put-away animation.
/Edward
[This message has been edited by Edward (edited February 26, 2004).]