| 
		
			| [Scripts] Building Under Attack & Destroyed [message #368128] | Tue, 20 January 2009 14:48  |  
			| 
				
				|  |  mrãçķz Messages: 3069
 Registered: August 2007
 
	Karma: 0
 | 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 |  
	|  |  | 
	|  | 
	|  | 
	|  | 
	|  | 
	|  | 
	|  | 
	|  | 
	|  | 
	| 
		
			| Re: [Scripts] Building Under Attack & Destroyed [message #368310 is a reply to message #368308] | Wed, 21 January 2009 19:59   |  
			| 
				
				
					|  _SSnipe_ Messages: 4121
 Registered: May 2007
 Location: Riverside Southern Califo...
 
	Karma: 0
 | General (4 Stars) |  |  |  
	| | rrutk wrote on Wed, 21 January 2009 17:49 |  | 
 | SSnipe wrote on Wed, 21 January 2009 01:10 |  | Dont understand what it does, doesn't renegade already do this?
 
 | 
 
 For buildings it does.
 
 For Mounted Vehicles it should, but it doesnt, even if the strings and links to the sound-presets are set correct.
 
 Dunno why.
 
 
 | 
 So what does it do?, Still a little lost
 |  
	|  |  | 
	|  | 
	| 
		
			| Re: [Scripts] Building Under Attack & Destroyed [message #368373 is a reply to message #368335] | Thu, 22 January 2009 08:29   |  
			| 
				
				
					| Genesis2001 Messages: 1397
 Registered: August 2006
 
	Karma: 0
 | General (1 Star) |  |  |  
	| | SSnipe wrote on Wed, 21 January 2009 19:59 |  | 
 | rrutk wrote on Wed, 21 January 2009 17:49 |  | 
 | SSnipe wrote on Wed, 21 January 2009 01:10 |  | Dont understand what it does, doesn't renegade already do this?
 
 | 
 
 For buildings it does.
 
 For Mounted Vehicles it should, but it doesnt, even if the strings and links to the sound-presets are set correct.
 
 Dunno why.
 
 
 | 
 So what does it do?, Still a little lost
 
 | 
 
 It announces "<blank> is under attack!" on an object other than a building.
 
 
 | mǻdrãçķz wrote on Thu, 22 January 2009 02:15 |  | Hmmm place the Object on the Map, then attach the Script to the placed Object, thats how it worked for me
 
 | 
 
 He asked what it does.. lol
 |  
	|  |  | 
	| 
		
			| Re: [Scripts] Building Under Attack & Destroyed [message #371556 is a reply to message #368373] | Wed, 11 February 2009 06:17   |  
			| 
				
				|  |  rrutk Messages: 617
 Registered: June 2007
 
	Karma: 0
 | Colonel |  |  |  
	| Nearly all message_send_custom_xx scripts in 3.4.4 have the bug, that they display not the textstring but the numeric message! 
 Need a simple WORKING script: Display_Message_Custom_Team_Sound (to display a textmessage for seperated NOD/GDI teams on custom and play a sound).
 
 And may be a bugfixed version of your Attack-Announcment-Scripts (friendly fire fixed).
 [Updated on: Wed, 11 February 2009 06:52] Report message to a moderator |  
	|  |  | 
	|  | 
	|  |