Low Health [message #315780] |
Wed, 06 February 2008 10:28 |
|
Has anyone ever made something that says "Warning: Health level critical" when a certain amount of health is left?
I know some servers have the crates that say that when you get the needle crate, but I have never heard of one that just does it when you reach a certain amount of health.
So has one been made if not could someone make one?
Lone0001.ca
C&C Files
|
|
|
|
Re: Low Health [message #315797 is a reply to message #315783] |
Wed, 06 February 2008 11:39 |
Genesis2001
Messages: 1397 Registered: August 2006
Karma: 0
|
General (1 Star) |
|
|
cnc95fan wrote on Wed, 06 February 2008 10:42 | I'll *try* and make it, but I know very VERY litle C++... so give it a while
|
It's simple to do. I could do it, but I need to know the *.wav files to play... :/
~Zack
|
|
|
Re: Low Health [message #315798 is a reply to message #315797] |
Wed, 06 February 2008 11:41 |
cnc95fan
Messages: 1261 Registered: July 2007
Karma: 0
|
General (1 Star) |
|
|
[quote title=Zack wrote on Wed, 06 February 2008 12:39]cnc95fan wrote on Wed, 06 February 2008 10:42 |
It's simple to do.
~Zack
|
Not if you know only enough to do a basic cout << "blah blah" << someint here<< ;
I failed.. even WITH help from RoShamBo
[Updated on: Wed, 06 February 2008 11:47] Report message to a moderator
|
|
|
|
Re: Low Health [message #315802 is a reply to message #315801] |
Wed, 06 February 2008 12:10 |
cnc95fan
Messages: 1261 Registered: July 2007
Karma: 0
|
General (1 Star) |
|
|
MSwindows wrote on Wed, 06 February 2008 14:06 | No it is easy, because in SP when you have like 10 hp left EVA says "WARNING: Health Level Critical"
|
But that won't help us with MP.. Unless.. Let me have a quick look through LE..
|
|
|
|
|
|
Re: Low Health [message #315808 is a reply to message #315780] |
Wed, 06 February 2008 12:25 |
cnc95fan
Messages: 1261 Registered: July 2007
Karma: 0
|
General (1 Star) |
|
|
Well, I'm too [FAIL] to make it, but when (how does a community stay alive without helping eachother?) someone does make it for you, I'm sure you will be able to change the health at the push of two numbers on your keyboard.
|
|
|
|
Re: Low Health [message #315817 is a reply to message #315809] |
Wed, 06 February 2008 12:45 |
cnc95fan
Messages: 1261 Registered: July 2007
Karma: 0
|
General (1 Star) |
|
|
MSwindows wrote on Wed, 06 February 2008 20:29 |
cnc95fan wrote on Wed, 06 February 2008 13:25 | ...push of two numbers on your keyboard.
|
Or 1 or 3, anyway I am sure you could attach some scripts to it in order to get it to work, I will check LE and see about that, tell you later today...or this evening I ment.
!scripts cnc95fan
Host(PM from BrenBot): Player cnc95fan is running scripts version 3.9
|
The hell are you on about? The latest scripts version is 3.4.4 and I havn't played Ren for about 2 months now..
|
|
|
|
Re: Low Health [message #315827 is a reply to message #315780] |
Wed, 06 February 2008 13:11 |
Genesis2001
Messages: 1397 Registered: August 2006
Karma: 0
|
General (1 Star) |
|
|
**Note: I wrote this during school just now and it hasn't been tested.
***(also) Note: I'm not clear on a couple of the functions in the Commands->(function) class. Someone who has access to scripts.h can correct me if I'm wrong.
Header File:
class zbl_Health_Level : public ScriptImpClass {
void Created(GameObject *obj);
void Timer_Expired(GameObject *obj, int number);
int ID;
};
Source File:
void zbl_Health_Level::Created(GameObject *obj) {
ID = Get_Player_ID(obj);
Commands->Start_Timer(obj, this, 1.0f, 123);
}
void zbl_Health_Level::Timer_Expired(GameObject *obj, int number) {
if (number == 123) {
if (Commands->Get_Health(obj) <= 25) {
Commands->Create_2D_WAV_Sound("correction_3.wav"); // Change this to whatever sound j00 want.
char Msg1[150];
sprintf(Msg1, "ppage %d Warning: Health Level Critical", ID);
Console_Input(Msg1);
}
else if (Commands->Get_Sheild_Strength(obj) <= 50) {
Commands->Create_2D_WAV_Sound("correction_3.wav"); // again, change this...
char Msg1[150];
sprintf(Msg1, "ppage %d Warning: Shield strength critical", ID);
}
Commands->Start_Timer(obj, this, 1.0f, 123);
}
}
****(another) Note: I'll include this in Serverside Co-Op also.
~Zack
|
|
|
|
|
|
|
|
|
|
Re: Low Health [message #315858 is a reply to message #315780] |
Wed, 06 February 2008 14:52 |
Genesis2001
Messages: 1397 Registered: August 2006
Karma: 0
|
General (1 Star) |
|
|
One mistake and spammed to death with complaints
I was writing it notepad because I don't have my development environment at school :/
*hopefully fixed* :v If not, someone else can make it while I take the blame for bad scripting. :/
Header File:
class zbl_Health_Level : public ScriptImpClass {
void Created(GameObject *obj);
void Timer_Expired(GameObject *obj, int number);
int ID;
bool SentHealth;
bool SentArmour;
};
Source File:
void zbl_Health_Level::Created(GameObject *obj) {
ID = Get_Player_ID(obj);
SentHealth = false;
SentArmour = false;
Commands->Start_Timer(obj, this, 1.0f, 123);
}
void zbl_Health_Level::Timer_Expired(GameObject *obj, int number) {
if (number == 123) {
if (!SentHealth && !SentArmour) {
if (Commands->Get_Health(obj) <= 25 && !SentHealth) {
Commands->Create_2D_WAV_Sound("correction_3.wav"); // Change this
char Msg1[150];
sprintf(Msg1, "ppage %d Warning: Health Level Critical", ID);
Console_Input(Msg1);
SentHealth = true; // To avoid spamming the player! :/
}
else if (Commands->Get_Shield_Strength(obj) <= 50 && !SentArmour) {
Commands->Create_2D_WAV_Sound("correction_3.wav"); // again, change this...
char Msg1[150];
sprintf(Msg1, "ppage %d Warning: Armour strength critical", ID);
Console_Input(Msg1);
SentArmour = true; // avoid spamming the player >_>
}
Sent = true;
Commands->Start_Timer(obj, this, 1.0f, 123);
}
else { // already sent...Check to see if their health is above 25 and set it back to false
if (Commands->Get_Health(obj) > 25) {
SentHealth = false;
}
else if (Commands->Get_Shield_Strength(obj) > 50) {
SentArmour = false;
}
}
}
}
|
|
|
Re: Low Health [message #315860 is a reply to message #315780] |
Wed, 06 February 2008 15:01 |
|
Hex
Messages: 858 Registered: March 2004
Karma: 0
|
Colonel |
|
|
I never ment that, on maps such as mesa you would get paged all the time with the mrl whoring
A better way to do it would be ::Damaged
Edt: typo!
goztow wrote on Tue, 11 May 2010 08:00 | If we had to ban all who ever cheated or ever created a cheat (obj3cts and such) then I don't think there would be many members left here (sad fact).
|
reborn wrote on Fri, 29 January 2010 23:37 | std is for pro's.
|
[Updated on: Wed, 06 February 2008 15:02] Report message to a moderator
|
|
|
Re: Low Health [message #315861 is a reply to message #315780] |
Wed, 06 February 2008 15:01 |
|
reborn
Messages: 3231 Registered: September 2004 Location: uk - london
Karma: 0
|
General (3 Stars) |
|
|
Nice effort, I like how you used the boolean. But I think Hex is right to be fair, the timer is quite combersome while the ::damaged event would probably prove allot more healthy for the CPU (I am guilty of this type of thing myself to be fair, don't get mad ).
But don't sweat it Zack, to be honest I don't really see anyone else contributing too much to the conversation.
Perhaps make the health value conditional an input parameter for the level edit guys rather then a fixed value?
[Updated on: Wed, 06 February 2008 15:05] Report message to a moderator
|
|
|
Re: Low Health [message #315873 is a reply to message #315861] |
Wed, 06 February 2008 15:43 |
Genesis2001
Messages: 1397 Registered: August 2006
Karma: 0
|
General (1 Star) |
|
|
reborn wrote on Wed, 06 February 2008 15:01 | Perhaps make the health value conditional an input parameter for the level edit guys rather then a fixed value?
|
In my experience, I've got bad luck with Script Parameters :/
But it wouldn't be hard to do it though....
~Zack
|
|
|