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 Definition in Symbols, user0, intermessaging...
Cog Definition in Symbols, user0, intermessaging...
2002-07-04, 2:02 AM #1
I am of course aware of the fact that while you can define the cog as an object in symbols, you cannot define the actualy cog per se. My first question is, then, how in the Empire are you supposed to define a cog? (note: I'm not too familiar with triggers, either)

Here's a symbol definition in a cog I 'inherited' from the old RoX TC leadership, but I cannot make any sense of how to implement this, or make one of my own.

Code:
symbols:

cog     example_cog=0     local

end


I a demo testing environ that was also included, this SendMessage();s the user0 command to 'example.cog'. But cone again, this leads to some confusion...

Does example_cog = example.?

Thus, I am in a bit of a quandry, and desire to learn how to send messages properly between cogs.
Cordially,
Lord Tiberius Grismath
1473 for '1337' posts.
2002-07-04, 3:09 AM #2
Don't make it local and add it in JED. I'm not sure, but make
Code:
example_cog=example.cog     local
. For a weapon, you use
Code:
SendMessage(GetInvCog(player, InvInt), user0);
I know all ways work except the middle one. You could use this in a trigger system.

------------------
The Sniper Missions. Current project, The Sniper Missions
Major projects working on:
SATNRT, JK Pistol Mod, Aliens TC, Firearms

Completed
Judgement Day (HLP), My level pack
2002-07-04, 3:25 AM #3
You can only define a cog in the symbols section through a JKL. That example code you have doesn't work.

In the code section, you can assign your cog variable to any verb that returns a cog value. Such as GetThingClassCog(), GetInvCog(), and GetThingCaptureCog().

So to send a message to kyle.cog, you would use: SendMessage(GetThingClassCog(player), user0). Or you can use any cog value for the first parameter.

Triggers don't involve cog variables because the trigger will be received by all cogs with a trigger message.

------------------
Author of the JK DataMaster, Parsec, and the EditPlus Cog Files.
Visit Saber's Domain.
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.
2002-07-04, 6:43 AM #4
Code:
symbols

message activated
thing   switch
thing   prop
cog     bah_cog     local

end

code

activated:
if(GetSenderRef()==switch) {
bah_cog=GetClassCog(prop);
sendmessage(bah_cog,user0);
}
return;

end


(prop being a random template with a cog assigned to it)

Would that work?

Secondly, I have a cog that I just impleneted into my level (without any symbols referencing anything ingame). How would I send a message to that?

And how would I send a message to an inventory item cog in my Resource patch from my level?
Cordially,
Lord Tiberius Grismath
1473 for '1337' posts.
2002-07-05, 12:49 AM #5
...anyone else?
Cordially,
Lord Tiberius Grismath
1473 for '1337' posts.
2002-07-05, 3:30 AM #6
Just add this.
Code:
symbols
cog     cog
#
#
code
SendMessage(cog,user0);
and add a user0 to the target cog. Use JED.

------------------
The Sniper Missions. Current project, The Sniper Missions
Major projects working on:
SATNRT, JK Pistol Mod, Aliens TC, Firearms

Completed
Judgement Day (HLP), My level pack
2002-07-05, 9:41 AM #7
...? huh?
Cordially,
Lord Tiberius Grismath
1473 for '1337' posts.
2002-07-05, 11:21 AM #8
Let's reexplain this. Here's a small cog.
Code:
symbols
cog         targetCog
surface     switch
message     Actvated
end
code
Activated:
SetWallCel(switch, 1);
SendMessage(targetCog, user0);
Sends a message to the target cog when a switch is activated. One time use only. Set the target cog in JED. I don't know how to take screenshots in JED to show you. If you could tell me, I could show you.

------------------
The Sniper Missions. Current project, The Sniper Missions
Major projects working on:
SATNRT, JK Pistol Mod, Aliens TC, Firearms

Completed
Judgement Day (HLP), My level pack
2002-07-06, 10:10 AM #9
Yes, you could define the cog in the level, but that's not the problem.

Change GetClassCog() to GetThingClassCog().

Quote:
<font face="Verdana, Arial" size="2">Secondly, I have a cog that I just impleneted into my level (without any symbols referencing anything ingame). How would I send a message to that?</font>


A trigger would do better there. Use SendTrigger() to send a trigger, and have the trigger message in the target cog receive it.

Quote:
<font face="Verdana, Arial" size="2">And how would I send a message to an inventory item cog in my Resource patch from my level?</font>


Use GetInvCog() to return a reference to the cog. So:

Code:
SendMessage(GetInvCog(player, bin), user0);


------------------
Author of the JK DataMaster, Parsec, and the EditPlus Cog Files.
Visit Saber's Domain.
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.

↑ Up to the top!