Renegade Public Forums
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
Home » Renegade Discussions » Mod Release Forum » [script]reb_healing_arua
[script]reb_healing_arua [message #328838] Sat, 03 May 2008 07:15 Go to next message
reborn is currently offline  reborn
Messages: 3231
Registered: September 2004
Location: uk - london
Karma: 0
General (3 Stars)
I needed to make a healing arua script for cnc_reborn, but I thought the renegaders might find it useful too.
I have hard coded all the values to make it heal your own teams infantry only if they are withing 15 feet of the objects with the script attached. it heals there health only at a rate of +2 per second.
It might be nice for veteran players or perhaps as a crate, i dunno :-/

If people like it but only want to use it in level edit and change some of the values themselves then I will re-write it for that purpose and send it to Jonathan/SaberHawk/Jerad (whoever is writing the new one Smile ).

I have another reason for posting it here, it's the first time i've dealt with the GenericSLNode * type and NodeData, it seems to me that It returns allot of objects and I have to filter most of them out, so if anyone sees some flaws in this or thinks they can make it more efficient then please post and correct me Smile


void reb_healing_aura::Created(GameObject *obj){
Commands->Start_Timer(obj,this,1.0f,1);
}

void reb_healing_aura::Timer_Expired(GameObject *obj,int number){
	if (number == 1){
	int team = Get_Object_Type(obj);
Vector3 CurPosition = Commands->Get_Position(obj);

GenericSLNode *x = BaseGameObjList->HeadNode;
while (x){
GameObject *o = (GameObject *)x->NodeData;
if (o && As_ScriptableGameObj(o) && Is_Soldier(o)){
	if ((Get_Object_Type(o) == team)){
		Vector3 CurPositiono = Commands->Get_Position(o);
float Dist = Commands->Get_Distance(CurPosition,CurPositiono);
if(Dist <= 15.0f){
		float armour = Commands->Get_Health(o);
		armour += 2.0f;
		if (armour > Commands->Get_Max_Health(o))
		{
			armour = Commands->Get_Max_Health(o);
		}
		Commands->Set_Health(o,armour);

	}
	}
}
x = x->NodeNext;
}
Commands->Start_Timer(obj,this,1.0f,1);
	}
}


ScriptRegistrant<reb_healing_aura> reb_healing_aura_Registrant("reb_healing_aura","");


class reb_healing_aura : public ScriptImpClass {
	void Created(GameObject *obj);
	void Timer_Expired(GameObject *obj,int number);
};



[Updated on: Fri, 30 January 2009 14:18] by Moderator

Report message to a moderator

Re: reb_healing_arua [message #328840 is a reply to message #328838] Sat, 03 May 2008 07:30 Go to previous messageGo to next message
ErroR is currently offline  ErroR
Messages: 2984
Registered: March 2008
Location: Moldova
Karma: 0
General (2 Stars)
Nice as allways:
You kick ass Rocked Over
Re: reb_healing_arua [message #328895 is a reply to message #328838] Sat, 03 May 2008 19:52 Go to previous messageGo to next message
rhuarc is currently offline  rhuarc
Messages: 57
Registered: February 2007
Karma: 0
Recruit
how would i use this..?
Re: reb_healing_arua [message #328896 is a reply to message #328838] Sat, 03 May 2008 19:54 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)
is this script used for the medic by any chance?
Re: reb_healing_arua [message #328905 is a reply to message #328896] Sun, 04 May 2008 01:09 Go to previous messageGo to next message
reborn is currently offline  reborn
Messages: 3231
Registered: September 2004
Location: uk - london
Karma: 0
General (3 Stars)
rhuarc wrote on Sat, 03 May 2008 22:52

how would i use this..?


Add the code to SSGM then attach it to a GameObject *.

SSnipe wrote on Sat, 03 May 2008 22:54

is this script used for the medic by any chance?


Yeah, I will be adding it to him shortly, he is kinda useless as he is now, especially seeing as the technician/engineer can heal quicker...



Re: reb_healing_arua [message #328946 is a reply to message #328905] Sun, 04 May 2008 10:01 Go to previous message
_SSnipe_ is currently offline  _SSnipe_
Messages: 4121
Registered: May 2007
Location: Riverside Southern Califo...
Karma: 0
General (4 Stars)
Quote:


Yeah, I will be adding it to him shortly, he is kinda useless as he is now, especially seeing as the technician/engineer can heal quicker...



lmfao
need to make it so nothing can heal infantry ONLY medic

[Updated on: Sun, 04 May 2008 10:02]

Report message to a moderator

Previous Topic: [skin] Door 2.12
Next Topic: Server-Side Obelisk / AGT and Walls 4u
Goto Forum:
  


Current Time: Sun Aug 25 23:18:44 MST 2024

Total time taken to generate the page: 0.00776 seconds