Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
2 registered members (AndrewAMD, TipmyPip), 12,400 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 2 of 3 1 2 3
Re: Is it possible to change panel BMAP? [Re: tolu619] #441960
06/07/14 13:33
06/07/14 13:33
Joined: Apr 2005
Posts: 1,988
Canadian, Eh
DLively Offline
Serious User
DLively  Offline
Serious User

Joined: Apr 2005
Posts: 1,988
Canadian, Eh
Maybe try a pseudo bmap first... Thats all I can think of with the given information.

PANEL* PlayerOnePan =
{
bmap = temp_map;
pos_x = 20;
pos_y = 100;
layer = 8;
flags |= OVERLAY;
}


A8 Pro 8.45.4
YouTube: Create Games For Free
Free Resources: www.CGForFree.com
Re: Is it possible to change panel BMAP? [Re: tolu619] #441961
06/07/14 13:40
06/07/14 13:40
Joined: Jun 2009
Posts: 2,210
Bavaria, Germany
Kartoffel Offline
Expert
Kartoffel  Offline
Expert

Joined: Jun 2009
Posts: 2,210
Bavaria, Germany
1. remove the '|' at flags |= OVERLAY;
2. try another image format


POTATO-MAN saves the day! - Random
Re: Is it possible to change panel BMAP? [Re: Kartoffel] #441962
06/07/14 14:14
06/07/14 14:14
Joined: Jun 2014
Posts: 97
Lagos, Nigeria
T
tolu619 Offline
Junior Member
tolu619  Offline
Junior Member
T

Joined: Jun 2014
Posts: 97
Lagos, Nigeria
Thanks, I didn't notice the "|" I accidentally put after the flag. I've corrected the panel definition as shown below but it still doesn't work.
Code:
PANEL* PlayerOnePan =
{
	bmap = TempBMAP; 
	pos_x = 20;
	pos_y = 100;
	layer = 8;
	flags = OVERLAY;
}


Re: Is it possible to change panel BMAP? [Re: tolu619] #441965
06/07/14 15:14
06/07/14 15:14
Joined: Apr 2005
Posts: 1,988
Canadian, Eh
DLively Offline
Serious User
DLively  Offline
Serious User

Joined: Apr 2005
Posts: 1,988
Canadian, Eh
make sure that tempBMAP exists and is defined laugh


A8 Pro 8.45.4
YouTube: Create Games For Free
Free Resources: www.CGForFree.com
Re: Is it possible to change panel BMAP? [Re: DLively] #441968
06/07/14 15:23
06/07/14 15:23
Joined: Jun 2014
Posts: 97
Lagos, Nigeria
T
tolu619 Offline
Junior Member
tolu619  Offline
Junior Member
T

Joined: Jun 2014
Posts: 97
Lagos, Nigeria
Originally Posted By: DLively
make sure that tempBMAP exists and is defined laugh


I did that; Still not working. Can I get some sample code for changing the bmap of a panel at runtime?

Re: Is it possible to change panel BMAP? [Re: tolu619] #441969
06/07/14 16:19
06/07/14 16:19
Joined: Apr 2005
Posts: 1,988
Canadian, Eh
DLively Offline
Serious User
DLively  Offline
Serious User

Joined: Apr 2005
Posts: 1,988
Canadian, Eh
panel.bmap = bmap;

You have it - I don't think thats your issue..
can I see the whole function if its not to giving away to much code?


A8 Pro 8.45.4
YouTube: Create Games For Free
Free Resources: www.CGForFree.com
Re: Is it possible to change panel BMAP? [Re: DLively] #441970
06/07/14 16:25
06/07/14 16:25
Joined: Jun 2014
Posts: 97
Lagos, Nigeria
T
tolu619 Offline
Junior Member
tolu619  Offline
Junior Member
T

Joined: Jun 2014
Posts: 97
Lagos, Nigeria
Code:
//bmap definition
BMAP* GoshawkChosen = "GoshawkCharacterChosen.bmp";

//Panel definition
PANEL* PlayerOnePan =
{
	bmap = TempBmap;
	pos_x = 20;
	pos_y = 100;
	layer = 8;
	flags = OVERLAY;
}

//last line of this function is the relevant code
function ChooseGoshawk()
{
	ChosenMonIndex = 1;
	ChosenMonster = str_cpy(ChosenMonster, "Goshawk");
	str_cpy(MonsterDetailsString, GoshawkDetailsString);
	str_cpy(MonsterConfigString, GoshawkConfigString);
	str_cpy(CreateRandomButton, "pos_x = 328; pos_y = 450; button=0, 0, RandomButton, RandomButton, RandomButtonBrite, ChooseRandomMon, NULL, NULL; flags |= OVERLAY | SHOW;");
	set(MonsterDetailsText, SHOW);
	set(MonsterConfigText, SHOW);
	PlayerOnePan.bmap = GoshawkChosen;
}

