Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Author
Message
Mugen Wizardry
User Banned
Posted: 2nd Aug 2010 00:39
how do i make the plain the same size as the health bar? also, how would i make the background transparent?



CHECK OUT SOME MUSIC FROM MY NEW TECHNO CD! TECHNOKINESIS
http://www.youtube.com/watch?v=4a8KedfgVv0
ALSO, CHECK OUT MY NEW TECHNO CD! http://www.imageposeidon.com/
HowDo
23
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 2nd Aug 2010 12:37 Edited at: 2nd Aug 2010 13:07
Are you after something like this.





Dark Physics makes any hot drink go cold.
Van B
Moderator
23
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 2nd Aug 2010 12:51
BACKDROP OFF, will disable the backdrop, if that's what you mean by transparent.

What sort of health bar are you after.

Maybe, something like this would work:

MAKE OBJECT PLAIN 10,200,20
OFFSET LIMB 10,1,100,0,0

Then assuming your health value is in a 0-100 range:

SCALE OBJECT 10,Health#,100,100

That makes a plain at 200x20, then offsets it to the lright by 100. This means that when you scale the whole object, it goes from nothing to a full width bar, the centre point of the plain is changed so that it works like a bar instead. This could be done with an object too, I often use animated objects for score displayes, I've made a retro number counter like on an old tape player, and even a flick down timer, like in LOST or an old 70's alarm clock. You could make a whole HUD as a 3D object if you wanted, then scale, rotate, whatever to control the individual bits. A good example would be a compass, just make a compass body, then a needle as a seperate limb with a sensible pivot point, and then it's real easy to get it working just like a compass. Depends on the sort of interface you are going for.

Health, Ammo, and bacon and eggs!
Mugen Wizardry
User Banned
Posted: 2nd Aug 2010 14:13
i like howdo's idea

thanks!

CHECK OUT SOME MUSIC FROM MY NEW TECHNO CD! TECHNOKINESIS
http://www.youtube.com/watch?v=4a8KedfgVv0
ALSO, CHECK OUT MY NEW TECHNO CD! http://www.imageposeidon.com/
Mugen Wizardry
User Banned
Posted: 2nd Aug 2010 14:23 Edited at: 2nd Aug 2010 14:37
how can i control the healthbar amount
using a key?

also, why wont this rotate with both the camera and the enemy, so it creates a billboard effect and a 3d effect?



CHECK OUT SOME MUSIC FROM MY NEW TECHNO CD! TECHNOKINESIS
http://www.youtube.com/watch?v=4a8KedfgVv0
ALSO, CHECK OUT MY NEW TECHNO CD! http://www.imageposeidon.com/
Van B
Moderator
23
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 2nd Aug 2010 15:06
You should lock your health bar plain to the screen, LOCK OBJECT 1 - then it is stuck in relation to the screen, so positioning it at 0,0,5 should put it in front, you'll probably want to tweak this though to get a good position.

You can't update the health bar, because it's drawn onto a bitmap, the bitmap is then deleted, and the function itself is too slow to consider using in your main loop. HowDo has given you what you asked for, a health bar technique - but how you update that is not covered, that health bar never updates.

Ideally, you would just draw the thing and load it in, then use a seperate limb or object for the actual bar, like how I suggested already. It's not a good idea to redraw a health bar then grab it.

There are also sprites, why not get a sprite and scale it - like sprite HowDo's bar onto the screen, then have a second sprite for the health value. Sprites are handy because you don't have to keep drawing them, they will stick to the screen, and all you have to do is set the sprite size, as long as you offset it first.

Health, Ammo, and bacon and eggs!
HowDo
23
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 2nd Aug 2010 15:11 Edited at: 2nd Aug 2010 15:19
well I've got the health to update it self, but as for keeping object one facing the camera as to move around, I can't remember what to done.





edit
this let you now keep the bar facing the camera.
uses
SET OBJECT TO CAMERA ORIENTATION 1



Dark Physics makes any hot drink go cold.
Mugen Wizardry
User Banned
Posted: 2nd Aug 2010 15:17
thanks howdo

ok, it has 2 problems.

