|
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
Senior Expert
|
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: Joey]
#211782
06/18/08 13:16
06/18/08 13:16
|
Joined: Feb 2007
Posts: 53
n00bie
OP
Junior Member
|
OP
Junior Member
Joined: Feb 2007
Posts: 53
|
#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: Joey]
#211787
06/18/08 13:37
06/18/08 13:37
|
Joined: Feb 2007
Posts: 53
n00bie
OP
Junior Member
|
OP
Junior Member
Joined: Feb 2007
Posts: 53
|
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: Joey]
#211789
06/18/08 13:57
06/18/08 13:57
|
Joined: Feb 2007
Posts: 53
n00bie
OP
Junior Member
|
OP
Junior Member
Joined: Feb 2007
Posts: 53
|
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: Joey]
#211794
06/18/08 14:13
06/18/08 14:13
|
Joined: Feb 2007
Posts: 53
n00bie
OP
Junior Member
|
OP
Junior Member
Joined: Feb 2007
Posts: 53
|
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.
|
|
|
|