Gamestudio Links
Zorro Links
Newest Posts
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (AndrewAMD), 1,268 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 2 of 2 1 2
Re: Digits() error [Re: Knuckles] #146850
08/09/07 22:37
08/09/07 22:37
Joined: Mar 2006
Posts: 752
Portugal
demiGod Offline
User
demiGod  Offline
User

Joined: Mar 2006
Posts: 752
Portugal
Please, just do it like i told you, it works, ok ?

Code:

var HP = 0;
var SP = 1;
var playerstats[2];
var playerstats_level_01[2] = 40, 20;

// in function main put this:
playerstats[HP] = playerstats_level_01[HP];
playerstats[SP] = playerstats_level_01[SP];

// and now the panel
panel player_stats_window
{
layer = 1;
bmap = stats_bg;
pos_x = 15;
pos_y = 500;
digits(150,55,"PlayerStats: %.3f",*,1,playerstats[1]);
flags = refresh,d3d,visible;
}



Re: Digits() error [Re: demiGod] #146851
08/10/07 00:03
08/10/07 00:03
Joined: Jul 2006
Posts: 91
Florida, USA
Knuckles Offline OP
Junior Member
Knuckles  Offline OP
Junior Member

Joined: Jul 2006
Posts: 91
Florida, USA


Re: Digits() error [Re: Knuckles] #146852
08/10/07 04:36
08/10/07 04:36
Joined: Jul 2006
Posts: 91
Florida, USA
Knuckles Offline OP
Junior Member
Knuckles  Offline OP
Junior Member

Joined: Jul 2006
Posts: 91
Florida, USA
okay, now it's getting even weirder...

I've been at this for hours now trying to figure it out. I deleted the playerstats[1] in the digits() function and replaced it with 'asdf' and the program ran! but there was just a zero there. The weird thing is that I did not define anything named 'asdf' anywhere in my program yet it still ran!

Code:
digits(30,30,"HP  %.0f",standard_font,1,asdf);



That's what I put and the program ran without me even having to define 'asdf.' Is this a bug or something? how is it that I don't get errors with something undefined, yet, I get errors with the playerstats[1] array?

Re: Digits() error [Re: Knuckles] #146853
08/10/07 11:27
08/10/07 11:27
Joined: Mar 2006
Posts: 752
Portugal
demiGod Offline
User
demiGod  Offline
User

Joined: Mar 2006
Posts: 752
Portugal
You are doing something wrong man, i tested the code and it works.

Dont forget to put:

playerstats[HP] = playerstats_level_01[HP];
playerstats[SP] = playerstats_level_01[SP];

in a function, like main for instance.

In your first code you had those instructions outside of function, if you know what i mean..

Hope it helps

Re: Digits() error [Re: demiGod] #146854
08/11/07 03:42
08/11/07 03:42
Joined: Jul 2006
Posts: 91
Florida, USA
Knuckles Offline OP
Junior Member
Knuckles  Offline OP
Junior Member

Joined: Jul 2006
Posts: 91
Florida, USA
Thank you! It wasn't in a function. What I had to do was to make a separate function called player_stats() and put all those declarations in there then call the function in the main() function. It's wokring now. Thanks so much!

Page 2 of 2 1 2

Gamestudio download | chip programmers | 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