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 → MotS -> JK COG port... fun... =P
MotS -> JK COG port... fun... =P
2003-06-02, 3:53 PM #1
Ok, I'm using SavageX's Jeron Fusion Cutter cogs and etc from his Leeza's Destiny Guns (for MP) mod, and I am trying to convert it to JK. (Notice, I have only taken files from the LHGUNS.GOO, not any default MotS stuff) I have been able to convert the pickup cog and it appears to work. The weapon cog is a different story. No matter how much I comment out, it doesn't do anything! Apparantly there's something in the COG that's keeping JK from parsing it, but I can't find anything:

Code:
# Jedi Knight Cog Script
#
# WEAP_FUSION.COG
#
# This is the 4 barrel cannon from Dark Forces.
#
# [SavageX]
#
# This Cog is Not supported by LucasArts Entertainment Co.

symbols

model        povModel=fusv.3do                  local                         
model        weaponMesh=fusg.3do                local                         

keyframe     mountAnim=fusvmnt.key              local                         
keyframe     dismountAnim=fusvdis.key           local                         
keyframe     povfireAnim=fusvpst1.key           local                         
keyframe     holsterAnim=kyhlstr.key            local                         

sound        mountSound=df_bry_ready.wav        local                         
sound        dismountSound=PutWeaponAway01.wav  local                         
sound        fireSound=fusionfire.wav           local                         
sound        failSound=weapfail.wav             local                         
sound        outSound=fusionout.wav             local                         

material     fusionmat=fusion.mat               local                         

template     projectile=+fusionbolt             local                         
template     projectileB=+swsparks              local                         

thing        player                             local                         

flex         fireWait1=0.25                     local                         
flex         holsterWait                        local                         
flex         powerBoost                         local                         
flex         autoAimFOV=30                      local                         
flex         autoAimMaxDist=5                   local                         

int          trackID=-1                         local                         
int          dummy=0                            local                         
int          mode                               local                         
int          holsterTrack                       local                         
int          nextfire=0                         local                         

message      startup                                                          
message      activated                                                        
message      deactivated                                                      
message      selected                                                         
message      deselected                                                       
message      autoselect                                                       
message      fire                                                             
message      timer                                                            

end                                                                           

# ========================================================================================

code

startup:
//   MaterialAnim(fusionmat, 8, 1);
   return;

# ........................................................................................

