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 → SendTrigger
SendTrigger
2001-12-30, 12:12 PM #1
With send trigger :

SendTrigger(-1, 25, player, 0, 0, 0);

The ^-1 means broadcast to all network computers, right?

Well if I changed it to 0 then what would that mean. Also what would it mean if it was 1?
Team Battle.
2001-12-30, 2:07 PM #2
Making it other than -1 will mean the thing ID itself located in that level executed. If you place 0, it will probably point walkplayer as it is usually thing 0 in a level, but not always.

Specifying it other than -1( <- broadcasting to all players) will usually be done by placing other player variables.

------------------
http://millennium.massassi.net/ - Millennium

[This message has been edited by Hideki (edited December 30, 2001).]
2001-12-30, 2:16 PM #3
hmmm, I lost it on the first line =D

Isnt the id in that trigger is 25?

Or are you saying that pointing it to 0 will mean that its just the local player. Or the server?

In the jk specs it says:
The destination can be either a player (local or remote on the network) reference or -1. If it is -1 the message is broadcast to ALL the connected players.

But I dont understand exactly what its trying to tell me. Is it saying if I set it to 0 or 1 or anything it will only sent locally?
Team Battle.
2001-12-30, 3:32 PM #4
Each thing in a level has a unique ID. For example, the walkplayer usually is Thing 0. So if you put 0, it would send the trigger to Thing 0. If you put 10, and a weapon powerup is thing 10 in the level, the trigger would be sent to that weapon powerup. You can also put in variables that point to other plays.
2001-12-30, 4:11 PM #5
Ok, I think I see.

So if I sent it with an number the same as a bacta tank (num 40 in items.dat) then it would send the trigger there?
Team Battle.
2001-12-30, 4:27 PM #6
no, that is a inventory bin, not a thing id. Every thing thats actually in the game has an id. From the walkplayer, to a weapon powerup, to the blaster bolts that come out of your strifle. Those all have an id.
2001-12-30, 5:06 PM #7
The easy way of knowing what thing ID it has is to open up the level in JED and select the thing, it will easily tell what thing ID it is in the item window.

So if you place some number other than -1, it will send the trigger only to that specific thing's cog even other cog has the trigger with same ID.

Usually you have no way of knowing what the ID of a thing to point exactly. So you usually use "GetSenderRef()" and "GetSourceRef()" or keep player variables and send trigger there.

ex) Sets the newly joined player's skin to default.

Code:
join:


   newlyJoined = GetSenderRef();
   SendTrigger(newlyJoined, 123, 0, 0, 0, 0);


   return;


trigger:


   if(GetSourceRef() == 123) SetThingModel(GetLocalPlayerThing(), defaultKyle);


   return;


------------------
http://millennium.massassi.net/ - Millennium

[This message has been edited by Hideki (edited December 30, 2001).]
2001-12-30, 6:36 PM #8
ah, I see. [http://forums.massassi.net/html/biggrin.gif]

Thankyou all very much.
Team Battle.

↑ Up to the top!