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
3 registered members (Quad, VoroneTZ, Nymphodora), 8,449 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
PANEL SHOW Flag makes Engine crash ._.? #398710
04/05/12 13:58
04/05/12 13:58
Joined: Mar 2008
Posts: 2,247
Baden Württemberg, Germany
Espér Offline OP
Expert
Espér  Offline OP
Expert

Joined: Mar 2008
Posts: 2,247
Baden Württemberg, Germany
hi there..

i´ve written this codes:
Code:
PANEL* pan_objectlist =
{
	pos_y  = 61;
	pos_x  = 0;
	layer  = 90;
	bmap   = bm_listbutt_0;
	size_y = 1920;
	flags = SHOW;
}


void create_listbuttons(var typus)
{
	var izahl, igoalzahl;
	igoalzahl = 1001;
	if(typus == 1)
	{
		for(izahl=0; izahl<igoalzahl; izahl++)
		{
			pan_setdigits(pan_objectlist, 0,    -400, izahl*bmap_height(bm_listbutt_on), "%s", arialing, 1, "leer");
			pan_setbutton(pan_objectlist, 0, 0, -400, izahl*bmap_height(bm_listbutt_on), bm_listbutt_on, bm_listbutt_off, bm_listbutt_over, bm_listbutt_off, NULL, NULL, NULL);
			wait(1);
		}
	}
	else
	{
		for(izahl=0; izahl<igoalzahl; izahl++)
		{
			pan_setdigits(pan_objectlist, izahl,    -400, izahl*bmap_height(bm_listbutt_on), "%s", arialing, 1, "leer");
			pan_setbutton(pan_objectlist, izahl, 0, -400, izahl*bmap_height(bm_listbutt_on), bm_listbutt_on, bm_listbutt_off, bm_listbutt_over, bm_listbutt_off, NULL, NULL, NULL);
			wait(1);
		}
	}
}


void addto_objectlist(var objektnummer)
{
	pan_setdigits(pan_objectlist, objektnummer,    0, objektnummer*bmap_height(bm_listbutt_on), "%s", arialing, 1, (objektnamen.pstring)[objektnummer]);
	pan_setbutton(pan_objectlist, objektnummer, 0, 0, objektnummer*bmap_height(bm_listbutt_on), bm_listbutt_on, bm_listbutt_off, bm_listbutt_over, bm_listbutt_off, NULL, NULL, NULL);
	wait(1);
}



the panel bitmap has a height of 20, and a width of 200. So it should be repeated with a y size of 1920.
The first function creates the buttons or resets them (see variable switch).

The second fucntion makes a panel visible and enables mouseclick for the user, by pushing its pos_x to 0.

What i do is:
on startup (after 2 frames waiting after level_load):
Code:
create_listbuttons(1); //initialize the buttons and digits



on object_loading (reaout folder and make a list):
Code:
//reset buttons to X = -400, to hide them all.
create_listbuttons(0);
	wait_for(create_listbuttons);


The object_loader is called just once, when changing the category.

and for when an object is listed:
Code:
addto_objectlist(entitycounter);




if you need the object loader too:
Click to reveal..

Code:
void load_files()
{
	//reset buttons to X = -400, to hide them all.
	create_listbuttons(0);
	wait_for(create_listbuttons);
	
	var ilt, objectcount, fhandle, entitycounter;
	entitycounter = 0;
	for(ilt=0; ilt<4000; ilt++)
	{
		str_cpy((ordnerinhalt.pstring)[ilt], "");
		str_cpy((objekteigenschaften.pstring)[ilt], "");
		str_cpy((objektnamen.pstring)[ilt], "");
	}
	txt_for_dir(ordnerinhalt, "Models\\Map\\*.mdl");
	for(ilt=0; ilt<4000; ilt++)
	{
		if((ordnerinhalt.pstring)[ilt] != NULL)
		{
			if(str_stri((ordnerinhalt.pstring)[ilt], ".mdl") && str_stri((ordnerinhalt.pstring)[ilt], themenname))
			{
				objectlist[entitycounter] = ent_create(NULL, vector(-9000,-9000,-9000), NULL);
				objectlist[entitycounter].string1 = str_create((ordnerinhalt.pstring)[ilt]);
				str_cpy((objektnamen.pstring)[entitycounter], objectlist[entitycounter].string1);
				str_trunc((ordnerinhalt.pstring)[ilt], 3);
				str_cat((ordnerinhalt.pstring)[ilt], "nymph");
				
				if(file_exists((ordnerinhalt.pstring)[ilt]))
				{
					objectlist[entitycounter].string2 = str_create((ordnerinhalt.pstring)[ilt]);
					fhandle = file_open_read((ordnerinhalt.pstring)[ilt]);
					file_close(fhandle);
				}
				else
				{
					objectlist[entitycounter].string2 = str_create("NoSetup");
				}
				
				//Add object to the button list
				addto_objectlist(entitycounter);
				wait(1);
				entitycounter += 1;
				auswahlobjekte = ilt+1;
			}
		}
	}
}





My problem now:

When i use:
Code:
PANEL* pan_objectlist =
{
	pos_y  = 61;
	pos_x  = 0;
	layer  = 90;
	bmap   = bm_listbutt_0;
	size_y = 1920;
	flags = SHOW;
}


Engine crashes with "Acknex is not working" windows message
When i hide the "flags = SHOW;" in a comment like "//flags = SHOW;", it works ._.

Wheres the problem? Did i make something wrong in the Panel definition?

