Gamestudio Links
Zorro Links
Newest Posts
Help!
by VoroneTZ. 10/14/25 05:04
Zorro 2.70
by jcl. 10/13/25 09:01
ZorroGPT
by TipmyPip. 10/12/25 13:58
Sam Foster Sound | Experienced Game Composer for Hire
by titanicpiano14. 10/11/25 18:45
Reality Check results on my strategy
by dBc. 10/11/25 06:15
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
2 registered members (Grant, TipmyPip), 8,133 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
joenxxx, Jota, krishna, DrissB, James168
19170 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Var of struct array & Panel? #417630
02/14/13 19:25
02/14/13 19:25
Joined: Nov 2005
Posts: 204
Bavaria
HellThunder Offline OP
Member
HellThunder  Offline OP
Member

Joined: Nov 2005
Posts: 204
Bavaria
Is there a possibility to show a variable of a struct array with a panel?



Code:
typedef struct {
	STRING* name;
	STRING* info;
	var price;
	var hp_Effect;
	var mp_Effect;
	var amount;
	bool andiote;
	bool awakemaker;
	bool antisilent;
	bool eyedrop; 
	bool lifemaker;
	bool partyitem;
} object;

........

//Global declaration of item_001
object* item_001={
	name 		= "Heiltrank";
	info		= "Heilt 50 Lebenspunkte eines Partymitglieds.";
	price 		= 20;
	hp_Effect 	= 50;
	mp_Effect 	= 0;
	amount 		= 3;
	andiote 	= FALSE;
	awakemaker	= FALSE;
	desilent 	= FALSE;
	eyedrop		= FALSE;
	lifemaker 	= FALSE;
	partyitem 	= FALSE;	
	
}
............

object** objectID = (object*)malloc(999*sizeof(object));

objectID[1] = item_001;			///Array index starts intentionally with 1.


PANEL* ID_PanelTest =
{
pos_x = 50;  
pos_y = 70;
layer = 43; 
digits = (310, 55, "%02.0f", "Arial#22", 1, objectID[1].amount); <---- CompileError - 'TOO MANY PARAMETERS'
flags = SHOW;
}




The manual says array and structures are allowed.

Regards,
HellThunder


Create your own JRPG and join our community: https://www.yrpgtoolkit.com
Re: Var of struct array & Panel? [Re: HellThunder] #417635
02/14/13 20:10
02/14/13 20:10
Joined: Mar 2011
Posts: 3,150
Budapest
sivan Offline
Expert
sivan  Offline
Expert

Joined: Mar 2011
Posts: 3,150
Budapest
I had the same problem, finally used a global var pointer in these cases, but maybe there is something more straightforward.


Free world editor for 3D Gamestudio: MapBuilder Editor

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