Gamestudio Links
Zorro Links
Newest Posts
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
M1 Oversampling
by 11honza11. 04/30/24 08:16
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (AndrewAMD), 1,135 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 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 | 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