Last edited by Espér; 04/05/12 13:59.

Selling my Acknex Engine Editions (A7 Com & A8 Pro):
>> click here if you are interested <<
Re: PANEL SHOW Flag makes Engine crash ._.? [Re: Espér] #398843
04/07/12 16:50
04/07/12 16:50
Joined: Mar 2008
Posts: 2,247
Baden Württemberg, Germany
Espér Offline OP
Expert
Espér  Offline OP
Expert

Joined: Mar 2008
Posts: 2,247
Baden Württemberg, Germany
i've still no clue whats wrong
i tried to comment out line by line of my code, and it's still the same..
setting the SHOW flag makes the engine crash ._.


Selling my Acknex Engine Editions (A7 Com & A8 Pro):
>> click here if you are interested <<
Re: PANEL SHOW Flag makes Engine crash ._.? [Re: Espér] #398848
04/07/12 17:26
04/07/12 17:26
Joined: Oct 2011
Posts: 1,082
Germany
C
Ch40zzC0d3r Offline
Serious User
Ch40zzC0d3r  Offline
Serious User
C

Joined: Oct 2011
Posts: 1,082
Germany
Is the size 1920 usable?
Is the bm_listbutt_0 (type like .bmp) supported?

Re: PANEL SHOW Flag makes Engine crash ._.? [Re: Ch40zzC0d3r] #398858
04/07/12 20:37
04/07/12 20:37
Joined: Mar 2008
Posts: 2,247
Baden Württemberg, Germany
Espér Offline OP
Expert
Espér  Offline OP
Expert

Joined: Mar 2008
Posts: 2,247
Baden Württemberg, Germany
the sizy_y will be the same as screen_size.y, 1920 is just for testing.
Yes, the PNG Format is supported. it works with other burtons and bitmaps.. ._.


Selling my Acknex Engine Editions (A7 Com & A8 Pro):
>> click here if you are interested <<
Re: PANEL SHOW Flag makes Engine crash ._.? [Re: Espér] #398937
04/09/12 00:02
04/09/12 00:02
Joined: Jun 2004
Posts: 2,234
Wisconsin USA
FoxHound Offline
Expert
FoxHound  Offline
Expert

Joined: Jun 2004
Posts: 2,234
Wisconsin USA
Size_x and Size_y will be set by the system so no need to put that in unless you are using Windows with no bmaps in the panel itself. PNGs are very happy in panels, I use them all the time.

When normal things don't fix your problems try abnormal things. Delete teh panel and make another panel with a different name but same bmap. If it still doesn't work try a different bmap but same size. Now if it doesn't work try altering the first bmap. If that doesn't work then it is something unrelated but only seems to be the panel. A problem I have had before especially when projects get huge.


---------------------
There is no signature here.


QUIT LOOKING FOR ONE!
Re: PANEL SHOW Flag makes Engine crash ._.? [Re: FoxHound] #398947
04/09/12 08:43
04/09/12 08:43
Joined: Mar 2008
Posts: 2,247
Baden Württemberg, Germany
Espér Offline OP
Expert
Espér  Offline OP
Expert

Joined: Mar 2008
Posts: 2,247
Baden Württemberg, Germany
i set size_x, cause i
want the Panel bitmap to be a pattern background image (see Manual laugh )

i'll try the abnormals


Selling my Acknex Engine Editions (A7 Com & A8 Pro):
>> click here if you are interested <<
Re: Erase Panel Content? [Re: Espér] #399106
04/11/12 13:00
04/11/12 13:00
Joined: Mar 2008
Posts: 2,247
Baden Württemberg, Germany
Espér Offline OP
Expert
Espér  Offline OP
Expert

Joined: Mar 2008
Posts: 2,247
Baden Württemberg, Germany
Okay.. i´ll rewrite the whole thing..
But stuck in another problem..

I can create a Panel with Panel, and with pan_setbutton, i can create the buttons..

Question:
Is there a way to erase those buttons when RELOADING the files?
I don´t want to erase the models, stats..etc with level_load..
Just the buttons i created with pan_setbutton...
(f.e. pan_erasebutton(PANEL*, number);)

I surely could make pan_setbutton and switch all buttons invisible.. but i need the Button-IDs again when loading the new Models... and writing a second code in an if-condition is senseless ._.

Last edited by Espér; 04/11/12 13:00.

Selling my Acknex Engine Editions (A7 Com & A8 Pro):
>> click here if you are interested <<
Re: Erase Panel Content? [Re: Espér] #399121
04/11/12 14:13
04/11/12 14:13
Joined: Jun 2004
Posts: 2,234
Wisconsin USA
FoxHound Offline
Expert
FoxHound  Offline
Expert

Joined: Jun 2004
Posts: 2,234
Wisconsin USA
panel = pan_create("blah blah blah,1);

will rewrite the panel. Or placing

panel = NULL;

Will make it nothing and allow you to rewrite the whole panel.

Using pan_setbutton you can rewrite each button anyway you like. I can not think of a way to remove buttons other than to give them an invisible button with no function so it might as well be nothing.


However if you wanted to tile the panel in the first place that could be the problem (I have never tried it so I don't know). A good way to tile an image is to use "window" and set the panel size to way bigger than the image is. I do it all the time in my game, usually by accident, and the game is just fine with it.

Last edited by FoxHound; 04/11/12 14:15.

---------------------
There is no signature here.


QUIT LOOKING FOR ONE!

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

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