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 → Unusual Cog Request
Unusual Cog Request
2001-10-29, 6:55 AM #1
Alright guys. I need a favor.

Can anyone show me or write up a cog in which if a certain object or enemy is killed/destroyed, then the player instantly dies?

Thanks! I appreciate it.

------------------
"If you enjoyed the show, tell your friends. If you didn't, tell your enemies."
"If you enjoyed the show, tell your friends. If you didn't, tell your enemies." - RSC

"Love's a joke. Unfortunately, I'm a comedian." - Me
2001-10-29, 7:32 AM #2
This should do the trick

Code:
symbols

message	        killed
thing		thing_to_be_killed

end

# ========================================================================================

## Code Section
code

# .................................................................................................

killed:
        if (GetSourceRef() != thing_to_be_killed) Return;

	DamageThing(GetLocalPlayerThing(), 1000, 1, -1);
	return;

end
2001-10-29, 9:18 AM #3
No, that won't work.

Quote:
<font face="Verdana, Arial" size="2">GetSenderRef()

Returns what sent a message to the cog. This is the direct originator of the message, for instance a surface that is being activated:, or an actor that is being damaged: The Sender should not be confused with the Source</font>


-JKSpecs

So if you really want to use that safeguard, you should be checking the senderref.

------------------
Thank you for sending me a copy of your book - I'll waste no time reading it.

[This message has been edited by SaberMaster (edited October 29, 2001).]
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.
2001-10-29, 10:11 AM #4
sorry i wrote that when i woke up this morning... i was a little backwards in my thinking... wasn't fully awake lol

↑ Up to the top!