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
3 registered members (Ayumi, NewbieZorro, TipmyPip), 13,888 guests, and 6 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: can not convert 'pointer' to 'struct entity' and syntax erro [Re: n00bie] #211696
06/17/08 19:56
06/17/08 19:56
Joined: Oct 2007
Posts: 5,211
İstanbul, Turkey
Quad Offline
Senior Expert
Quad  Offline
Senior Expert

Joined: Oct 2007
Posts: 5,211
İstanbul, Turkey
use action a_Player() isntead of action a_Player


3333333333
Re: can not convert 'pointer' to 'struct entity' and syntax erro [Re: Quad] #211752
06/18/08 06:31
06/18/08 06:31
Joined: Feb 2007
Posts: 53
N
n00bie Offline OP
Junior Member
n00bie  Offline OP
Junior Member
N

Joined: Feb 2007
Posts: 53
I've done that, but I've got still the same syntax error.

Re: can not convert 'pointer' to 'struct entity' and syntax erro [Re: n00bie] #211780
06/18/08 13:12
06/18/08 13:12
Joined: Jan 2003
Posts: 4,615
Cambridge
Joey Offline
Expert
Joey  Offline
Expert

Joined: Jan 2003
Posts: 4,615
Cambridge
repost your code you're using.

Re: can not convert 'pointer' to 'struct entity' and syntax erro [Re: Joey] #211782
06/18/08 13:16
06/18/08 13:16
Joined: Feb 2007
Posts: 53
N
n00bie Offline OP
Junior Member
n00bie  Offline OP
Junior Member
N

Joined: Feb 2007
Posts: 53
Code:
#define FreeCamActive FLAG1
ENTITY* player;
VECTOR* temp2;
...
function free_cam() 
{
	vec_set(my.x, player.x);
	set(my,INVISIBLE);
	set(my,FreeCamActive);
	var fly_speed = 10;
	var fly_turn_speed = 10;
	
   vec_set (camera.pan, my.pan);
   
   while(my)
	{
		if (key_shift == 10) { 
			fly_speed = 10; 
		}
		else { 
			fly_speed = 10; 
		}

		vec_set (temp2, nullvector);
		temp2.x = (mouse_left - mouse_right) * fly_speed * time_step;
		camera.pan -= fly_turn_speed * mouse_force.x * time_step;
	   camera.pan = camera.pan%360;
      camera.tilt += fly_turn_speed * mouse_force.y * time_step;
      camera.tilt = clamp(camera.tilt, -90, 90);
     	camera.roll = 0;
   	vec_rotate (temp2, camera.pan);
		vec_add (camera.x, temp2);		
  	   wait(1);
	}
}

action a_Player()
{
	reset(my,FreeCamActive);
	player = me;
	while(1)
	{
		wait(1);
		if((key_pressed(88)) && (!is(my,FreeCamActive))) //F12 pressed
		{
			free_cam();
		}
	}
}


EDIT: now I've got only this error remaining:

can not convert 'pointer' to 'struct entity'

player = me;

Last edited by n00bie; 06/18/08 13:17.
Re: can not convert 'pointer' to 'struct entity' and syntax erro [Re: n00bie] #211786
06/18/08 13:31
06/18/08 13:31
Joined: Jan 2003
Posts: 4,615
Cambridge
Joey Offline
Expert
Joey  Offline
Expert

Joined: Jan 2003
Posts: 4,615
Cambridge
sounds as if there was a ENTITY player definition somewhere in your code. that's weird, because player is defined as ENTITY*. honestly, i have no clue but would try to change ENTITY* player to ENTITY* myplayer and player = me to myplayer = my and replace player by myplayer.

a_Player is assigned to an entity in wed?

Re: can not convert 'pointer' to 'struct entity' and syntax erro [Re: Joey] #211787
06/18/08 13:37
06/18/08 13:37
Joined: Feb 2007
Posts: 53
N
n00bie Offline OP
Junior Member
n00bie  Offline OP
Junior Member
N

Joined: Feb 2007
Posts: 53
Originally Posted By: Joey
sounds as if there was a ENTITY player definition somewhere in your code. that's weird, because player is defined as ENTITY*. honestly, i have no clue but would try to change ENTITY* player to ENTITY* myplayer and player = me to myplayer = my and replace player by myplayer.

a_Player is assigned to an entity in wed?


It does'nt work because you need the "player" to move the camera in this function. (so the standard function)

Last edited by n00bie; 06/18/08 13:38.
Re: can not convert 'pointer' to 'struct entity' and syntax erro [Re: n00bie] #211788
06/18/08 13:45
06/18/08 13:45
Joined: Jan 2003
Posts: 4,615
Cambridge
Joey Offline
Expert
Joey  Offline
Expert

Joined: Jan 2003
Posts: 4,615
Cambridge
where? i just noticed that you're not using player anywhere.

Re: can not convert 'pointer' to 'struct entity' and syntax erro [Re: Joey] #211789
06/18/08 13:57
06/18/08 13:57
Joined: Feb 2007
Posts: 53
N
n00bie Offline OP
Junior Member
n00bie  Offline OP
Junior Member
N

Joined: Feb 2007
Posts: 53
Originally Posted By: Joey
where? i just noticed that you're not using player anywhere.


I use the code "player" specific because the action must be attached to the player himself.

Re: can not convert 'pointer' to 'struct entity' and syntax erro [Re: n00bie] #211793
06/18/08 14:10
06/18/08 14:10
Joined: Jan 2003
Posts: 4,615
Cambridge
Joey Offline
Expert
Joey  Offline
Expert

Joined: Jan 2003
Posts: 4,615
Cambridge
i don't get that, sorry. are you using "player" anywhere else in your code?

Re: can not convert 'pointer' to 'struct entity' and syntax erro [Re: Joey] #211794
06/18/08 14:13
06/18/08 14:13
Joined: Feb 2007
Posts: 53
N
n00bie Offline OP
Junior Member
n00bie  Offline OP
Junior Member
N

Joined: Feb 2007
Posts: 53
Originally Posted By: Joey
i don't get that, sorry. are you using "player" anywhere else in your code?


no, but in this action it is needed. So if I change the name with "myplayer" and press F12, the engine shuts down with a read error.

Last edited by n00bie; 06/18/08 14:14.
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