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 → can a cog do this?
can a cog do this?
2000-12-02, 10:09 AM #1
Can a cog "Print" on the screen an opponents health and/or shields in a multiplayer. i'm new to Cog so if you reply could you please keep things simple?

Darkening
2000-12-02, 10:19 AM #2
You could do it so that you target an enemy, and their health/shields shows up, I think. I'll look into it.

-Jipe
2000-12-02, 10:26 AM #3
Yes you can. I did it before. I'll see if i can't see how i did it.

------------------
Keith: "Perhaps there was an age in which people had Knowledge of Magic..."
Keith: "Perhaps there was an age in which people had Knowledge of Magic..."
JK cogs
2000-12-02, 2:54 PM #4
yeah but with limits....

jkStringClear();
jkStringConcatPlayerName(victim);
jkStringConcatAsciiString(" has a health of: ");
jkStringConcatInt(GetThingHealth(victim));
jkStringOutput(player, -1);
jkStringClear();
jkStringConcatPlayerName(victim);
jkStringConcatAsciiString(" has shields of: ");
jkStringConcatInt(GetInv(victim, 60));
jkStringOutput(player, -1);


will display the victim's health and shields. (the bin for shields might be 61, i haven't edited a cog in so long i dont remember off the top of my head). keep in mind though that values such as health and shields aren't necessarily synched across the network (dumb JK engine once again). what that means, is the value returned is what your game thinks they are at. JK wasn't coded to care what the clients find the health at. ie, what your game thinks may be different from what they really are. jk usually only deals with health issues on the individual side. that is, when they are killed they would send the message that they died but the game doesn't necessarily send the message that their health is going down. if that makes sense, good, if not, well that code will still work, just with limits. sometiems it is synced i've noticed but others not. if you keep getting values you know aren't true i'll tell you how to sync it for sure. oh well, hope that helps

------------------
I refuse to have a battle of wits with an unarmed person.
2000-12-04, 2:05 AM #5
You could get it synced - SendTrigger the values to the requesting player.
Player1 SendTriggers Player2, Player2's cog retrieves locally the health and shields, and then SendTriggers it back to Player1's cog, which prints the received values on-screen.
Dreams of a dreamer from afar to a fardreamer.
2000-12-04, 6:36 AM #6
thanks everyone

Darkening

↑ Up to the top!