Massassi Forums Logo

This is the static archive of the Massassi Forums. The forums are closed indefinitely. Thanks for all the memories!

You can also download Super Old Archived Message Boards from when Massassi first started.

"View" counts are as of the day the forums were archived, and will no longer increase.

ForumsCog Forum → Cog For Mod... Please help.
Cog For Mod... Please help.
2001-03-02, 5:29 PM #1
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
2001-03-03, 6:04 AM #2
this is a dbz mod isnt?
2001-03-03, 2:00 PM #3
No, Tron Mod... it's gonna include a level where you can turn into the tron cycles... and a game arena... like the movie, ever seen it? BTW... what mistakes are in my code? do i have any Mots Code in there?
2001-03-03, 2:51 PM #4
I'm too tired to look it over very closely, but from a light probing, it looks good. Do you have cogwriter? It is probably the best cogging tool other than the JKSpecs. Check it in there. Exactly what goes wrong? There are some bugs in JK (I think) with model checking.
Capitalization
Commas
Periods
Question Marks
Apostrophes
Confusable Words
Plague Words
2001-03-04, 7:14 AM #5
I have cogwriter, jkspecs, and cogref... I haven't tested the cog yet... it's not even done. I still need to make those templates for the disks.
2001-03-04, 2:56 PM #6
At one point you have saberSideMat == bluemat;
It should be saberSideMat = bluemat;
Only one =

------------------
Together we stand.
Divided we fall.

↑ Up to the top!