PDA

View Full Version : Need help with a cog..



SDA_Lakuti
09-29-2000, 05:33 PM
I am trying to make a cog that will kill the player, make him invisible, and create templates when he is hit by a specific template... I tried to make a cog for this.. but i have very little cog knowledge. I tried to tag this onto the shot template.. it didn't work.. here's what i had:



#
# ROCKET.COG
#
# Blows character to little bits if hit with rocket.
#

symbols

thing victim local

template carnage=+carnage local
template blood1=+blood local
template blood2=+blood2 local

sound splat=landhard01.wav

message touched


end

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

code

touched:


PlaySoundThing(splat, victim, 1, -1, -1, 0);
if (victim != -1)CreateThing(carnage, victim);
if (victim != -1)CreateThing(blood1, victim);
if (victim != -1)CreateThing(carnage, victim);
if (victim != -1)CreateThing(blood2, victim);

KillPlayer(victim, 0);
SetThingGeoMode(victim, 0);

return;

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

end




If anyone knows how to do this. Please help me. I am in need of it.

------------------
SDÅ_Lªkútí

[This message has been edited by SDA_Lakuti (edited September 29, 2000).]

GuNbOy
09-30-2000, 08:36 AM
put it in the killed message in the kyle.cog

thats all i can think of...since i already did it http://forums.massassi.net/html/smile.gif
but i dont know how to do it for only ONE weapon, i could do it for just one type of damage(explosive)

you have to use a GetParam i think.

Fernando_the_Hunn
09-30-2000, 09:29 AM
to do it in the kyle.cog, use


GetThingWeapon(GetThingParent(GetSourceRef()))


the main problem with your cog is that you never define "victim". use :


victim = GetSourceRef();

or it might be GetSenderRef(), not sure. Also, make sure to reset the Player's Geo Mode when they respawn, otherwise they might still be invisible...


------------------
There are no evil coggers, only evil cogs...

mailto:no_oneatall@hotmail.comno_oneatall@hotmail. com</A>
ICQ 81116825
===========================================
Evil Cog master of the Western TC!

SDA_Lakuti
09-30-2000, 12:45 PM
where do i put that line in? under symbols? or under touched? i'll put it under touched.. try it out... thanx for the help.

------------------
SDÅ_Lªkútí

SDA_Lakuti
10-02-2000, 04:56 PM
ALRIGHT! It Works... exxxxxxxxxccept... the character doesn't die or turn invisible.. BUT it hasn't been tested in multiplayer so i'm not sure if all teh "player" messages will work on AI... hope it works.. if you guys know it won't work oplease reply if you can help me. thank yous

------------------
SDÅ_Lªkútí

Fernando_the_Hunn
10-03-2000, 06:28 PM
to kill the player use "damage=99999" in the template of the victim. and if the SetThingGeoMode doesnt work, try SetThingModel(victim, -1);

thats all I can think of... should work in SP too.

------------------
There are no evil coggers, only evil cogs...

mailto:no_oneatall@hotmail.comno_oneatall@hotmail. com</A>
ICQ 81116825
===========================================
Evil Cog master of the Western TC!

SDA_Lakuti
10-04-2000, 04:49 PM
Thanks for all teh help guys... i'll be testing it sometime.. i'll be back for sure on other subjects ;:D

------------------
SDÅ_Lªkútí