fire:
//   player = GetSourceRef();
//
//   // Check that the player is still alive.
//   if(GetThingHealth(player) <= 0) Return;
//
//   // Check Ammo - If we are out, autoselect best weapon.
//   if(GetInv(player, 12) < 1.0)
//   {
//      PlaySoundThing(outSound, player, 1.0, -1.0, -1.0, 0x80);
//      if(GetAutoSwitch() & 1) SelectWeapon(player, AutoSelectWeapon(player, 1));
//      Return;
//   }
//
//   //SendMessageEx(GetThingClassCog(GetLocalPlayerThing()), user1, 3.0, 0, 0, 0);
//
//   if(mode == 0)
//   {
//	SetPOVShake('0.0 -.003 0.0', '1.0 0.0 0.0', .05, 80.0);
//	if(nextfire == 0)
//	{
//		if(GetInv(player, 93) > 0.0) dummy = FireProjectile(player, projectileB, failSound, 8, '-0.0135 0.1 0.0', '0 0 0', 1.0, 0x20, autoAimFOV, autoAimFOV*2);
//		else if(IsMulti())
//		{
//			SendTrigger(-1, GetCurWeapon(player)*100, player, mode, 1, 0);
//			playsoundthing(firesound, player, 1.0, -1, -1, 0x80);
//			playmode(player, 8);
//		}
//		else dummy = FireProjectile(player, projectile, fireSound, 8, '-0.0135 0.1 0.0', '0 0 0', 1.0, 0x20, autoAimFOV, autoAimFOV*2);
//		nextfire = 1;
//	}
//	else
//	if(nextfire == 1)
//	{
//		if(GetInv(player, 93) > 0.0) dummy = FireProjectile(player, projectileB, failSound, 8, '-0.0035 0.1 -0.005', '0 0 0', 1.0, 0x20, autoAimFOV, autoAimFOV*2);
//		else if(IsMulti())
//		{
//			SendTrigger(-1, GetCurWeapon(player)*100, player, mode, 2, 0);
//			playsoundthing(firesound, player, 1.0, -1, -1, 0x80);
//			playmode(player, 8);
//		}
//		else dummy = FireProjectile(player, projectile, fireSound, 8, '-0.0035 0.1 -0.005', '0 0 0', 1.0, 0x20, autoAimFOV, autoAimFOV*2);
//		nextfire = 2;
//	}
//	else
//	if(nextfire == 2)
//	{
//		if(GetInv(player, 93) > 0.0) dummy = FireProjectile(player, projectileB, failSound, 8, '0.0135 0.1 -0.01', '0 0 0', 1.0, 0x20, autoAimFOV, autoAimFOV*2);
//		else if(IsMulti())
//		{
//			SendTrigger(-1, GetCurWeapon(player)*100, player, mode, 3, 0);
//			playsoundthing(firesound, player, 1.0, -1, -1, 0x80);
//			playmode(player, 8);
//		}
//		else dummy = FireProjectile(player, projectile, fireSound, 8, '0.0135 0.1 -0.01', '0 0 0', 1.0, 0x20, autoAimFOV, autoAimFOV*2);
//		nextfire = 3;
//	}
//	else
//	if(nextfire == 3)
//	{
//		if(GetInv(player, 93) > 0.0) dummy = FireProjectile(player, projectileB, failSound, 8, '0.0235 0.1 -0.015', '0 0 0', 1.0, 0x20, autoAimFOV, autoAimFOV*2);
//		else if(IsMulti())
//		{
//			SendTrigger(-1, GetCurWeapon(player)*100, player, mode, 0, 0);
//			playsoundthing(firesound, player, 1.0, -1, -1, 0x80);
//			playmode(player, 8);
//		}
//		else dummy = FireProjectile(player, projectile, fireSound, 8, '0.0235 0.1 -0.015', '0 0 0', 1.0, 0x20, autoAimFOV, autoAimFOV*2);
//		nextfire = 0;
//	}
//	jkPlayPOVKey(player, povfireAnim, 1, 0x38);
//       ChangeInv(player, 12, -1.0);
//   }
//   else
//   if(mode == 1)
//   {
//	if(GetInv(player, 12) < 4) PlaySoundThing(outSound, player, 1.0, -1.0, -1.0, 0x80);
//	else
//	{
//		SetPOVShake('0.0 -.003 0.0', '1.0 0.0 0.0', .05, 80.0);
//		if(GetInv(player, 93) > 0.0)
//		{
//			dummy = FireProjectile(player, projectileB, failSound, 8, '-0.0135 0.1 0.0', '0 5 0', 1.0, 0x20, -1, -1);
//			dummy = FireProjectile(player, projectileB, -1, -1, '-0.0035 0.1 -0.005', '0 2.5 0', 1.0, 0x20, -1, -1);
//			dummy = FireProjectile(player, projectileB, -1, -1, '0.0135 0.1 -0.01', '0 -2.5 0', 1.0, 0x20, -1, -1);
//			dummy = FireProjectile(player, projectileB, -1, -1, '0.0235 0.1 -0.015', '0 -5 0', 1.0, 0x20, -1, -1);
//		}
//		else
//		if(IsMulti())
//		{
//			SendTrigger(-1, GetCurWeapon(player)*100, player, mode, 0, 0);
//			playsoundthing(firesound, player, 1.0, -1, -1, 0x80);
//			playmode(player, 8);
//		}
//		else
//		{
//			dummy = FireProjectile(player, projectile, fireSound, 8, '-0.0135 0.1 0.0', '0 5 0', 1.0, 0x20, -1, -1);
//			dummy = FireProjectile(player, projectile, -1, -1, '-0.0035 0.1 -0.005', '0 2.5 0', 1.0, 0x20, -1, -1);
//			dummy = FireProjectile(player, projectile, -1, -1, '0.0135 0.1 -0.01', '0 -2.5 0', 1.0, 0x20, -1, -1);
//			dummy = FireProjectile(player, projectile, -1, -1, '0.0235 0.1 -0.015', '0 -5 0', 1.0, 0x20, -1, -1);
//		}
//		jkPlayPOVKey(player, povfireAnim, 1, 0x38);
//	       ChangeInv(player, 12, -4.0);
//	}
//   }
//   powerBoost = GetInv(player, 63);
//   ChangeFireRate(player, fireWait1*(mode+1)/powerBoost);
   Return;

