Im making a mod with my friend... and frankly, im pretty new to making a whole cog. I mostly just edit them. The cog below is to throw a colored disk. The cog determines the player's model.. then throw's the proper disk depending on which model the player has... im sure i have A LOT of mistakes... would appreciate any help please.
Code:
symbols int preThrowTrack local int selectTrack local int prePOVThrowTrack local int mode local int cocked=0 local int holsterTrack local int disk local int diskIndex local int diskSideMat=-1 local int selectMode=1 local int tronmodel local thing player local model povModel=trondiskv.3do model weaponMesh=trondisk.3do model tronred=red-tron.3do model tronblue=blue-tron.3do model trongreen=green-tron.3do model tronyellow=yellow-tron.3do keyframe mountAnim=FistVmnt.key local keyframe dismountAnim=FistVdis.key local keyframe povfireAnim1=FistVl.key local keyframe povfireAnim2=FistVr.key local keyframe holsterAnim=kyhlstr.key local keyframe povFireAnim=detvpst1.key local keyframe prePOVThrowAnim=detvpre1.key local #keyframe preThrowAnim=kyrthro0.key local sound diskSound1=diskthrow.wav local sound diskSound2=diskthrow.wav local flex delayTime=1.0 local flex throwWait=0.8 local flex mountWait local flex autoAimFOV=30 local flex autoAimMaxDist=15 local flex holsterWait local template redDisk=+reddisk1 local template redDisk=+reddisk2 local template blueDisk=+bluedisk1 local template blueDisk=+bluedisk2 local template greenDisk=+greendisk1 local template greenDisk=+greendisk2 local template yellowDisk=+yellowdisk1 local template yellowDisk=+yellowdisk2 local material redMat=tronrdisk.mat local material blueMat=tronbdisk.mat local material greenMat=trongdisk.mat local material yellowMat=tronydisk.mat local message startup message activated message deactivated message timer message newplayer message killed message fire message autoselect message selected message deselected message splash end # ======================================================================================== code startup: // Setup delays and variables. mountWait = GetKeyLen(mountAnim); preThrowTrack=-1; selectTrack=-1; prePOVThrowTrack=-1; Return; # ........................................................................................ activated: tronmodel = GetThingModel(player); saberSideMat = jkGetSaberSideMat(player); // disk is not the current weapon if(GetCurWeapon(player) != 1) Return; // the disk is being drawn right now if(SetInv(player, 89) == 1) Return; if(!IsInvActivated(player, 1)) { SetInvActivated(player, 1, 1); SetFireWait(player, -1); SetMountWait(player, 0); SetCurInvWeapon(player, 0); SelectWeapon(player, 1); if(!IsMulti()) SendMessageExRadius(GetThingPos(player), 0x4, splash, 37, 0, 0, 0); if(tronmodel == tronred) { saberSideMat = redMat; } else if(tronmodel == tronblue) { saberSideMat = blueMat; } else if(tronmodel == trongreen) { saberSideMat = greenMat; } else if(tronmodel == tronyellow) { saberSideMat = yellowMat; } else { saberSideMat == bluemat; } # ........................................................................................ if(saberSideMat == redmat) { diskIndex = 1; } else if(saberSideMat == blueMat) { diskIndex = 2; } else if(saberSideMat == greenMat) { diskIndex = 3; } else if(saberSideMat == yellowMat) { diskIndex = 4; } else { diskIndex = 2; } player = GetSourceRef(); mode = GetSenderRef(); if (mode > 1) Return; // Cock arm back for throw. if(preThrowTrack == -1 && prePOVThrowTrack == -1) { prePOVThrowTrack = jkPlayPOVKey(player, prePOVThrowAnim, 1, 0x14); preThrowTrack = PlayMode( player, 38 ); FireProjectile(player, disk[diskIndex], diskSound, 24, '0 0 0', '0 0 0', 1.0, 0, autoAimFOV, autoAimFOV); } } Return; # ........................................................................................ timer: if (GetSenderId() == 0) { jkSetWaggle(player, '10.0 7.0 0.0', 350); } else if (GetSenderId() == 2) { StopKey(player, holsterTrack, 0.0); } Return; end