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 → MP Fan Damage
MP Fan Damage
2001-10-07, 7:11 AM #1
Hi!

Here's what I have. The problem is that it only hurts the host in MP (no matter who touches the fans)
Code:
# Jedi Knight Cog Script
#
# FANDAMAGE.COG
#
# Damage player when he touches one of the fans. Somehow. No idea how it really works. So sue me.
#
# [Goofz, help from Zecks & Hideki - Thanks!]
#
# This COG script is not supported by LEC. Jodeldiplom.
#
# (C) 1997 LucasArts Entertainment Co. All Rights Reserved


symbols

thing		fan1	linkid=1
thing		fan2	linkid=2	
thing		fan3	linkid=3	
flex	damage_amount
	
int dummy	local

message     touched


end

code

touched:
   if ((GetSenderId()==1) || (GetSenderId()==2) || (GetSenderId()==3))
	{
	player = GetLocalPlayerThing();
	dummy = DamageThing(player, damage_amount, 0x01, player);
	#DamageThing(player, damage_amount, 0x01, player);
	}
Return;	

end


Any help from you cog-gods out there? [http://forums.massassi.net/html/smile.gif]

Cheers,
Goofz
2001-10-07, 7:58 AM #2
Maybe you should try flagging it...

------------------
Guns don't kill people. Kids who play computer games do.
[edit: Visit Cave_Demon's site: http://cave2.2ya.com ! -stat]
[This message has been hacked by StaticX (edited September 11, 2001).]
WHAT?
2001-10-08, 1:23 PM #3
I'm not sure but I think you missed something out in the symbols section.
Try adding this:
int player local

[This message has been edited by Berlick (edited October 08, 2001).]
2001-10-08, 4:41 PM #4
Make it local, with flags=0x240 as the first line, or change player=GetLocalPlayerThing(); to player=GetSourceRef();

I'd say make it local, it'll save on net traffic.
Bassoon, n. A brazen instrument into which a fool blows out his brains.
2001-10-09, 4:38 AM #5
Code:
# Fandamage.cog
#
# Damage the thing that touches this fan.
#
# This cog is not supported by LEC.
#==================================#
symbols
   message touched
end
#==================================#
code
touched:
   DamageThing(GetSourceRef(), 20, 0x1, GetSenderRef());
Return;
#==================================#
end


Put "cog=fandamage.cog" in the template of your fan for this to work. GetSourceRef() will be the thing that touched the fan and GetSenderRef() will be the fan.

I think this will work in MP without flags, because LEC's fandamage cog didn't have them.

------------------
Fiction must be more realistic than truth or no one will believe it.
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.
2001-10-10, 3:27 AM #6
Hi.

Thanks a lot guys. I'll try all that and post what worked [http://forums.massassi.net/html/wink.gif]

Cheers,
Goofz

↑ Up to the top!