1. it needs a billboard effect along with rotating with the enemy object (cube)

2. the health limit goes to 101 instead of 100



CHECK OUT SOME MUSIC FROM MY NEW TECHNO CD! TECHNOKINESIS
http://www.youtube.com/watch?v=4a8KedfgVv0
ALSO, CHECK OUT MY NEW TECHNO CD! http://www.imageposeidon.com/
HowDo
23
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 2nd Aug 2010 15:21
I know have I had the keys wrong way round see above post.

Dark Physics makes any hot drink go cold.
Mugen Wizardry
User Banned
Posted: 2nd Aug 2010 15:25
i cant get it to rotate with the object



CHECK OUT SOME MUSIC FROM MY NEW TECHNO CD! TECHNOKINESIS
http://www.youtube.com/watch?v=4a8KedfgVv0
ALSO, CHECK OUT MY NEW TECHNO CD! http://www.imageposeidon.com/
Van B
Moderator
23
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 2nd Aug 2010 15:27
Try using SET OBJECT TO CAMERA ORIENTATION 1

I think that will rotate the plain to bilboard with the camera, as long as it's orientated correctly before fixing it's pivot. You might have to rotate it 180 degrees on Y, because it'll be pointing at the camera.

Health, Ammo, and bacon and eggs!
Mugen Wizardry
User Banned
Posted: 2nd Aug 2010 15:31
i did use it..

CHECK OUT SOME MUSIC FROM MY NEW TECHNO CD! TECHNOKINESIS
http://www.youtube.com/watch?v=4a8KedfgVv0
ALSO, CHECK OUT MY NEW TECHNO CD! http://www.imageposeidon.com/
Van B
Moderator
23
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 2nd Aug 2010 15:38
Hmmmm, can you tell if the object is visible? - I mean it might be pointing at the camera with it's edge, in which case I suggest rotating the object, 90 degrees on Y before fixing the pivot. If the bar is completely missing, then maybe it's inverted, often when debugging I'll use SET OBJECT CULL 1,0 - so it will draw polygons regardless of which way they are facing.

Health, Ammo, and bacon and eggs!
Mugen Wizardry
User Banned
Posted: 2nd Aug 2010 15:40
rotating the object makes it disappear

CHECK OUT SOME MUSIC FROM MY NEW TECHNO CD! TECHNOKINESIS
http://www.youtube.com/watch?v=4a8KedfgVv0
ALSO, CHECK OUT MY NEW TECHNO CD! http://www.imageposeidon.com/
Van B
Moderator
23
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 2nd Aug 2010 15:43
One alternative to setting the orientation, is to just point the object at the camera - maybe instead of SET OBJECT TO CAMERA...

POINT OBJECT 1,camera position x(),camera position y(),camera position z()

Soz I can't take a proper look, nowhere near a PC with DBPro right now.

Health, Ammo, and bacon and eggs!
Mugen Wizardry
User Banned
Posted: 2nd Aug 2010 15:44
nope.

still wont rotate

CHECK OUT SOME MUSIC FROM MY NEW TECHNO CD! TECHNOKINESIS
http://www.youtube.com/watch?v=4a8KedfgVv0
ALSO, CHECK OUT MY NEW TECHNO CD! http://www.imageposeidon.com/
HowDo
23
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 2nd Aug 2010 15:45 Edited at: 2nd Aug 2010 15:46
picture of camera looking at the object from back of object 2.



Dark Physics makes any hot drink go cold.
RedFlames
18
Years of Service
User Offline
Joined: 25th Aug 2007
Location: Germania
Posted: 2nd Aug 2010 15:45 Edited at: 2nd Aug 2010 15:46
Quote: "i cant get it to rotate with the object"


You can't have it rotate WITH the object AND always face the camera...
Take out the line "SET OBJECT TO CAMERA ORIENTATION 1" and it rotates with the object.
(it did for me using your latest code)
Mugen Wizardry
User Banned
Posted: 2nd Aug 2010 15:46 Edited at: 2nd Aug 2010 15:47
i just need to stop it from being pixely when rotating
and stop it from showing backwards
when behind an object

