Renegade Public Forums
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
Home » Renegade Discussions » Mod Release Forum » [Scripts] Building Under Attack & Destroyed  () 5 Votes
[Scripts] Building Under Attack & Destroyed [message #368128] Tue, 20 January 2009 14:48 Go to previous message
mrãçķz is currently offline  mrãçķz
Messages: 3069
Registered: August 2007
Karma:
General (3 Stars)
Permabanned for trying and failing DDoS
This is a Level Editor Code, by attaching this code to a Object and filling in the Parameters you will have a "*** under Attack" and "*** Destroyed" Function for the Object, Sound Parameters also Included, an Updated version comes later:

Here a Compiled Scripts.dll with:

MR_Attack_Announce (Under Attack Message)
Parameters:
Health (Example 25, when the object has reached 0-25HP then it will Display the "Under Attack Message")
Red, Green, Blue: (These are the Message Colors)
Under_Attack_Sound: (Fill in the .wav sound of "Turret Under Attack").
Under_Attack_Sound: (Fill in the Message to Display ("Nod Turret Under Attack").



MR_Death_Announce (Death Message)
Parameters:
Destroyed_Sound: (Fill in the Sound of "Nod Turret Destroyed").
Red, Green, Blue: (These are the Message Colors)
Destroyed_Message: (Fill in the Message to Display ("Nod Turret Destroyed").



Download the Compiled Scripts.dll here: Download.







Source:

.CPP
void MR_Attack_Announce::Damaged(GameObject *obj,GameObject *damager,float damage)
{
	if (Commands->Get_Health(obj) <= Get_Float_Parameter("Health"))
	{
			Commands->Create_2D_Sound(Get_Parameter("Under_Attack_Sound"));
	Send_Message(Get_Int_Parameter("Red"),Get_Int_Parameter("Green"),Get_Int_Parameter("Blue"),Get_Parameter("Under_Attack_Message"));
			Destroy_Script();
}
}
ScriptRegistrant<MR_Attack_Announce> MR_Attack_Announce_Registrant("MR_Attack_Announce","Red:int,Green:int,Blue:int,Health:float,Under_Attack_Sound:string,Under_Attack_Message:string");


void MR_Death_Announce::Killed(GameObject *obj,GameObject *shooter)
{
		Commands->Create_2D_Sound(Get_Parameter("Destroyed_Sound"));
  Send_Message(Get_Int_Parameter("Red"),Get_Int_Parameter("Green"),Get_Int_Parameter("Blue"),Get_Parameter("Destroyed_Message"));
}
ScriptRegistrant<MR_Death_Announce> MR_Death_Announce_Registrant("MR_Death_Announce","Destroyed_Sound:string,Red:int,Green:int,Blue:int,Destroyed_Message:string");



.H
class MR_Attack_Announce : public ScriptImpClass {
	void Damaged(GameObject *obj,GameObject *damager,float damage);
};

class MR_Death_Announce : public ScriptImpClass {
	void Killed(GameObject *obj,GameObject *shooter);
};

[Updated on: Tue, 20 January 2009 14:49]

Report message to a moderator

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: [3rd Party] Map Downloader
Next Topic: [sound]UberBoink Pack
Goto Forum:
  


Current Time: Mon Jan 27 04:48:49 MST 2025

Total time taken to generate the page: 0.00974 seconds