Hi! Welcome to the forum for Platinum Arts Sandbox Free 3D Game Maker. I currently have the forums locked as I am attempting to properly update them.
In the meantime please join the new Discord Server!
If you have any questions please e-mail me through the Platinum Arts website.
In the meantime please join the new Discord Server!
If you have any questions please e-mail me through the Platinum Arts website.
Life Bar System
- GoBologna120
- Member
- Posts: 167
- Joined: June 10th, 2009, 3:07 pm
- Name: Tim
- IRC Username: GoBologna
- Location: Nowhere in particular.
Life Bar System
I would like to know if it's possible to give your character a life bar that floats above their head using only a .cfg. I'm not very good at C++, so I'm not sure that I can really code it into the source code.

Yay. ^_^
Re: Life Bar System
it's literally one line of code, the declaration you'd want to use...
and how you'd use it
might require a few attempts, but good luck (and check the wiki on compiling)
Code: Select all
extern void particle_meter(const vec &s, float val, int type, int fade = 1, int color = 0xFFFFFF, int color2 = 0xFFFFF, float size = 2.0f);
Code: Select all
particle_meter( player1->abovehead(), 100 * player1->health / player1->maxhealth, PART_TEXT, 1, 0xFF0000, 0, 2.0f);
This is not a url, clicking it is pointless
Re: Life Bar System
And/or you could check out the RPG
Take care.
-mike

-mike
Sign up for our Newsletter to keep up to date with the Sandbox news!
We also have a facebook page, facebook group, myspace page and a twitter page[/b][/color]!
We also have a facebook page, facebook group, myspace page and a twitter page[/b][/color]!
- GoBologna120
- Member
- Posts: 167
- Joined: June 10th, 2009, 3:07 pm
- Name: Tim
- IRC Username: GoBologna
- Location: Nowhere in particular.
Re: Life Bar System
Awesome! Thanks. I'll check the RPG source to see where I'd put it.Hirato wrote:it's literally one line of code, the declaration you'd want to use...
and how you'd use itCode: Select all
extern void particle_meter(const vec &s, float val, int type, int fade = 1, int color = 0xFFFFFF, int color2 = 0xFFFFF, float size = 2.0f);
might require a few attempts, but good luck (and check the wiki on compiling)Code: Select all
particle_meter( player1->abovehead(), 100 * player1->health / player1->maxhealth, PART_TEXT, 1, 0xFF0000, 0, 2.0f);

Yay. ^_^
Re: Life Bar System
Does this require me to make a new cfg document or is there some kind of already-made-cfg document I can import this in?Hirato wrote:it's literally one line of code, the declaration you'd want to use...
and how you'd use itCode: Select all
extern void particle_meter(const vec &s, float val, int type, int fade = 1, int color = 0xFFFFFF, int color2 = 0xFFFFF, float size = 2.0f);
might require a few attempts, but good luck (and check the wiki on compiling)Code: Select all
particle_meter( player1->abovehead(), 100 * player1->health / player1->maxhealth, PART_TEXT, 1, 0xFF0000, 0, 2.0f);
"Vader: Obi-Wan once thought as you do. You don't know the power of the Dark Side!"
-Palpatine: Are you threating me master Jedi?
-Mace: The Senate will decide your fate.
-Palpatine: I *AM* the Senate!
-Mace: Not yet.
-Palpatine: It's treason, then.
-Palpatine: Are you threating me master Jedi?
-Mace: The Senate will decide your fate.
-Palpatine: I *AM* the Senate!
-Mace: Not yet.
-Palpatine: It's treason, then.

- GoBologna120
- Member
- Posts: 167
- Joined: June 10th, 2009, 3:07 pm
- Name: Tim
- IRC Username: GoBologna
- Location: Nowhere in particular.
-
- Restricted User
- Posts: 27
- Joined: June 16th, 2009, 10:50 am
- Name: Caitlin
Re: Life Bar System
I'm a little confused by this statement. Does it go in an OGZ file then?GoBologna120 wrote:This goes in the source code. You don't use a .cfg.
- GoBologna120
- Member
- Posts: 167
- Joined: June 10th, 2009, 3:07 pm
- Name: Tim
- IRC Username: GoBologna
- Location: Nowhere in particular.
Re: Life Bar System
Looked at the Wiki recently?
http://sandboxgamemaker.com/wiki/index. ... ource_code
It's C++ code, therefore, you have to recompile the game to use it.
http://sandboxgamemaker.com/wiki/index. ... ource_code
It's C++ code, therefore, you have to recompile the game to use it.

Yay. ^_^
-
- Restricted User
- Posts: 27
- Joined: June 16th, 2009, 10:50 am
- Name: Caitlin
Re: Life Bar System
I get it now, you must understand my confusion. Considering the only thing that explains how to edit code (for an actual purpose that is mentioned...aka NPCs) says to edit it in the config. The wiki doesn't really explain when you need to use C++ and compile...yet 

- GoBologna120
- Member
- Posts: 167
- Joined: June 10th, 2009, 3:07 pm
- Name: Tim
- IRC Username: GoBologna
- Location: Nowhere in particular.
Re: Life Bar System
That's because you can do so much without recompiling. 
EDIT: Okay. I can't figure out where to put it.

EDIT: Okay. I can't figure out where to put it.


Yay. ^_^