Page 1 of 1

:) it's me again

PostPosted: Fri Oct 14, 2011 6:04 pm
by Agusstosus15
how to assign a coordinates x, y of concrete actor to a variable?

Re: :) it's me again

PostPosted: Fri Oct 14, 2011 6:10 pm
by Game A Gogo
if the script is found inside the actor you want to get the values from, do something like this:
(if you are using arrays)
Code: Select all
MyArray[0]=x;
MyArray[1]=y;

(if you are using two variables)
Code: Select all
MyX=x;
MyY=y;


if the script happens on another actor (or is in global codes)
then you'll need to point to the actor first, which is very simple:
Code: Select all
MyVariable=MyActor.x;


remember to change the names according to your game/program setup!

Re: :) it's me again

PostPosted: Fri Oct 14, 2011 6:18 pm
by Agusstosus15
i did ,
but when i try create other actor using that variables it's not working :)

Re: :) it's me again

PostPosted: Fri Oct 14, 2011 6:23 pm
by Agusstosus15
ow its working! but coordinates are freaky:)

Re: :) it's me again

PostPosted: Fri Oct 14, 2011 6:29 pm
by Agusstosus15
it's not the real position of my actor
not even on screen
when i'm using xscreen i got the same effect

Re: :) it's me again

PostPosted: Fri Oct 14, 2011 6:31 pm
by Game A Gogo
not the real position? what do you mean by that?

Re: :) it's me again

PostPosted: Fri Oct 14, 2011 6:47 pm
by Agusstosus15
position of my actor on screen that is what i mean
when i put x yscreen coordinates into
careate(another actor.., x, y- ) its appear out of screen

Re: :) it's me again

PostPosted: Fri Oct 14, 2011 6:50 pm
by Agusstosus15
tym[0]=xscreen; \

tym[1]=yscreen; / its actor1 position

CreateActor("postacp_czarownica", "cpion2", "(none)", "(none)", tym[0], tym[1], true);- its actor2 name and animation

result is actor 2 does not appear on actor 1, but out of vision, why?

let's say actor 2 is far from actor 1

Re: :) it's me again

PostPosted: Fri Oct 14, 2011 8:16 pm
by Game A Gogo
Code: Select all
tym[0]=x;
tym[1]=y;

Code: Select all
CreateActor("postacp_czarownica", "cpion2", "(none)", "(none)", tym[0], tym[1],false);


it's because in the last argument you had "true", which means relative to the current actor.
false will make it relative to (0,0).

using xscreen and yscreen is not for this purpose