CHECK OUT SOME MUSIC FROM MY NEW TECHNO CD! TECHNOKINESIS
http://www.youtube.com/watch?v=4a8KedfgVv0
ALSO, CHECK OUT MY NEW TECHNO CD! http://www.imageposeidon.com/
HowDo
23
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 2nd Aug 2010 15:55 Edited at: 2nd Aug 2010 15:57
I changed

Make Object plain 1,1.25,.1

to

Make Object box 1,1.25,.1,.01

Is this what you require.

plus add a one to the end of get image like so:

GET IMAGE 1,0,0,100,10,1

Dark Physics makes any hot drink go cold.
Mugen Wizardry
User Banned
Posted: 2nd Aug 2010 15:58
close

except its still pixely

CHECK OUT SOME MUSIC FROM MY NEW TECHNO CD! TECHNOKINESIS
http://www.youtube.com/watch?v=4a8KedfgVv0
ALSO, CHECK OUT MY NEW TECHNO CD! http://www.imageposeidon.com/
HowDo
23
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 2nd Aug 2010 16:07
show Us what you mean,

How to this.

1. press Print Screen button to grab and image of the code running.
2. open paint(or psp) and then go to edit and click paste.
3. you should now have a picture of your screen when you pressed Print Screen.
4. tidy it up with crop.
5. save as a jpg.
6. up load it to your post.
7. open the picture with view.
8. copy the address.
9. edit post, and then paste the above address code, then highlight it, then click the image button.

you should now see your picture in that post, plus so can we to see whats wrong.

Dark Physics makes any hot drink go cold.
Mugen Wizardry
User Banned
Posted: 2nd Aug 2010 16:12
here

CHECK OUT SOME MUSIC FROM MY NEW TECHNO CD! TECHNOKINESIS
http://www.youtube.com/watch?v=4a8KedfgVv0
ALSO, CHECK OUT MY NEW TECHNO CD! http://www.imageposeidon.com/
HowDo
23
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 2nd Aug 2010 16:20
try adding this command before the do loop



Dark Physics makes any hot drink go cold.
Mugen Wizardry
User Banned
Posted: 2nd Aug 2010 16:32
still not smooth

CHECK OUT SOME MUSIC FROM MY NEW TECHNO CD! TECHNOKINESIS
http://www.youtube.com/watch?v=4a8KedfgVv0
ALSO, CHECK OUT MY NEW TECHNO CD! http://www.imageposeidon.com/
HowDo
23
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 2nd Aug 2010 16:35
what screen resolution are you using?

Dark Physics makes any hot drink go cold.
Mugen Wizardry
User Banned
Posted: 2nd Aug 2010 16:35
windowed mode

CHECK OUT SOME MUSIC FROM MY NEW TECHNO CD! TECHNOKINESIS
http://www.youtube.com/watch?v=4a8KedfgVv0
ALSO, CHECK OUT MY NEW TECHNO CD! http://www.imageposeidon.com/
HowDo
23
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 2nd Aug 2010 16:38 Edited at: 2nd Aug 2010 16:39
what resolution is the ide set to to use in window mode, look for this menu.



Dark Physics makes any hot drink go cold.
Mugen Wizardry
User Banned
Posted: 2nd Aug 2010 16:42
640x480

CHECK OUT SOME MUSIC FROM MY NEW TECHNO CD! TECHNOKINESIS
http://www.youtube.com/watch?v=4a8KedfgVv0
ALSO, CHECK OUT MY NEW TECHNO CD! http://www.imageposeidon.com/
HowDo
23
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 2nd Aug 2010 16:46
well you know I'm going to say make it higher, it should then remove the pixely.

give it a try! you can always put it back as it was.

Dark Physics makes any hot drink go cold.
Mugen Wizardry
User Banned
Posted: 2nd Aug 2010 16:55
didnt work...

CHECK OUT SOME MUSIC FROM MY NEW TECHNO CD! TECHNOKINESIS
http://www.youtube.com/watch?v=4a8KedfgVv0
ALSO, CHECK OUT MY NEW TECHNO CD! http://www.imageposeidon.com/
Mugen Wizardry
User Banned
Posted: 2nd Aug 2010 17:12
Not even SET ANTIALIAS LEVEL (GET MAXIMUM ANTIALIAS LEVEL())
worked..

