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 → X-Boarder main cog probs.
X-Boarder main cog probs.
2001-12-19, 9:02 AM #1
OK, I'm using this cog to replace weap_fists.cog and it controls player moves. Only problem is, I can't get any print messages to show up under 'activated' or 'fire'. Any ideas?

Code:
# Jedi Knight Cog Script
#
# XB_TRICKS.COG - (was WEAP_SABER.COG)
#
# [YB & CYW] - Heavily modified for X-Boarder MOD by Tazz
#
# (C) 1997 LucasArts Entertainment Co. All Rights Reserved
# (C) 2001 Tazz
#
# NOTES:
#
# *still need to add the HUD support and test what I have
# *need to fix sounds
#

symbols

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

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

sound	    tail_grab_snd=tailgrab.wav		local
sound	    nose_grab_snd=nosegrab.wav		local
sound	    back_flip_snd=backflip.wav		local
sound	    front_flip=frontflip.wav		local
sound	    biff_snd=biff.wav			local
sound	    mount_snd=mount.wav			local


model       povModel=fistv.3do             	local
model       externalMesh=fistg.3do            	local
thing       player                              local
vector      thrust                              local
int         mode                                local

end

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

code

startup:

	// Go to external (ALWAYS)
	if ((GetCurrentCamera() == 0) && (GetPrimaryFocus(0) == player))
		CycleCamera();
Print("Start External");
	return;

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

selected:

	jkSetPOVModel(player, povModel);
	SetArmedMode(player, 0);

	jkSetWeaponMesh(player, externalMesh);
	jkSetWaggle(player, '0 0 0', 0);
	
	//Play board mounting animation??
	//PlayMode(player, 42);

	SetMountWait(player, 0);
	SetCurWeapon(player, 1);
	// Go to external (ALWAYS)
	if ((GetCurrentCamera() == 0) && (GetPrimaryFocus(0) == player))
		CycleCamera();
Print("Selected");
	return;

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

deselected:
   	SetMountWait(player, 0);
  	jkSetWaggle(player, '0.0 0.0 0.0', 0);
  	return;

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

activated:
Print("Activated");
   	mode = GetSenderRef();
   	jkSetWaggle(player, '0.0 0.0 0.0', 0);
  	if (mode > 1)
   	   return;
Print("MODE OK");
 	ActivateWeapon(player, 0.1, mode);
Print("ActivateWeapon[player, 0.1, mode]");
  	return;

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

deactivated:
   	mode = GetSenderRef();
   	jkSetWaggle(player, '10.0 7.0 0.0', 350);
   	DeactivateWeapon(player, mode);
	return;

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

fire:
Print("Fire");
	mode = GetSenderRef();
	if (mode == 0)
	{
		thrust = GetThingThrust(player);

	// MELANCHOLY	
		if (VectorX(thrust) > 0)
		{
		PlayMode(player, 15);
		//PlaySoundThing(tail_grab_snd, player, 1.0, -1.0, -1.0, 0x80); //Tail Grab sound		
Print("MELANCHOLY");
		}
		else
	// STALEFISH
		if (VectorX(thrust) < 0)
		{
		PlayMode(player, 38);
		//PlaySoundThing(tail_grab_snd, player, 1.0, -1.0, -1.0, 0x80); //Tail Grab sound
Print("STALEFISH");
		}
		else
	// INDY
		if (IsThingCrouching(player) > 0)
		{
		PlayMode(player, 17);
		//PlaySoundThing(tail_grab_snd, player, 1.0, -1.0, -1.0, 0x80); //Tail Grab sound
Print("INDY");
		}
		else
	// SUPERMAN
		{
		PlayMode(player, 8);
		//PlaySoundThing(tail_grab_snd, player, 1.0, -1.0, -1.0, 0x80); //Tail Grab sound
Print("SUPERMAN");
		}

	}
	// mode == 1
	else
	{
		thrust = GetThingThrust(player);

	// MELANCHOLY 360	
		if (VectorX(thrust) > 0)
		{
		PlayMode(player, 16);
		//PlaySoundThing(tail_grab_snd, player, 1.0, -1.0, -1.0, 0x80); //Tail Grab sound
		}
		else
	// STALEFISH 360
		if (VectorX(thrust) < 0)
		{
		PlayMode(player, 19);
		//PlaySoundThing(tail_grab_snd, player, 1.0, -1.0, -1.0, 0x80); //Tail Grab sound
		}
		else
	// INDY 360
		if (IsThingCrouching(player) > 0)
		{
		PlayMode(player, 35);
		//PlaySoundThing(tail_grab_snd, player, 1.0, -1.0, -1.0, 0x80); //Tail Grab sound
		}
		else
	// TAILGRAB
		{
		PlayMode(player, 18);
		//PlaySoundThing(tail_grab_snd, player, 1.0, -1.0, -1.0, 0x80); //Tail Grab sound
		}

	}
  return;

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

newplayer:
	// Go to external (ALWAYS)
	if ((GetCurrentCamera() == 0) && (GetPrimaryFocus(0) == player))
		CycleCamera();  
Print("Newplayer"); 
	return;

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

autoselect:
   // Return the saber when out of everthing except the fists

   // If the player has the weapon
   if(GetInv(player, 10) != 0.0)
   {
      ReturnEx(1100.0);
Print("autoselected");
   }
   else
   {
      ReturnEx(-1.0);
   }

   Return;
	


end


------------------
-There are easier things in life than finding a good woman, like nailing Jello to a tree, for instance

-Tazz
-There are easier things in life than finding a good woman, like nailing Jello to a tree, for instance

Tazz
2001-12-19, 3:32 PM #2
*bump*

------------------
-There are easier things in life than finding a good woman, like nailing Jello to a tree, for instance

-Tazz
-There are easier things in life than finding a good woman, like nailing Jello to a tree, for instance

Tazz
2001-12-19, 4:48 PM #3
I haven't tested it so its just a guess but I think you problem is here in activated:

Code:
Print("ActivateWeapon[player, 0.1, mode]");


I know including certain ASCII characters in Print and Output statements can actaully make JK crash during loading. I'm betting cog doesnt like the [ ] inside the quotation marks.
- Wisdom is 99% experience, 1% knowledge. -
2001-12-19, 4:51 PM #4
Nah, thanks though.

*Resolves problem*

------------------
-There are easier things in life than finding a good woman, like nailing Jello to a tree, for instance

-Tazz
-There are easier things in life than finding a good woman, like nailing Jello to a tree, for instance

Tazz
2001-12-19, 5:00 PM #5
Darn I did find it too.

SetCurWeapon(player, 1); -> SetCurWeapon(player, 10);

[http://forums.massassi.net/html/wink.gif]
- Wisdom is 99% experience, 1% knowledge. -

↑ Up to the top!