2 registered members (TipmyPip, AndrewAMD),
14,540
guests, and 5
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
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
Expert
|
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: DLively]
#441970
06/07/14 16:25
06/07/14 16:25
|
Joined: Jun 2014
Posts: 97 Lagos, Nigeria
tolu619
Junior Member
|
Junior Member
Joined: Jun 2014
Posts: 97
Lagos, Nigeria
|
//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
Serious User
|
Serious User
Joined: Apr 2005
Posts: 1,988
Canadian, Eh
|
Here are my debugging ideas 
//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 :/
|
|
|
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
User
|
User
Joined: Jul 2004
Posts: 785
Serbia
|
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.
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);
}
}
|
|
|
|