Gamestudio Links
Zorro Links
Newest Posts
Change chart colours
by 7th_zorro. 05/11/24 09:25
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
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (Ayumi, Power_P), 1,065 guests, and 7 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
checking panel pointer bmap #414294
12/28/12 12:57
12/28/12 12:57
Joined: Dec 2011
Posts: 1,823
Netherlands
Reconnoiter Offline OP
Serious User
Reconnoiter  Offline OP
Serious User

Joined: Dec 2011
Posts: 1,823
Netherlands
Hi guys,

How can I check what the bmap is of a panel?

I have a pointer called Pointer_ItemInSlot1:

Code:
PANEL* Pointer_ItemInSlot1;



and I want to check the bmap is of the panel the pointer addresses.

Thanks for taking the time.

Re: checking panel pointer bmap [Re: Reconnoiter] #414295
12/28/12 13:17
12/28/12 13:17
Joined: Jul 2008
Posts: 2,107
Germany
rayp Offline

X
rayp  Offline

X

Joined: Jul 2008
Posts: 2,107
Germany
Code:
BMAP* this_bmap = "bla.bmp";
if (Pointer_ItemInSlot1.bmap == this_bmap)

Is that what youre looking 4 ? Sry if i missunderstood your question.


Acknex umgibt uns...zwischen Dir, mir, dem Stein dort...
"Hey Griswold ... where u gonna put a tree that big ?"
1998 i married my loved wife ... Sheeva from Mortal Kombat, not Evil-Lyn as might have been expected
rayp.flags |= UNTOUCHABLE;
Re: checking panel pointer bmap [Re: rayp] #414325
12/28/12 19:55
12/28/12 19:55
Joined: Dec 2011
Posts: 1,823
Netherlands
Reconnoiter Offline OP
Serious User
Reconnoiter  Offline OP
Serious User

Joined: Dec 2011
Posts: 1,823
Netherlands
Yes that is what I meant laugh

I have a bug though. The if code doesn't seem to work here in my code. Here's the relevant code:

Code:
BMAP* interfacedummy_png = "InterfaceDummy.png";

...
PANEL* Pointer_ItemInSlot1 = interfacedummy_png;

...

function buy_stinger()
{
	if (goldplayer >= 40) { //ignore this
	if (Pointer_ItemInSlot1.bmap == interfacedummy_png) { //the slot = empty		
	Pointer_ItemInSlot1.bmap = IconItemStinger_bmp;
	Pointer_ItemInSlot1.skill_x = 1; //ignore this
	goldplayer -= 40;} //ignore this
...



The 'goldplayer' is not the problem, i know this 100% sure. The problem is that it ignores the "if (Pointer_ItemInSlot1.bmap == interfacedummy_png)" but I don't know why.

Last edited by Reconnoiter; 12/28/12 19:56.
Re: checking panel pointer bmap [Re: Reconnoiter] #414331
12/29/12 09:29
12/29/12 09:29
Joined: Jan 2002
Posts: 4,225
Germany / Essen
Uhrwerk Offline
Expert
Uhrwerk  Offline
Expert

Joined: Jan 2002
Posts: 4,225
Germany / Essen
Assigning a pointer to a bitmap to pointer to a panel is not a good idea...


Always learn from history, to be sure you make the same mistakes again...
Re: checking panel pointer bmap [Re: Uhrwerk] #414335
12/29/12 12:31
12/29/12 12:31
Joined: Dec 2011
Posts: 1,823
Netherlands
Reconnoiter Offline OP
Serious User
Reconnoiter  Offline OP
Serious User

Joined: Dec 2011
Posts: 1,823
Netherlands
And what about reading a bmap from a button? E.g. is this possible:

Code:
pointer_panel.bmap = ?panel_inventory_button6.bmap?;


Re: checking panel pointer bmap [Re: Reconnoiter] #414338
12/29/12 13:27
12/29/12 13:27
Joined: Oct 2009
Posts: 149
Germany
M
muffel Offline
Member
muffel  Offline
Member
M

Joined: Oct 2009
Posts: 149
Germany
Perhaps the problem is in this line:

PANEL* Pointer_ItemInSlot1 = interfacedummy_png;

You are initializing the panel wrong. It should look like this:

PANEL* Pointer_ItemInSlot1 = {bmap=interfacedummy_png;}

And I dont think its possible to read the bmap of button.

muffel

Re: checking panel pointer bmap [Re: muffel] #414343
12/29/12 13:44
12/29/12 13:44
Joined: Jan 2002
Posts: 4,225
Germany / Essen
Uhrwerk Offline
Expert
Uhrwerk  Offline
Expert

Joined: Jan 2002
Posts: 4,225
Germany / Essen
Originally Posted By: Reconnoiter
And what about reading a bmap from a button?

Not possible afaik. But you can go exactly the way rayp suggested. You just have to ensure you initialize your panel correctly. Either with a static definition or with pan_create.
Code:
PANEL* Pointer_ItemInSlot1 = 
{
    bmap="InterfaceDummy.png";
}



Always learn from history, to be sure you make the same mistakes again...
Re: checking panel pointer bmap [Re: Uhrwerk] #414355
12/30/12 12:34
12/30/12 12:34
Joined: Dec 2011
Posts: 1,823
Netherlands
Reconnoiter Offline OP
Serious User
Reconnoiter  Offline OP
Serious User

Joined: Dec 2011
Posts: 1,823
Netherlands
Thanks guys it works now. @Uhrwerk, I first did the whole thing with pan_create but only noticed later on that that conflicts with game_save and game_load (I should have better read the manual :\), but the static definition works great ofcourse.


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