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 → Need help with a cog..
Need help with a cog..
2000-09-29, 2:33 PM #1
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:

Code:
#
# 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).]
SDÅ_Lªkútí
2000-09-30, 5:36 AM #2
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.
I'm just an old man with a skooma problem.
2000-09-30, 6:29 AM #3
to do it in the kyle.cog, use
Code:
GetThingWeapon(GetThingParent(GetSourceRef()))


the main problem with your cog is that you never define "victim". use :
Code:
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...

[url="mailto:no_oneatall@hotmail.com"]mailto:no_oneatall@hotmail.com[/url]no_oneatall@hotmail.com</A>
ICQ 81116825
===========================================
Evil Cog master of the Western TC!
cogs dont kill people. people kill people...

mailto:no_oneatall@hotmail.comno_oneatall@hotmail.com</A>
ICQ 81116825
==============================================
((Evil Cog Master))
2000-09-30, 9:45 AM #4
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í
SDÅ_Lªkútí
2000-10-02, 1:56 PM #5
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í
SDÅ_Lªkútí
2000-10-03, 3:28 PM #6
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...

[url="mailto:no_oneatall@hotmail.com"]mailto:no_oneatall@hotmail.com[/url]no_oneatall@hotmail.com</A>
ICQ 81116825
===========================================
Evil Cog master of the Western TC!
cogs dont kill people. people kill people...

mailto:no_oneatall@hotmail.comno_oneatall@hotmail.com</A>
ICQ 81116825
==============================================
((Evil Cog Master))
2000-10-04, 1:49 PM #7
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í
SDÅ_Lªkútí

↑ Up to the top!