# ........................................................................................

activated:
jkStringClear();
jkStringConcatAsciiString("Activated");
jkStringOutput(player, -1);
//   player = GetSourceRef();
//   mode = GetSenderRef();
//   jkSetWaggle(player, '0.0 0.0 0.0', 0);
//   //if (GetInv(player, 93) > 0.0) SendMessageEx(GetThingClassCog(player), skill, 1100, 0, 0, 0);
//   powerBoost = GetInv(player, 63);
//   ActivateWeapon( player, fireWait1*(mode+1)/powerBoost, mode );
   Return;

# ........................................................................................

deactivated:
jkStringClear();
jkStringConcatAsciiString("Deactivated");
jkStringOutput(player, -1);
//   player = GetSourceRef();
//   mode = GetSenderRef();
//   jkSetWaggle(player, '10.0 7.0 0.0', 350);
//   DeactivateWeapon( player, mode );
   Return;

# ........................................................................................

selected:
jkStringClear();
jkStringConcatAsciiString("Selected");
jkStringOutput(player, -1);
//   player = GetSourceRef();
//
//   // Setup the meshes and models.
//   jkSetPOVModel(player, povModel);
//   jkSetWeaponMesh(player, weaponMesh);
//   SetArmedMode(player, 1);
//
//   // Play mounting sound.
//   //PlayMode(player, 41);
//   PlaySoundThing(mountSound, player, 1.0, -1.0, -1.0, 0x80);
//
//   // Play the animation (NOLOOP + UNIQUE + ENDPAUSE).
//   // The animation is held at the last frame after it is played.
//   trackID = jkPlayPOVKey(player, mountAnim, 0, 0x14);
//   jkSetWaggle(player, '10.0 7.0 0.0', 350);
//
//   // Clear saber flags, and allow activation of the weapon
//   jkClearFlags(player, 0x5);
//   SetCurWeapon(player, bin);
//   SetMountWait(player, GetKeyLen(mountAnim));
//
//   if(GetInv(player, ammobin) < 1.0)
//   {
//      PlaySoundThing(outSound, player, 1.0, -1, -1, 0x80);
//      if(GetAutoSwitch() & 1)
//         SelectWeapon(player, AutoSelectWeapon(player, 1));
//   }

   Return;

# ........................................................................................

deselected:
jkStringClear();
jkStringConcatAsciiString("Deselected");
jkStringOutput(player, -1);
//   player = GetSourceRef();
//   
//   PlaySoundThing(dismountSound, player, 1.0, -1, -1, 0x80);
//   jkPlayPOVKey(player, dismountAnim, 0, 0x18);
//   
//   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;

# ........................................................................................

autoselect:
//   player = GetSourceRef();
//
//   // If the player has the weapon
//   if(GetInv(player, bin) > 0.0)
//   {
//      // If the player has ammo
//      if(GetInv(player, ammobin) > 0.0)
//      {
//         ReturnEx(700.0);
//      }
//      else
//      {
//         ReturnEx(-1.0);
//      }
//   }
//   else
//   {
//      ReturnEx(-1.0);
//   }

   Return;

# ........................................................................................

timer:
//   StopKey(player, holsterTrack, 0.0);
   Return;

end


I commented all the stuff out to try to make it work... no luck. Also, I see some stuff I'm gonna have to change in the end (ie the stuff that would make the gun not fire if it got "wet" like in the last two MotS levels), but all I want to do right now is get it to print the debug messages.

