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
2 registered members (AndrewAMD, dr_panther), 1,290 guests, and 4 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 1 of 2 1 2
Digits() error #146840
08/08/07 21:46
08/08/07 21:46
Joined: Jul 2006
Posts: 91
Florida, USA
Knuckles Offline OP
Junior Member
Knuckles  Offline OP
Junior Member

Joined: Jul 2006
Posts: 91
Florida, USA
What am I doing wrong here? I'm trying to display a player's HP and SP on the screen using digits():

Code:
var HP = 0;
var SP = 1;

var playerstats[2];
var playerstats_level_01[2] = 40, 20;

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


panel player_stats_window
{
layer = 1;
bmap = stats_bg;
pos_x = 15;
pos_y = 500;
digits = 150,55,1,standard_font,1,playerstats[1];
flags = refresh,d3d;

}



string player_stats_string = "HP \n\nSP \n";

text player_stats_text
{
layer = 2;
pos_x = 75;
pos_y = 550;
font = standard_font;
strings = 1;
string = player_stats_string;
}

player_stats_window.visible = on;
player_stats_text.visible = on;




When I try to run the program I get an error that says there's "Too many parameters" for the line that has: digits = 120,48,1,standard_font,1,playerstats[1]; The arrow is pointing to the [1] in playerstats. I'm not sure why...

Last edited by Knuckles; 08/09/07 02:03.
Re: Digits() error [Re: Knuckles] #146841
08/09/07 01:11
08/09/07 01:11
Joined: Sep 2002
Posts: 700
Orange County, CA
L
LogantheHogan Offline
Developer
LogantheHogan  Offline
Developer
L

Joined: Sep 2002
Posts: 700
Orange County, CA
Hmm... I don't see anything about digits in the code you posted. Maybe you left that part of the code out? Where are you defining the digits, anyway? Inside the player_stats_window definition? Because they're not there... ?

Re: Digits() error [Re: LogantheHogan] #146842
08/09/07 01:39
08/09/07 01:39
Joined: Jul 2006
Posts: 91
Florida, USA
Knuckles Offline OP
Junior Member
Knuckles  Offline OP
Junior Member

Joined: Jul 2006
Posts: 91
Florida, USA
player_stats_window is just the background image in which the text is written on

Re: Digits() error [Re: Knuckles] #146843
08/09/07 02:05
08/09/07 02:05
Joined: Sep 2002
Posts: 700
Orange County, CA
L
LogantheHogan Offline
Developer
LogantheHogan  Offline
Developer
L

Joined: Sep 2002
Posts: 700
Orange County, CA
Well, then, where are your digits definitions? The digits definitions should be inside the panel definition that they are attached to. Are you defining the digits inside a panel at all?

Re: Digits() error [Re: LogantheHogan] #146844
08/09/07 02:33
08/09/07 02:33
Joined: Jul 2006
Posts: 91
Florida, USA
Knuckles Offline OP
Junior Member
Knuckles  Offline OP
Junior Member

Joined: Jul 2006
Posts: 91
Florida, USA
Yes I did... sorry I edited the post above, it got deleted out for some reason. The digits() is in the player_stats_window panel

Re: Digits() error [Re: Knuckles] #146845
08/09/07 04:26
08/09/07 04:26
Joined: Sep 2002
Posts: 700
Orange County, CA
L
LogantheHogan Offline
Developer
LogantheHogan  Offline
Developer
L

Joined: Sep 2002
Posts: 700
Orange County, CA
Hmm. My only thought would be to reorganize the digits definition into proper syntax, i.e. digits(120,48,1,standard_font,1,playerstats[1]);. Let me know if that works, if not tell me and I'll switch my brain to high powered debugging mode and take another look.

also, you don't have to display a separate text as well as the panel. Look in the manual for info on how to display text inside a digits element.

Re: Digits() error [Re: LogantheHogan] #146846
08/09/07 04:50
08/09/07 04:50
Joined: Jul 2006
Posts: 91
Florida, USA
Knuckles Offline OP
Junior Member
Knuckles  Offline OP
Junior Member

Joined: Jul 2006
Posts: 91
Florida, USA
using parentheses in the digits() didn't work. I still get the same error. If I take the [1] off of playerstats, then the program works fine. But why can't I use the brackets? It keeps saying too many parameters. But I want it to get data from the playerstats[] array. Is there another way I will need to do this rather than use digits() ?

Re: Digits() error [Re: Knuckles] #146847
08/09/07 05:03
08/09/07 05:03
Joined: Sep 2002
Posts: 700
Orange County, CA
L
LogantheHogan Offline
Developer
LogantheHogan  Offline
Developer
L

Joined: Sep 2002
Posts: 700
Orange County, CA
According to the manual, under "Digits":

"Only var variables can be displayed (no int, float, or other types of variables). The var can be part of a struct or of an array, but not of a multidimensional array. "

So, your code should work. And it doesn't. You may have discovered a bug? Try the Ask Conitec or Bug Hunt forum, I guess.

Re: Digits() error [Re: LogantheHogan] #146848
08/09/07 08:41
08/09/07 08:41
Joined: Mar 2006
Posts: 752
Portugal
demiGod Offline
User
demiGod  Offline
User

Joined: Mar 2006
Posts: 752
Portugal
There is no bug.

Try this:

digits(150,55,"PlayerStats: %.3f",*,1,playerstats[1]);

Re: Digits() error [Re: demiGod] #146849
08/09/07 21:58
08/09/07 21:58
Joined: Jul 2006
Posts: 91
Florida, USA
Knuckles Offline OP
Junior Member
Knuckles  Offline OP
Junior Member

Joined: Jul 2006
Posts: 91
Florida, USA
It's still saying 'too many parameters' and pointing to the '1' in [1]

Last edited by Knuckles; 08/09/07 22:00.
Page 1 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