Renegade Public Forums
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
Home » Renegade Discussions » Mod Forum » Low Health
Low Health [message #315780] Wed, 06 February 2008 10:28 Go to next message
Lone0001 is currently offline  Lone0001
Messages: 2112
Registered: August 2006
Location: Ontario, Canada
Karma: 0
General (2 Stars)

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?


Re: Low Health [message #315783 is a reply to message #315780] Wed, 06 February 2008 10:42 Go to previous messageGo to next message
cnc95fan is currently offline  cnc95fan
Messages: 1261
Registered: July 2007
Karma: 0
General (1 Star)
I'll *try* and make it, but I know very VERY litle C++... so give it a while Razz
Re: Low Health [message #315797 is a reply to message #315783] Wed, 06 February 2008 11:39 Go to previous messageGo to next message
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 Razz



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 Go to previous messageGo to next message
cnc95fan is currently offline  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 Dont Get It

[Updated on: Wed, 06 February 2008 11:47]

Report message to a moderator

Re: Low Health [message #315801 is a reply to message #315798] Wed, 06 February 2008 12:06 Go to previous messageGo to next message
The Executor is currently offline  The Executor
Messages: 464
Registered: February 2008
Location: Eastern Coast, USA
Karma: 0
Commander
No it is easy, because in SP when you have like 10 hp left EVA says "WARNING: Health Level Critical"

Imperial Class Super Star Destroyer
http://l.yimg.com/us.yimg.com/i/us/wrlds/strwrs/gr/hdrs/super-star-destroyer-1.jpg

Quote:

"Fear will keep these systems inline, fear of this battle station!"

-Grand Admiral Moff Tarkin



Re: Low Health [message #315802 is a reply to message #315801] Wed, 06 February 2008 12:10 Go to previous messageGo to next message
cnc95fan is currently offline  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 #315804 is a reply to message #315801] Wed, 06 February 2008 12:13 Go to previous messageGo to next message
Ethenal is currently offline  Ethenal
Messages: 2532
Registered: January 2007
Location: US of A
Karma: 0
General (2 Stars)

MSwindows wrote on Wed, 06 February 2008 13:06

No it is easy, because in SP when you have like 10 hp left EVA says "WARNING: Health Level Critical"


You do know this involves C++ coding, right?


-TLS-DJ-EYE-K wrote on Mon, 18 March 2013 07:29

Instead of showing us that u aren't more inteligent than a Toast, maybe you should start becomming good in renegade Thumbs Up

Re: Low Health [message #315806 is a reply to message #315780] Wed, 06 February 2008 12:20 Go to previous messageGo to next message
cnc95fan is currently offline  cnc95fan
Messages: 1261
Registered: July 2007
Karma: 0
General (1 Star)
Technechally, if you modifiy JFW_Play_Sound to if (health > 25) else break; .. amrite?
Re: Low Health [message #315807 is a reply to message #315780] Wed, 06 February 2008 12:21 Go to previous messageGo to next message
Lone0001 is currently offline  Lone0001
Messages: 2112
Registered: August 2006
Location: Ontario, Canada
Karma: 0
General (2 Stars)

Well tbh I think if someone did make this it would be nice if it came with some way to easily edit it to w/e health you want not just a set health that is not changeable.

Re: Low Health [message #315808 is a reply to message #315780] Wed, 06 February 2008 12:25 Go to previous messageGo to next message
cnc95fan is currently offline  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 #315809 is a reply to message #315808] Wed, 06 February 2008 12:29 Go to previous messageGo to next message
The Executor is currently offline  The Executor
Messages: 464
Registered: February 2008
Location: Eastern Coast, USA
Karma: 0
Commander
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


Imperial Class Super Star Destroyer
http://l.yimg.com/us.yimg.com/i/us/wrlds/strwrs/gr/hdrs/super-star-destroyer-1.jpg

Quote:

"Fear will keep these systems inline, fear of this battle station!"

-Grand Admiral Moff Tarkin



Re: Low Health [message #315817 is a reply to message #315809] Wed, 06 February 2008 12:45 Go to previous messageGo to next message
cnc95fan is currently offline  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 #315820 is a reply to message #315817] Wed, 06 February 2008 12:49 Go to previous messageGo to next message
The Executor is currently offline  The Executor
Messages: 464
Registered: February 2008
Location: Eastern Coast, USA
Karma: 0
Commander
lol my mistake X_X

Anyway I only have scripts 2.9 so yeah I should update....


Imperial Class Super Star Destroyer
http://l.yimg.com/us.yimg.com/i/us/wrlds/strwrs/gr/hdrs/super-star-destroyer-1.jpg

Quote:

"Fear will keep these systems inline, fear of this battle station!"

-Grand Admiral Moff Tarkin



Re: Low Health [message #315827 is a reply to message #315780] Wed, 06 February 2008 13:11 Go to previous messageGo to next message
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.
Tell Me

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. Smile
~Zack
Re: Low Health [message #315831 is a reply to message #315780] Wed, 06 February 2008 13:21 Go to previous messageGo to next message
cnc95fan is currently offline  cnc95fan
Messages: 1261
Registered: July 2007
Karma: 0
General (1 Star)
What .cpp and .h files does that go into?
Re: Low Health [message #315832 is a reply to message #315831] Wed, 06 February 2008 13:23 Go to previous messageGo to next message
Ethenal is currently offline  Ethenal
Messages: 2532
Registered: January 2007
Location: US of A
Karma: 0
General (2 Stars)

cnc95fan wrote on Wed, 06 February 2008 14:21

What .cpp and .h files does that go into?


He probably put them into some extra header/source files and included them from somewhere.


-TLS-DJ-EYE-K wrote on Mon, 18 March 2013 07:29

Instead of showing us that u aren't more inteligent than a Toast, maybe you should start becomming good in renegade Thumbs Up

Re: Low Health [message #315835 is a reply to message #315780] Wed, 06 February 2008 13:28 Go to previous messageGo to next message
cnc95fan is currently offline  cnc95fan
Messages: 1261
Registered: July 2007
Karma: 0
General (1 Star)
Well, I put them into separate .cpp and .h files, and got a lot of ; before },{ errors... and undeclared "int's"... So that needs to be revised by someone whos a) not at school Razz, and b) good at coding (not saying you arn't, just in case that's what you were thinking).
Re: Low Health [message #315837 is a reply to message #315780] Wed, 06 February 2008 13:30 Go to previous messageGo to next message
Ethenal is currently offline  Ethenal
Messages: 2532
Registered: January 2007
Location: US of A
Karma: 0
General (2 Stars)

Are you using VS '05?

-TLS-DJ-EYE-K wrote on Mon, 18 March 2013 07:29

Instead of showing us that u aren't more inteligent than a Toast, maybe you should start becomming good in renegade Thumbs Up

Re: Low Health [message #315839 is a reply to message #315780] Wed, 06 February 2008 13:31 Go to previous messageGo to next message
cnc95fan is currently offline  cnc95fan
Messages: 1261
Registered: July 2007
Karma: 0
General (1 Star)
Yes.
Edit: It doesn't like that way you put in ScriptImpClass and therefore doesn't understand (GameObject *obj)

[Updated on: Wed, 06 February 2008 13:36]

Report message to a moderator

Re: Low Health [message #315849 is a reply to message #315780] Wed, 06 February 2008 14:08 Go to previous messageGo to next message
Hex is currently offline  Hex
Messages: 858
Registered: March 2004
Karma: 0
Colonel
Got page spam?

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. Razz
Re: Low Health [message #315852 is a reply to message #315849] Wed, 06 February 2008 14:21 Go to previous messageGo to next message
Zion is currently offline  Zion
Messages: 2722
Registered: April 2006
Karma: 1
General (2 Stars)
Hex wrote on Wed, 06 February 2008 21:08

Got page spam?


Yeah, Math, looking over that code (even though i have NO C++ experience what-so-ever) i could point out that if your health or armour is less than the values you coded, it will keep paging you... I think...

Might want to break from the event as soon as you get the page.

Plus, i think it would be a better feature if you used the green text which would appear in the middle of the screen to indicate health levels, instead of a server page.

Furthermore, change "Shield" in the page string to "Armor".
Re: Low Health [message #315858 is a reply to message #315780] Wed, 06 February 2008 14:52 Go to previous messageGo to next message
Genesis2001
Messages: 1397
Registered: August 2006
Karma: 0
General (1 Star)
Angry

One mistake and spammed to death with complaints Sad

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 Go to previous messageGo to next message
Hex is currently offline  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. Razz

[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 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)
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 Razz).

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? Smile



[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 Go to previous messageGo to previous message
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? Smile



In my experience, I've got bad luck with Script Parameters :/

But it wouldn't be hard to do it though....

~Zack
Previous Topic: GDI Guard Tower(s)?
Next Topic: RenX - protected models?
Goto Forum:
  


Current Time: Fri Dec 20 12:19:20 MST 2024

Total time taken to generate the page: 0.01372 seconds