//Then in a different function, I call
set(PlayerOnePan, SHOW);
//but the problem isn't here, it's in the "PlayerOnePan.bmap = GoshawkChosen" line


Re: Is it possible to change panel BMAP? [Re: tolu619] #441972
06/07/14 17:36
06/07/14 17:36
Joined: Apr 2005
Posts: 1,988
Canadian, Eh
DLively Offline
Serious User
DLively  Offline
Serious User

Joined: Apr 2005
Posts: 1,988
Canadian, Eh
Here are my debugging ideas laugh

Code:
//bmap definition
BMAP* GoshawkChosen = "GoshawkCharacterChosen.bmp";
BMAP* tempPan_bmap = "tempPan.bmp";

//Panel definition
PANEL* PlayerOnePan =
{
	bmap = tempPan_bmap;
	pos_x = 20;
	pos_y = 100;
	layer = 8;
	flags = OVERLAY;
}

//last line of this function is the relevant code
function ChooseGoshawk()
{
	ChosenMonIndex = 1;
	str_cpy(ChosenMonster, "Goshawk");
	str_cpy(MonsterDetailsString, GoshawkDetailsString);
	str_cpy(MonsterConfigString, GoshawkConfigString);
	
	
	str_cpy(CreateRandomButton, "pos_x = 328; pos_y = 450; button=0, 0, RandomButton, RandomButton, RandomButtonBrite, ChooseRandomMon, NULL, NULL; flags |= OVERLAY | SHOW;");
	
	
	set(MonsterDetailsText, SHOW);
	set(MonsterConfigText, SHOW);
beep();
	PlayerOnePan.bmap = GoshawkChosen;
	return;
	
	
}

	//when you call this function in another part of your script, just after it, place a wait_for();
	//ChooseGoshawk();
	//wait_for(ChooseGoshawk);

//Then in a different function, I call
set(PlayerOnePan, SHOW);
//but the problem isn't here, it's in the "PlayerOnePan.bmap = GoshawkChosen" line



Im limited by no knowing how your entire script is executed, but I hope this is helpful


Also, another debugging idea is to use the beep(); function to hear if your script has made it to the beep or not. In this case, I've placed a beep just before the bmap change, if it gets that far, it will beep, which means the problem is the line after the beep.

Last edited by DLively; 06/07/14 17:38. Reason: Misread some code :/

A8 Pro 8.45.4
YouTube: Create Games For Free
Free Resources: www.CGForFree.com
Re: Is it possible to change panel BMAP? [Re: tolu619] #441973
06/07/14 17:40
06/07/14 17:40
Joined: Jul 2004
Posts: 785
Serbia
Iglarion Offline
User
Iglarion  Offline
User

Joined: Jul 2004
Posts: 785
Serbia
Originally Posted By: tolu619
I did that; Still not working. Can I get some sample code for changing the bmap of a panel at runtime?

This is C-script/WDL section, and code you are write is Lite-C. Did you use Lite-C? Changing bmap is pretty easy and clear and there is nothing special with this (you can see this in the code below). Only you must be sure that your image files is ok, and that your_panel.bmap = new_bmap was placed in a right place.
Code:
BMAP* test_bmp = "test.tga";
BMAP* test2_bmp = "test2.tga";

PANEL* Pan_test = {
	bmap = test_bmp;
	layer = 70;
	flags = SHOW;
}

function change_pan_startup(){
	while(1){
		if(key_c){
			Pan_test.bmap = test2_bmp;
		} else {
			Pan_test.bmap = test_bmp;
		}
		wait(1);
	}
}



IGRAVISION Page - www.igravision.com
RPG project - The Battle For Forgol 92.75%
Re: Is it possible to change panel BMAP? [Re: Iglarion] #441985
06/07/14 19:27
06/07/14 19:27
Joined: Jun 2014
Posts: 97
Lagos, Nigeria
T
tolu619 Offline
Junior Member
tolu619  Offline
Junior Member
T

Joined: Jun 2014
Posts: 97
Lagos, Nigeria
Oh, I didn't realize it was the lite-c section. I decided to search for a thread on the issue instead of starting a new topic. @DLively, I've already confirmed that the problem is with that one line of code (by commenting it out). I also have a workaround that I've tested and seen that it works, but duplicating the workaround in each place the function is needed will result in too many lines of code. I'll try different image formats because it seems the code is perfect.
My workaround is to use pan_create to create the panel at runtime, then delete the panel and recreate it with the new bmap whenever I need to change the panel.

Page 2 of 3 1 2 3

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