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 → GetSourceRef
GetSourceRef
2002-02-15, 11:20 PM #1
Under my bullet templete I have a cog assigned to my bullet. And in this cog I have a touched message and under it I have:

victim = GetSourceRef;

PrintInt(victim);

When I shoot another person jk prints some weird number like 6667553 or something similar to that... and its really disturbing me. What am I doing wrong?
Team Battle.
2002-02-15, 11:59 PM #2
I don't know, but couldn't this be the unique thing identifier number?
"Häb Pfrässe, süsch chlepfts!" - The coolest language in the world (besides Cherokee)
2002-02-16, 1:45 AM #3
what are the results you expect from PrintInt(victim);? because ints are only numbers *not 100% sure so dont pounce on me if im wrong*
2002-02-16, 2:20 AM #4
if you have declared your victim as a thing, you could also use GetThingPos(victim) to get the victim's coordinates (a vector where x, y, z are distances from the origin). I don't know what you want to do exactly, so please tell us...

[This message has been edited by zagibu (edited February 16, 2002).]
"Häb Pfrässe, süsch chlepfts!" - The coolest language in the world (besides Cherokee)
2002-02-16, 5:11 AM #5
Erm, it's GetSourceRef() and not GetSourceRef. The perens indicate that it's a function. The way you wrote it, the engine thinks it's a variable, and is probably printing garbage.

BUT if you actually did include the perens in the cog and this is just a typo, then I believe touched: message is only called when one of the colliding things is the player.
Dreams of a dreamer from afar to a fardreamer.
2002-02-16, 5:17 AM #6
And Bath Wader: there are only three numerical variable types in CogScript: int, flex and vector. Thing, sector and surface are all aliases for ints - they were included just to make cogs more legible.
Dreams of a dreamer from afar to a fardreamer.
2002-02-16, 10:49 AM #7
FarDreamer... you legend. Thankyou very much!

(I missed the brackets)

Whoops!
Team Battle.
2002-02-16, 7:07 PM #8
You're welcome [http://forums.massassi.net/html/smile.gif]

But I'm curious: does it work now?
Dreams of a dreamer from afar to a fardreamer.
2002-02-17, 9:56 AM #9
Yup, works now.
Team Battle.
2002-02-17, 1:09 PM #10
Quote:
<font face="Verdana, Arial" size="2">then I believe touched: message is only called when one of the colliding things is the player.</font>


I think that if mask flags are not used, only actors and players can trigger the touched message. But if mask flags are used, the masked things - and not just actors and players - will trigger the touched message.

------------------
Each cog better than the next
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.

↑ Up to the top!