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 → Functions...
Functions...
2001-06-19, 9:30 AM #1
Is there a way to do functions in cogs like in c++?
Private Yodason
Imperial Ground Forces
2001-06-19, 9:39 AM #2
Yes, you can create and call your own messages.
2001-06-19, 3:29 PM #3
how? and thanks
Private Yodason
Imperial Ground Forces
2001-06-19, 3:50 PM #4
in the symbols, add this:

message boogie

then in the code, say in startup, add this:

call boogie;

then, define it in the code like any other message:

boogie:
DoStuff();
return;
2001-06-19, 7:20 PM #5
thanks =)
Private Yodason
Imperial Ground Forces
2001-06-19, 8:42 PM #6
Forget putting the message boogie in ...
2001-06-20, 1:09 AM #7
There are a lot of things you can "forget" doing, but everything is much cleaner if you "remember" them.
2001-06-20, 5:06 AM #8
yes, I know you don't need to put user-defined messages in the symbols, but good habits make for efficient, understandable code.
2001-06-20, 5:12 AM #9
SendMessage and SendTrigger both work if you're trying to call something from another cog, but SendMessage tends to lag alot more than SendTrigger.
Tripping over land mines at the ArmyTC and getting lanced by the knights of the RoXTC
2001-06-20, 4:09 PM #10
yeah if u look at some of the door cogs u can see that they have there own message call_doors i think
roses are red, violets are blue, I am schizophrenic, and I am too!
2001-06-21, 1:03 AM #11
Haven't posted for a while...

But, you can't have messages sent to custom messages using SendMessage and SendMessageEx, so using "user0" to "user7" can avoid them, and they need to be declared in the symbols section as they are hard-coded messages.

>but SendMessage tends to lag alot more than SendTrigger.

Can you see THAT much of a difference?
I can never FEEL the lag of milliseconds.

But to think logically, both sends 4 parameters to the designated message... SendTrigger enabling to send to multiple clients. Not sure if that makes lag differences.

And if SendMessageEx lags more than SendTrigger, LEC coggers never should've wanted to use SendMessageEx in their cogs, they could've replaced with SendTrigger.

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

[This message has been edited by Hideki (edited June 21, 2001).]

↑ Up to the top!