I used styx

CHECK OUT SOME MUSIC FROM MY NEW TECHNO CD! TECHNOKINESIS
http://www.youtube.com/watch?v=4a8KedfgVv0
ALSO, CHECK OUT MY NEW TECHNO CD! http://www.imageposeidon.com/
Mugen Wizardry
User Banned
Posted: 2nd Aug 2010 17:19
could i use this?

and how would i use it?



CHECK OUT SOME MUSIC FROM MY NEW TECHNO CD! TECHNOKINESIS
http://www.youtube.com/watch?v=4a8KedfgVv0
ALSO, CHECK OUT MY NEW TECHNO CD! http://www.imageposeidon.com/
Van B
Moderator
23
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 2nd Aug 2010 17:33
SET OBJECT SMOOTHING, affects the normals of an object, not the edges.

You can enable Anti-aliasing, but that's not the answer either.

Why not use a sprite?

Take an objects position, add it's height to the Y coordinate and position a dummy object, then draw your health bar with sprites instead of 3D objects. It would work a bit like an RTS, where all the health bars are pixel perfect, because it's 2D. That's what most people would do in this case.

There is no need to go to those lengths for a simple health bar. I don't even know what you want, you want it to stop being jagged but you want it to rotate somehow. You can get 3D objects to billboard easy enough, and having the health bars rotate with the objects/characters/whatever is always gonna lead to jaggies.

Describe, draw a picture, but do something to show us what you want, give an example of a game that has it already. What you are trying to do should be simple. If you are actually trying to get these health bars to rotate along with their objects, then it'll look horrible, no matter what you do - you can't make a 2.5D thing then spin it and expect it to look good. DBPro is not great at smoothing out edges, so why even try smoothing them out? - why not rely on 2D, then the edges can be as smooth as you like.

Health, Ammo, and bacon and eggs!
Mugen Wizardry
User Banned
Posted: 2nd Aug 2010 17:58
because i want the image above my enemys head.

CHECK OUT SOME MUSIC FROM MY NEW TECHNO CD! TECHNOKINESIS
http://www.youtube.com/watch?v=4a8KedfgVv0
ALSO, CHECK OUT MY NEW TECHNO CD! http://www.imageposeidon.com/
Van B
Moderator
23
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 2nd Aug 2010 18:27
Like an RTS?

You could do that with sprites, using the OBJECT SCREEN X and Y commands, you can get the screen location of an object, or position a dummy object where you want, and get the screen position from that, as different models might have different heights.

But, to get the bar how you want it, try this code, all I did was remove the Y rotation, and left in the camera orientation. So now the bar stays orientated with the camera, doesn't slant or get jaggy.



Health, Ammo, and bacon and eggs!
Mugen Wizardry
User Banned
Posted: 2nd Aug 2010 18:31
yes. but its supposed to rotate with the monster, yet be blurred so its not jagged.

what if a monster rotates?

CHECK OUT SOME MUSIC FROM MY NEW TECHNO CD! TECHNOKINESIS
http://www.youtube.com/watch?v=4a8KedfgVv0
ALSO, CHECK OUT MY NEW TECHNO CD! http://www.imageposeidon.com/
Van B
Moderator
23
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 2nd Aug 2010 18:55
If a monster rotates, then the bar stays where it is, billboarded to the camera. Without this, the bar would turn along with the monster, so if it's at 90 degrees to the player, the player can't tell what it's health is.

Health, Ammo, and bacon and eggs!
Mugen Wizardry
User Banned
Posted: 2nd Aug 2010 18:58
alright.

how do i add the text above the healthbar?

to show

100/100

CHECK OUT SOME MUSIC FROM MY NEW TECHNO CD! TECHNOKINESIS
http://www.youtube.com/watch?v=4a8KedfgVv0
ALSO, CHECK OUT MY NEW TECHNO CD! http://www.imageposeidon.com/
Van B
Moderator
23
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 2nd Aug 2010 19:23
You could just get the bar draw function to do that...



