PDA

View Full Version : touched: damage? What's wrong?



Goofz
10-19-2000, 11:37 AM
Hi.

This cog works only once (i.e. it damages the player when he touches one of the 3 fans) but after he's been killed once, it doesn't do anything any longer. What's more. JK starts to behave rather strange (e.g. ForceJump-dots appearing around the player all the time, player not taking damage from explosions)
It's MP, btw.:


symbols

thing fan1
thing fan2
thing fan3
flex damage_amount

int dummy local

message touched


end

code

touched:
if ((GetSenderId=fan1) | | (GetSenderId=fan2) | | (GetSenderId=fan3))
{
player = GetLocalPlayerThing();
dummy = DamageThing(player, damage_amount, 0x01, player);
}
Return;

end


Any idea? Sorry, I know nearly nothing about cogging.

Cheers,
Goofz

Zecks
10-19-2000, 01:12 PM
# Jedi Knight COG
#
# Made by Zecks
#
# Not made by LucasArts.

symbols
thing fan1 linkid=1
thing fan2 linkid=1
thing fan3 linkid=1
flex damage_amount
int dummy
local
message touched

end

# ---------

code

touched:

player = GetLocalPlayerThing();

DamageThing(player, damage_amount, 0x01, 1);
Return;

# -------

end


I believe that is the right DamageThing(); that you used. Let me know if that doesn't work.


------------------
Mmm.... have a donut.

Hideki
10-20-2000, 01:04 PM
To see if equalized in "if" statement, use 2 "=" signs.

if(this == that) doThis;

And you don't do GetSenderID() by name like that, rather use "GetSenderID()" (with brackets) and put

thing this linkid=0
thing that linkid=1

And check if the sender ID is equal to 0 or 1 etc.

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

[This message has been edited by Hideki (edited October 20, 2000).]

Goofz
10-20-2000, 02:56 PM
Hi.

Great! Thanks you two! That worked. Stupid me with the =='s (I really shoud have known... http://forums.massassi.net/html/smile.gif )

thanks again!

Cheers,
Goofz