Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
1 registered members (TipmyPip), 18,513 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 2 of 2 1 2
Re: Can't seem to get this work [Re: Crypton] #234037
10/31/08 18:35
10/31/08 18:35
Joined: Oct 2008
Posts: 67
C
Crypton Offline OP
Junior Member
Crypton  Offline OP
Junior Member
C

Joined: Oct 2008
Posts: 67
I still haven't solved the problem.
Anyone can tell me how to fix this?

-------------
It seems I can't make any calculatons inside a script at all :S. I get syntax error... In any other language I was able to calculate inside (command's/function's whatever) arguments.
f.i : draw_health(30,30,(85*health)/100)
But trying to do it in Lite-C throws an error...

Last edited by Crypton; 10/31/08 19:37.

New into Gamestudio and eager to learn it..
Stuff and games done in 2D: LINK
Re: Can't seem to get this work [Re: Crypton] #234575
11/03/08 17:21
11/03/08 17:21
Joined: Sep 2005
Posts: 274
Switzerland - Zurich
zwecklos Offline
Member
zwecklos  Offline
Member

Joined: Sep 2005
Posts: 274
Switzerland - Zurich
Hi Crypton,
Sorry for the late reply.
Had no internet connection durring the weekend
(shake fist @provider).

I wrote a little code snipet with:

hbar(0, 0, 200,.....
(its somemthing like this, sry I have to access to my workstation here)

Its kinda old, and its not in the manual but it is exactly what you were looking for.
I tested it also with decimals and it works very well.

As soon as I have my internet connection up and running I can post a little code snippet.
You can try to find the hbar / vbar instrunctions, I couldnt find it in the manual. Ive found it in an old project where I had a healthbar.

maybe soemeone else knows the exact syntax of hbar/vbar.

cheers

Re: Can't seem to get this work [Re: zwecklos] #234577
11/03/08 17:28
11/03/08 17:28
Joined: Apr 2006
Posts: 624
DEEP 13
badapple Offline
User
badapple  Offline
User

Joined: Apr 2006
Posts: 624
DEEP 13
hbar/vbar is now window

Re: Can't seem to get this work [Re: badapple] #234602
11/03/08 20:30
11/03/08 20:30
Joined: Oct 2008
Posts: 67
C
Crypton Offline OP
Junior Member
Crypton  Offline OP
Junior Member
C

Joined: Oct 2008
Posts: 67
Thanks for the reply! Really need those..

Anyways yes, hbar and vbar seem to be ld definitions. From Manual under "Obsolete Syntax":

PANEL.hbar, PANEL.vbar panel.window A6

But any idea how to achieve my request? I can't think of anything right now to solve this. Any previous experience with programming doesn't seem to work here :P.


New into Gamestudio and eager to learn it..
Stuff and games done in 2D: LINK
Re: Can't seem to get this work [Re: Crypton] #234733
11/04/08 13:31
11/04/08 13:31
Joined: Sep 2005
Posts: 274
Switzerland - Zurich
zwecklos Offline
Member
zwecklos  Offline
Member

Joined: Sep 2005
Posts: 274
Switzerland - Zurich
Hi Crypton,
I tried it again with window and I didnt get it to work.
as you mentioned, window doesnt accept variables or decimals.

Maybe this code will help you.

Code:
BMAP* balken_attribut = "attribut.pcx";//pcx with 100x20
var willenskraft = 100;

PANEL* will_pan =
{
	pos_x = 0;
	pos_y = 0;
	hbar = 0, 0, 200, balken_attribut, 2, willenskraft;
	flags = VISIBLE;
}

function reduce_hp()
{
willenskraft -= 0.987;
}

function main()
{
...
..
.
on_t = reduce_hp;
}


This code is tested and should work like a comon healthbar.
Im also interested in knowing how to make a healthbar with window laugh
I will test some more but it seems that it wont work with window.
Anyway, I hope you can use the vbar code.

cheers

Re: Can't seem to get this work [Re: zwecklos] #234767
11/04/08 16:59
11/04/08 16:59
Joined: Oct 2008
Posts: 67
C
Crypton Offline OP
Junior Member
Crypton  Offline OP
Junior Member
C

Joined: Oct 2008
Posts: 67
I can compile it but it doesn't work for me.
Anyways who the hell made a function that can't take variables or demicals in its arguments laugh.

But said that, I thought to look around in the forum and see if anyone else had that problem and how they got it solved. What I saw was that they create a bitmap that has a full part and an empty part. So when the health decreases the bitmap is being moved from full part to empty part.

Basically the topic here:
Healthbar thingy

It seems there is no actual way to cut the sprite? :S. Would be better just to keep the bitmap sizes under control...

Last edited by Crypton; 11/04/08 19:32. Reason: Typo

New into Gamestudio and eager to learn it..
Stuff and games done in 2D: LINK
Re: Can't seem to get this work [Re: Crypton] #234787
11/04/08 18:54
11/04/08 18:54
Joined: Apr 2006
Posts: 624
DEEP 13
badapple Offline
User
badapple  Offline
User

Joined: Apr 2006
Posts: 624
DEEP 13
ive created a working health bar demo useing hbar for you
you can get it at the free lite c section of my site

mysite

Re: Can't seem to get this work [Re: badapple] #234813
11/04/08 20:53
11/04/08 20:53
Joined: Sep 2005
Posts: 274
Switzerland - Zurich
zwecklos Offline
Member
zwecklos  Offline
Member

Joined: Sep 2005
Posts: 274
Switzerland - Zurich
Quote:

I can compile it but it doesn't work for me.


Why does it not work for you?
use "t" to decrease the willenskraft variable and you will see that the bar will become shorter. I set it on "t" just that you can see that the bar is working (also with decimals).

Of course for a real healthbar you need a damage system and code that defines when the variable should be decreased laugh

cheerio

Re: Can't seem to get this work [Re: zwecklos] #235012
11/05/08 15:22
11/05/08 15:22
Joined: Oct 2008
Posts: 67
C
Crypton Offline OP
Junior Member
Crypton  Offline OP
Junior Member
C

Joined: Oct 2008
Posts: 67
Quick reply:
Well it didn't, dunno why. I pressed the "t" button but nothing happened... In badapple's example there was a little difference in the function and that worked btw.

If I have more time I can analyze more of that. I have A7, trial for now, and it's a pity that window can't do the same what hbar or vbar can do (They aren't included in the manual)

Last edited by Crypton; 11/05/08 15:23. Reason: Typo

New into Gamestudio and eager to learn it..
Stuff and games done in 2D: LINK
Page 2 of 2 1 2

Gamestudio download | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1