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 → Alright, let's do this the right way...
Alright, let's do this the right way...
2002-10-05, 9:22 PM #1
Yeah, I'm an idiot. I post a cog problem on the anything-but-cog editing forum, and wonder why I don't get a reply...

Anyway, here it is:

Alright, I've got a standard SendTrigger dealy going on, a verb I'm fairly familiar with, but a not-so-slight problem I've never encountered before.
Problem: The SendTrigger isn't working on complex levels, such as Blades of Death and Arena of Light and Dark. Everything else works here, and the SendTrigger works fine in most other levels, but something's screwing it up in at LEAST these two maps.

I've tried chaging the Trigger ID, I did it a couple times actually, but it didn't work, and..well, that's pretty much all I could come up with...

Any ideas?

Thanks,
-TIE

(By the way, I'm using the SendTrigger for a ParseArg command, so that may be the problem...I'm really not sure though.)
2002-10-05, 9:47 PM #2
Make sure you arnt trying to send more than 4 integers after the id. Also make sure your destination num is correct (1st number).
Team Battle.
2002-10-06, 2:49 AM #3
Post code.

------------------
"Häb Pfrässe, süsch chlepfts!" - The coolest language in the world (besides Cherokee)
"Häb Pfrässe, süsch chlepfts!" - The coolest language in the world (besides Cherokee)
2002-10-06, 7:43 AM #4
Make sure you're getting the correct reference to the player you're using ParseArg() with. Often when a cog works in some levels and does not work in others, it's because an undefined player variable is being used.

Since it does work, it can't be a simple syntax error, but we'll still need you to post the code.

------------------
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.
2002-10-06, 9:23 AM #5
Sure, no problem:

(The entire weapon cog I'm using with the SendTrigger in it is pretty big, but here's the SendTrigger part...if you think you need to see the whole thing, just say so, I don't mind.)

Code:
# ........................................................................................
user2:


if(!Staff)
{
	jkSetFlags(player, 0x10);
      jkSetWeaponMesh( player, saberMesh3);
	SendTrigger(-1, 21112, GetPlayerNum(GetLocalPlayerThing()), 0, 0, 0); 
	PlaySoundThing(mountSound, player, 1.0, -1, -1, 0x80);
	SetBinWait(player, 117, GetSoundLen(mountSound));
}
else
{
	jkClearFlags(player, 0x10);
        jkSetWeaponMesh( player, saberMesh2);
	SendTrigger(-1, 12221, GetPlayerNum(GetLocalPlayerThing()), 0, 0, 0); 
	PlaySoundThing(dismountSound, player, 1.0, -1, -1, 0x80);
	SetBinWait(player, 117, GetSoundLen(dismountSound));
}

	Staff = 1 - Staff;

return;


And here's the client code:
Code:
# Jedi Knight Cog Script
#
# 
#
# WEAPON Script - Client Code
#
# [CYW]
#
# This cog is not supported by LucasArts Entertainment Co. 
# ========================================================================================

symbols

thing		player	local

message		trigger

end

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

code

trigger:

	if(GetSourceRef() == 21112)
	{
		//Give the player the double saber .pup
		ParseArg(player, "puppet=kydub.pup");
	}
	else
	if(GetSourceRef() == 12221)
	{
		//Give the player the normal saber .pup
		ParseArg(player, "puppet=ky.pup");
	}
	else
	if(GetSourceRef() == 31113)
	{
		//Give the player the jetpack .pup
		ParseArg(player, "puppet=kyfly.pup");
	}

   Return;


end


Thanks again,
-TIE
2002-10-06, 10:05 AM #6
I think you have no valid player variable in the client cog. I'm not sure about the user0 message, but if "player" is valid there, you can just use it as first parameter in the SendTrigger() verb:
Code:
SendTrigger(-1, 21112, player, 0, 0, 0);

And then in the client cog, you can get the player via GetParam(0):
Code:
if(GetSourceRef() == 21112)
{
 //Give the player the double saber .pup
 ParseArg(GetParam(0), "puppet=kydub.pup");
}


------------------
"Häb Pfrässe, süsch chlepfts!" - The coolest language in the world (besides Cherokee)
"Häb Pfrässe, süsch chlepfts!" - The coolest language in the world (besides Cherokee)
2002-10-06, 10:48 AM #7
Right as rain.

Thanks so much.

-TIE
2002-10-06, 1:13 PM #8
Better than using a parameter would be to use the senderref. The sender of the trigger message is the player whose computer sent the message.

Anyways, good luck with your project. [http://forums.massassi.net/html/wink.gif]

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

[This message has been edited by SaberMaster (edited October 06, 2002).]
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.

↑ Up to the top!