Player.x?

Posted By: Creepinbox

Player.x? - 06/08/08 22:25

Code:
 
PANEL* player_xyz=
{ 
    pos_x = 100; 
    pos_y = 100; 
    layer = 2;
    digits(0,0,"%f",*,1,player.x);  
    flags = OVERLAY,VISIBLE; 
} 


Why is it displaying "0" ?
is it so that panels or texts cant display vectors and defines? cause Player.HEALTH doesent work eider ... what do i do ?!
Posted By: DJBMASTER

Re: Player.x? - 06/08/08 23:22

I just tested your code and everything is running fine. I move the player about and the digits change as expected.

I don't think this part of your script is causing you the problem. Make sure the player is set up properly and that the player pointer is initialized properly.

Panels should be able to display vectors, variables and defines. I've never had a case where i couldn't display one of them.

Apart from that i can't think why you are getting a constant 0.
Posted By: Creepinbox

Re: Player.x? - 06/08/08 23:41

wha? .. what could it be ? normal varibles work..
Posted By: Quad

Re: Player.x? - 06/08/08 23:46

make sure the "player" is not null.

you sure you are using "player = me;" in your supposed_to_be_player_action ??
Posted By: Creepinbox

Re: Player.x? - 06/09/08 00:07

ah .. found it .. i had made a Entity of the player aswell .. so it was "ENTITY* player;"
Posted By: Creepinbox

Re: Player.x? - 06/09/08 00:15

but i still don't get the defines right .. . digits(0,0,"%f",*,1,player.HEALTH);
Posted By: HPW

Re: Player.x? - 06/09/08 16:27

%f don't show anything, just use %1.0f as the thierd parameter.
Posted By: Creepinbox

Re: Player.x? - 06/09/08 20:25

digits(0,0,"%1.0f",*,1,player.HEALTH); ? no change .. are you sure this should work ? must i not use varibles?
Posted By: VeT

Re: Player.x? - 06/09/08 20:34

try to use
Code:
int player_HP;

action player()
{
***
player_HP = player.HEALTH;
***
}

and
Code:
digits(0,0,"%1.0f",*,1,player_HP); 

© 2024 lite-C Forums