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 → need a cog...
need a cog...
2001-10-30, 2:02 PM #1
i want a cog that lets you hit the activate button on a specific thing (like a civillian) and it prints a message on the top of the screen. im not lookin for one that prints a message when you cross an adjoin...

------------------
Everyone dies.
It’s the final and only lasting justice. Evil exists; it is intelligence in the service of entropy. When the side of a mountain slides down to kill a village, this is not evil, for evil requires intent. Should a sentient being cause that landslide, there is evil; and it requires Justice as a consequence, so that the civilization can exist. There is no greater good than Justice; and only if law serves Justice is it a good law. It is said correctly that law exists not for the Just but for the Unjust, for the Just carries the law in their hearts, and do not need to call it from afar.
I bow to no one, and give service only for cause.
2001-10-30, 2:15 PM #2
Mmmmmm. I love easy cogs. Mmmmmm.

 


#10/2001 GBK

Symbols
Message Activated
Thing Switch
Thing Player Local
Int UNI
End
Code
Activated:
Player = Getlocalplayerthing();
If(Getsenderref()==Switch){
JKprintunistring(Player, UNI); }
Return;
End


 

Havent tested it, but it should work...



------------------
Success is the inverse relationship between effort, gain, and loss.
And when the moment is right, I'm gonna fly a kite.
2001-10-30, 2:28 PM #3
Ooops, forgot to say.. The UNI variable is the UNI string number from your strings file.
In your strings window, input a new string: COG_xxxxx, the x's being a number of your choice (Make sure its not already in use...).
Make the UNI variable the same.

Hope that helps...



------------------
Success is the inverse relationship between effort, gain, and loss.
And when the moment is right, I'm gonna fly a kite.
2001-10-30, 3:19 PM #4
except this would be the easiest one, and you can specifiy what you want it to say:

symbols
message activated
thing civilian
end
code
activated:
print("PUT THE STUFF FOR HIM TO SAY IN THESE QUOTES");
return;
end
2001-10-30, 5:35 PM #5
No Strike, for many reasons doing it through a UNI file is much better.
2001-10-30, 5:47 PM #6
Using 'Print("")' might be easier, but not better.
And when the moment is right, I'm gonna fly a kite.
2001-10-30, 6:33 PM #7
Print() was designed to use for debugging... while you can use it, it's best to print from a UNI or using jkStringOutput() [which i prefer myself].
2001-10-31, 12:51 AM #8
A little more fail safe as in LEC cogs.
Code:
symbols


message activated
thing civilian


end


code


activated:


if(GetSourceRef() == civilian)
{
   jkStringClear();
   jkStringConcatAsciiString("PUT THE STUFF FOR HIM TO SAY IN THESE QUOTES");
   jkStringOutput(-1, -3);
}


return;


end 


I'm surprised I can still write cog!

------------------
http://millennium.massassi.net/ - Millennium
2001-10-31, 4:33 AM #9
Ehh, that cog wont work, because 'Getsourceref()' will return the player. It needs to be 'Getsenderref()'.



------------------
Success is the inverse relationship between effort, gain, and loss.
And when the moment is right, I'm gonna fly a kite.
2001-10-31, 5:03 AM #10
Err... Why exactly is it better to print a UNI string rather than use print()?

------------------
Thank you for sending me a copy of your book - I'll waste no time reading it.
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.
2001-10-31, 6:34 AM #11
It is said, although I have never encountered it myself, that using 'Print()' sometimes doesnt work, either for a lack of memory or the processor is busy.

------------------
Success is the inverse relationship between effort, gain, and loss.
And when the moment is right, I'm gonna fly a kite.
2001-10-31, 6:56 AM #12
Quote:
<font face="Verdana, Arial" size="2">I'm surprised I can still write cog!</font>


Apparently not [http://forums.massassi.net/html/tongue.gif]

------------------
http://millennium.massassi.net/ - Millennium
2001-10-31, 8:24 AM #13
Quote:
<font face="Verdana, Arial" size="2">Originally posted by GBK:
Ehh, that cog wont work, because 'GetSourceRef()' will return the player. It needs to be 'GetSenderRef()'.
</font>


Yeah, I noticed that mistake in Hideki's GetSenderRef()/GetSourceRef() page on Millenium last night, when Brian and I were working on the JKA cogs. Might want to fix that under Activated/Deactivated on that page, Hideki. Sender would be what got activated. Source would be who activated it.
2001-10-31, 4:01 PM #14
Thanks a bunch, I fixed it.

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

↑ Up to the top!