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 a nice cog....
Need a nice cog....
2001-05-29, 12:42 PM #1
Ok, i want it to make it so when i kill one of 6 "people" (enemies) i text line will appear at the top of the screen, with a sound playing. i want it to only play once i kill one of these, and when i kill the others, it wont say it again.

Thanx!

------------------
Visit my site!
www.snerdcomic.homestead.com
-If women don't find ya handsome, they'll at least find ya handy!-
The Situation:
The Sv_SetBrushModel: Null error has occurred in my map. This means that somewhere in my level, there is a paper-thin prush that needs to be deleted. There are 2888 brushes in my level. That's chances of 1/2888 of finding the correct brush. The statistics say I have a .035% chance of finding it.
Did I find it?
You bet I did.
2001-05-29, 2:08 PM #2
This should work,


Code:
# Jedi Knight Cog Script
#
# Killsomething.COG
#
# Description
#  Plays a sound and prints text when 1 of 6 enemies is killed.
#
#   Rhett Peterson
#
# This Cog is Not supported by LucasArts Entertainment Co

symbols

message      killed                             local                         
message      bleah                              local                         
thing        player                             local                         
thing        victim1                                                          
thing        vistim2                                                          
thing        victim3                                                          
thing        victim4                                                          
thing        vistim5                                                          
thing        victim6                                                          
int          Volume                                                           
int          timeskilled=0                      local                         
sound        Sound=ForceGrip01.WAV                 
                   

end                                                                           

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

code

Killed:

 who = GetSenderRef();

 If(who == victim1 | who == victim2 | who == victim3 | who == victim4 | who == victim5 | who == victim6 && timeskilled == 0)
 {
 call bleah;
}
else
{
Return;
}

Return;
# ......................................................................................
bleah:
   timeskilled = timeskilled + 1; 

   player = GetLocalPlayerThing();

  Print("Text goes here");

   channel = PlaySoundGlobal(Sound , Volume, 0.0 ,0x80); 


Return;
# ......................................................................................
end
Gravity isn't MY fault--I voted for velcro.
2001-05-31, 9:46 AM #3
Well, you welcome. [http://forums.massassi.net/html/biggrin.gif]
Gravity isn't MY fault--I voted for velcro.
2001-05-31, 10:12 AM #4
I'd almost recommend using linkid= and GetSenderID() here, as it's slightly more efficient, but whatever works! [http://forums.massassi.net/html/smile.gif]

↑ Up to the top!