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 next message
mrãçķz is currently offline  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 #368190 is a reply to message #368128] Tue, 20 January 2009 23:34 Go to previous messageGo to next message
Gen_Blacky is currently offline  Gen_Blacky
Messages: 3250
Registered: September 2006
Karma: 1
General (3 Stars)
I Tested this out it works besides i couldn't change the msg color it was just black i changed rgb settings but i must be setting it wrong.

Ty for this script


http://s18.postimage.org/jc6qbn4k9/bricks3.png
Re: [Scripts] Building Under Attack & Destroyed [message #368194 is a reply to message #368128] Wed, 21 January 2009 00:10 Go to previous messageGo to next message
_SSnipe_ is currently offline  _SSnipe_
Messages: 4121
Registered: May 2007
Location: Riverside Southern Califo...
Karma: 0
General (4 Stars)
Dont understand what it does, doesn't renegade already do this?
Re: [Scripts] Building Under Attack & Destroyed [message #368219 is a reply to message #368128] Wed, 21 January 2009 03:08 Go to previous messageGo to next message
wittebolx is currently offline  wittebolx
Messages: 332
Registered: May 2007
Location: the netherlands
Karma: 0
Recruit
uhm.. Zunnie posted a code for this a long time ago when he created the co-op for Renegade. doesnt include any leveleditor stuff, just c++

anyway good job.


Re: [Scripts] Building Under Attack & Destroyed [message #368232 is a reply to message #368128] Wed, 21 January 2009 07:09 Go to previous messageGo to next message
Genesis2001
Messages: 1397
Registered: August 2006
Karma: 0
General (1 Star)
Interesting script madrocks. Could you try to indent better next time? :/ lol

but good work!
Re: [Scripts] Building Under Attack & Destroyed [message #368238 is a reply to message #368128] Wed, 21 January 2009 08:47 Go to previous messageGo to next message
mrãçķz is currently offline  mrãçķz
Messages: 3069
Registered: August 2007
Karma: 0
General (3 Stars)
Permabanned for trying and failing DDoS
The colors worked for me and rrutk Dont Get It
Re: [Scripts] Building Under Attack & Destroyed [message #368259 is a reply to message #368128] Wed, 21 January 2009 11:06 Go to previous messageGo to next message
mrãçķz is currently offline  mrãçķz
Messages: 3069
Registered: August 2007
Karma: 0
General (3 Stars)
Permabanned for trying and failing DDoS
Hehehe some noobs turned EMO by rating my Threats bad Laughing i dont care about that keep rating guys

http://www.crossfire.nu/images/users/pic-1570-eric%20cartman.jpg

[Updated on: Wed, 21 January 2009 11:06]

Report message to a moderator

Re: [Scripts] Building Under Attack & Destroyed [message #368273 is a reply to message #368219] Wed, 21 January 2009 12:58 Go to previous messageGo to next message
mrãçķz is currently offline  mrãçķz
Messages: 3069
Registered: August 2007
Karma: 0
General (3 Stars)
Permabanned for trying and failing DDoS
wittebolx wrote on Wed, 21 January 2009 04:08

uhm.. Zunnie posted a code for this a long time ago when he created the co-op for Renegade. doesnt include any leveleditor stuff, just c++

anyway good job.

You dont needs for my Code the Level Editer, you can attach the script in the Scripts.dll to the Presets Sarcasm
Re: [Scripts] Building Under Attack & Destroyed [message #368308 is a reply to message #368194] Wed, 21 January 2009 18:49 Go to previous messageGo to next message
rrutk is currently offline  rrutk
Messages: 617
Registered: June 2007
Karma: 0
Colonel
SSnipe wrote on Wed, 21 January 2009 01:10

Dont understand what it does, doesn't renegade already do this?


For buildings renegade does itself.

For Mounted Vehicles it should, but it doesnt, even if the strings and links to the sound-presets are set correct.

Dunno why.

[Updated on: Thu, 22 January 2009 13:38]

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 Go to previous messageGo to next message
_SSnipe_ is currently offline  _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 #368335 is a reply to message #368128] Thu, 22 January 2009 02:15 Go to previous messageGo to next message
mrãçķz is currently offline  mrãçķz
Messages: 3069
Registered: August 2007
Karma: 0
General (3 Stars)
Permabanned for trying and failing DDoS
Hmmm place the Object on the Map, then attach the Script to the placed Object, thats how it worked for me
Re: [Scripts] Building Under Attack & Destroyed [message #368373 is a reply to message #368335] Thu, 22 January 2009 08:29 Go to previous messageGo to next message
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 Go to previous messageGo to next message
rrutk is currently offline  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

Re: [Scripts] Building Under Attack & Destroyed [message #371560 is a reply to message #368128] Wed, 11 February 2009 06:31 Go to previous messageGo to next message
jnz is currently offline  jnz
Messages: 3396
Registered: July 2006
Location: 30th century
Karma: 0
General (3 Stars)
By the looks of the code, it will only display the message once. No matter if it's repaired to full health again.

Also you should make it so when it's first attacked it will show the warning, rather than waiting to get below a certain threshold.
Re: [Scripts] Building Under Attack & Destroyed [message #371609 is a reply to message #368128] Wed, 11 February 2009 10:46 Go to previous message
Genesis2001
Messages: 1397
Registered: August 2006
Karma: 0
General (1 Star)
I'll post a complement to this script when I get home. Shouldn't be too much imo. Razz

EDIT: Here is my version of the script

[Updated on: Wed, 11 February 2009 17:12]

Report message to a moderator

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


Current Time: Sun Jun 09 17:50:28 MST 2024

Total time taken to generate the page: 0.00927 seconds