NOTE: I used the jkString stuff because Print didn't work... and when jkString didn't work I wss too lazy to change it back! [http://forums.massassi.net/html/biggrin.gif]

Again: No debug text is printed at all in-game. Cogwriter reports no errors, and when I press the 5 key, nothing happens at all... it doesn't even switch away from the current weapon, a sign that the cog isn't parsing correctly.

I'm sure I HAVE the weapon, because I am using the red5 cheat to ensure I have it.

So, any help for me?

------------------
The Mega-ZZTer's Gaming Haven!
I finally got around to updating my sig... *grumble*...

[This message has been edited by The_Mega_ZZTer (edited June 02, 2003).]

[This message has been edited by The_Mega_ZZTer (edited June 02, 2003).]

2003-06-03, 10:48 AM #2
You got problems, boy, you got problems. You have to leave the cog as is, the problem is in your templates. You don't have them correctly inputed. Plus, you can't use this because you most likely didn't ask SavageX for use of this, and you also have to remove MotS verbs. You aren't allowed to do both, you can use it for inpiration, but not the origanal for changes into something for you.

------------------
The Sniper Missions. Current project, The Sniper Missions

The Magician Saber System.
Major projects working on:
SATNRT, JK Pistol Mod, Aliens TC, Firearms

Completed
Judgement Day (HLP), My level pack
2003-06-05, 2:32 AM #3
I did in fact ask SavageX, but he hasn't replied yet. And if he says no, I won't release this. I'd just find someone else who made something like this. (Although I admit I have NEVER seen another Jeron Fusion Cannon, I could make the code and templates by myself if needed, and I could get someone to make me a model, but I'd much rather use the work of an established master. [http://forums.massassi.net/html/wink.gif] [http://forums.massassi.net/html/biggrin.gif])

And I DID copy the appropriate templates, but that isn't the case. I'm trying to get this cog to actually parse first. Once it parses, I think I can fix any remaining problems fine.

I see the MotS verbs... what I did with the pickup cog is I held it side by side with a JK pickup cog. When I saw a MotS verb, I replaced it with the appropriate JK code.

All I'm saying is I want this thing to parse first. Don't look at the commented out code... just at the uncommented code, and what may be causing it to not parse.

It suddenly dawned on me to check the debug.log...

Code:
sithCogYACC.c(406): PARSER syntax error: line 7.


I don't notice anything wrong in the symbols section though...

I'll try commenting out some symbols and see what happens. -_-

[Edit: Still no luck. Maybe I'm doing something wrong.]

[Edit: !!! I think I found it! See how the Output string outputs to player? player is undefined!!!]

['Nother Edit: *sigh* still doesn't work...]

------------------
The Mega-ZZTer's Gaming Haven!
I finally got around to updating my sig... *grumble*...

[This message has been edited by The_Mega_ZZTer (edited June 05, 2003).]

2003-06-05, 11:54 AM #4
Go find on of SaberMaster's posts, get Parsec. Boy, you also need to try it out all at once. Templates and all. Plus, is this for a mod or a level? You need some help, you have to try cogs ingame to see if they work or not, its not just correct or not.

------------------
The Sniper Missions. Current project, The Sniper Missions

The Magician Saber System.
Major projects working on:
SATNRT, JK Pistol Mod, Aliens TC, Firearms

Completed
Judgement Day (HLP), My level pack
2003-06-05, 2:33 PM #5
Ir's for a mod, which is why it's a weapon cog. [http://forums.massassi.net/html/tongue.gif]

I will seek out this Parsec you speak about... [Edit: Found it, v1.7.0... but DOS? Hehe I love DOS [http://forums.massassi.net/html/biggrin.gif]]

BTW, I'm just trying to get it to parse first. I do intend to "try it out all at once".. when I get it to parse, I will fix the rest and try it all out... I don't quite get what you're saying...

Also, I HAVE been trying the cog ingame, that's why I know the cog isn't parsing in JK, and why I know the text messages aren't showing. [http://forums.massassi.net/html/rolleyes.gif]

Well, two replies is better than nothing... thanks for your help, Mr. Pilot [http://forums.massassi.net/html/biggrin.gif]

[Edit: Bah... Parsec didn't find anything... I'm gonna rip this cog apart now... the gloves are off! ^_^]

------------------
The Mega-ZZTer's Gaming Haven!
I finally got around to updating my sig... *grumble*...

[This message has been edited by The_Mega_ZZTer (edited June 05, 2003).]

[This message has been edited by The_Mega_ZZTer (edited June 05, 2003).]

2003-06-05, 2:51 PM #6
Ok... I stripped the code down to it's bare minimum... I removed all the comments (and commented out code) but it STILL doesn't display ANY text when I select it! What am I doing wrong?

Code:
# Jedi Knight Cog Script
#
# WEAP_FUSION.COG
#
# This is the 4 barrel cannon from Dark Forces.
#
# [SavageX]
#
# This Cog is Not supported by LucasArts Entertainment Co.

symbols

message      activated                                                        
message      deactivated                                                      
message      selected                                                         
message      deselected                                                       

end                                                                           

# ========================================================================================

code

activated:
   Print("Activated");
   Return;

# ........................................................................................

deactivated:
   Print("Deactivated");
   Return;

# ........................................................................................

selected:
   Print("Selected");
   Return;

# ........................................................................................

deselected:
   Print("Deselected");
   Return;

end


------------------
The Mega-ZZTer's Gaming Haven!
I finally got around to updating my sig... *grumble*...

2003-06-06, 2:38 PM #7
Dude, thats just Fling your self over man. Take the origanal code, and edit out what parsec says that shouldn't be there.

------------------
The Sniper Missions. Current project, The Sniper Missions

The Magician Saber System.
Major projects working on:
SATNRT, JK Pistol Mod, Aliens TC, Firearms

Completed
Judgement Day (HLP), My level pack
2003-06-07, 3:37 AM #8
Parsec didn't FIND anything!!!

Oh well.. I'm gonna e-mail the full cog to Savage... he said he'll fix it up for me, yay. [http://forums.massassi.net/html/smile.gif]

------------------
The Mega-ZZTer's Gaming Haven!
I finally got around to updating my sig... *grumble*...

2003-06-07, 5:05 AM #9
Parsec's giving you nothing? [http://forums.massassi.net/html/rolleyes.gif] I read through the code very carefully, and noticed 2 things I didn't before. bin is undefined in th top code, you uncomment everything, and add to the symbols 'int bin=(weaponnumber) local' plus 'int ammobin=12 local' and it should work.

------------------
The Sniper Missions. Current project, The Sniper Missions

The Magician Saber System.

[This message has been edited by Descent_pilot (edited June 07, 2003).]
Major projects working on:
SATNRT, JK Pistol Mod, Aliens TC, Firearms

Completed
Judgement Day (HLP), My level pack
2003-06-07, 9:12 AM #10
Actually, I had noticed it too, and I put it into the code shortly after I made this thread... no difference. [http://forums.massassi.net/html/frown.gif]

After all, any code that uses the bin or ammobin vars is commented out anyways...

Thanks anyway. [http://forums.massassi.net/html/smile.gif] Much appreiciated.

[Edit: Whoops! I just realized what you meant three posts back... you wanted me to take the original MotS code and run it through Parsec, fixing stuff when it finds it? I don't think it'll work,since Parsec seems to miss whatever is causing it not to work in the first place, but I'll try it if SavageX can't fix it...]

------------------
The Mega-ZZTer's Gaming Haven!
I finally got around to updating my sig... *grumble*...

[This message has been edited by The_Mega_ZZTer (edited June 07, 2003).]

2003-06-09, 6:37 AM #11
Parsec can only catch syntax errors and some logical errors, it cannot find errors outside of the cog or errors that appear when the script is interpreted by JK and run.

Make sure that your bin is defined correctly, none of the messages in your stripped-down cog will be called without certain bin flags. So post your bin if it's still not working.

------------------
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.
2003-06-10, 3:30 AM #12
Yey, SavageX got the cog to work ^_^.

SaberMaster, I suppose you mean that without the bin and ammobin vars, the cog may not parse? I'll have to remember that in the future, thanks. (That could've been why it wasn't parsing.)

Thanks for the replys, guys.

------------------
The Mega-ZZTer's Gaming Haven!
I finally got around to updating my sig... *grumble*...

2003-06-10, 9:39 AM #13
No, I meant the inventory bins defined in the items.dat. JK doesn't care if there's a bin variable in the cog.

But I'm curious, what did Savage do to fix it?

------------------
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.

↑ Up to the top!