Health, Ammo, and bacon and eggs!
Mugen Wizardry
User Banned
Posted: 2nd Aug 2010 19:29
thanks vanb.

ok 2 more questions.

1. the text isnt in the middle of the bar.

2. i changed everything to types, why is my bar in the wrong position?



thanks!

CHECK OUT SOME MUSIC FROM MY NEW TECHNO CD! TECHNOKINESIS
http://www.youtube.com/watch?v=4a8KedfgVv0
ALSO, CHECK OUT MY NEW TECHNO CD! http://www.imageposeidon.com/
Mugen Wizardry
User Banned
Posted: 2nd Aug 2010 19:39 Edited at: 2nd Aug 2010 19:42
Ok, now its saying object already exists..

there should be

p.id = 1 (player)

e.id = 2 (enemy)

p.id+1 = 3 (player healthbar)

e.id+1 = 4 (enemy healthbar)



CHECK OUT SOME MUSIC FROM MY NEW TECHNO CD! TECHNOKINESIS
http://www.youtube.com/watch?v=4a8KedfgVv0
ALSO, CHECK OUT MY NEW TECHNO CD! http://www.imageposeidon.com/
HowDo
23
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 2nd Aug 2010 20:02 Edited at: 2nd Aug 2010 20:05
snap! I did almost the same but add something to check if the bit map was already made.

here what I've done text and bar are displayed on a box object that rotates.

see what you think


EDIT
I see you gone a bit further than when I last looked.

Dark Physics makes any hot drink go cold.
Mugen Wizardry
User Banned
Posted: 2nd Aug 2010 20:07
its a bit messed up

CHECK OUT SOME MUSIC FROM MY NEW TECHNO CD! TECHNOKINESIS
http://www.youtube.com/watch?v=4a8KedfgVv0
ALSO, CHECK OUT MY NEW TECHNO CD! http://www.imageposeidon.com/
HowDo
23
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 2nd Aug 2010 20:09
when you started you have this
p.id=1
e.id=2

then you did this

p.id+1=2
e.id+2=4

Dark Physics makes any hot drink go cold.
Mugen Wizardry
User Banned
Posted: 2nd Aug 2010 20:14
still a bit confused..



CHECK OUT SOME MUSIC FROM MY NEW TECHNO CD! TECHNOKINESIS
http://www.youtube.com/watch?v=4a8KedfgVv0
ALSO, CHECK OUT MY NEW TECHNO CD! http://www.imageposeidon.com/
Van B
Moderator
23
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 2nd Aug 2010 20:20


Fiddled with lots of things too...

Health, Ammo, and bacon and eggs!
Mugen Wizardry
User Banned
Posted: 2nd Aug 2010 20:24 Edited at: 2nd Aug 2010 20:27
it's still acting a bit weird.

i was gonna turn the camera into the player.

i SORTA fixed the text position

text width/4+text width(str$(int(P#)))/2,0,str$(int(P#))+"/100"

CHECK OUT SOME MUSIC FROM MY NEW TECHNO CD! TECHNOKINESIS
http://www.youtube.com/watch?v=4a8KedfgVv0
ALSO, CHECK OUT MY NEW TECHNO CD! http://www.imageposeidon.com/
Mugen Wizardry
User Banned
Posted: 2nd Aug 2010 20:31 Edited at: 2nd Aug 2010 20:34
fixed the text.

center text width/2,0,str$(int(P#))+"/100"

also its blurring the text.
and it says 1/100

not 100/100

CHECK OUT SOME MUSIC FROM MY NEW TECHNO CD! TECHNOKINESIS
http://www.youtube.com/watch?v=4a8KedfgVv0
ALSO, CHECK OUT MY NEW TECHNO CD! http://www.imageposeidon.com/
HowDo
23
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 2nd Aug 2010 20:39
add a one onto the end of this line

GET IMAGE id,0,0,100,10
becomes
GET IMAGE id,0,0,100,10,1

Dark Physics makes any hot drink go cold.

Login to post a reply

Server time is: 2026-07-26 00:41:16
Your offset time is: 2026-07-26 00:41:16