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
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (AndrewAMD, Ayumi), 1,405 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
ptr_for_handle #221027
08/11/08 18:01
08/11/08 18:01
Joined: Jul 2008
Posts: 18
Y
YNG Offline OP
Newbie
YNG  Offline OP
Newbie
Y

Joined: Jul 2008
Posts: 18
I don't exactly know if ptr_for_handle has a bug or not; but after some searchin on the forum and manual i thought there might be a bug at the ptr_for_handle function. When i save a panel's handle to a variable and callback the panel's pointer from ptr_for_handle i get an error message or my code doesnt work right. I made a test both with an entity and a panel. For entity everythng works perfect as it has to be but when it comes to panel problem beguns. Is thre something i have to do extra to convert a panels handle to a pointer; or is this a bug?? If u reply me with info about it i ll be real glad. I ll try a workaround or wait for next update to change the script of my project according to ur reply...
Best Regards

PS: I use A7 10.1 Comm. Edition...
I also added the script of my test to the bottom of the post...

Code:
#include <acknex.h>
#include <default.c>

PANEL* dummy_pan;
ENTITY* dummy_ent;

var handle_var;

void main()
{
	wait(4);
	level_load("villa_terrain_2.hmp");
	wait(4);
	camera.tilt=-15;
	
	dummy_pan=pan_create("bmap = 350z_tablo.bmp;",1);
	handle_var = handle(dummy_pan);
	you=ptr_for_handle(handle_var);
	set(you,VISIBLE);
	
	wait(2);
	
	dummy_ent=ent_create("masa4.mdl",vector(0,0,0),NULL);
	handle_var = handle(dummy_ent);
	you=ptr_for_handle(handle_var);
	set(you,TRANSLUCENT); 
}


Model becomes transparent, but panel doesnt become visible with ptr_for_handle.

Re: ptr_for_handle [Re: YNG] #221091
08/12/08 09:14
08/12/08 09:14
Joined: Jul 2000
Posts: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
Frankfurt
you=ptr_for_handle(handle_var);

You is an ENTITY* pointer. Entities and panels are different things and can not be assigned to each other in the code.

Re: ptr_for_handle [Re: jcl] #221108
08/12/08 12:10
08/12/08 12:10
Joined: Jul 2008
Posts: 18
Y
YNG Offline OP
Newbie
YNG  Offline OP
Newbie
Y

Joined: Jul 2008
Posts: 18
Thank you for the info. I just updated my code considerin the thng you said and my problem has been solved. Sorry for my mistake and thank you again...


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

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