:) it's me again

Non-platform specific questions.

:) it's me again

Postby Agusstosus15 » Fri Oct 14, 2011 6:04 pm

how to assign a coordinates x, y of concrete actor to a variable?
Agusstosus15
 
Posts: 59
Joined: Sun Oct 09, 2011 7:59 pm
Score: 0 Give a positive score

Re: :) it's me again

Postby Game A Gogo » Fri Oct 14, 2011 6:10 pm

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!
Programming games is an art,
    Respect it.
User avatar
Game A Gogo
 
Posts: 3466
Joined: Wed Jun 29, 2005 10:49 pm
Location: French Canada *laughs*
Score: 181 Give a positive score

Re: :) it's me again

Postby Agusstosus15 » Fri Oct 14, 2011 6:18 pm

i did ,
but when i try create other actor using that variables it's not working :)
Agusstosus15
 
Posts: 59
Joined: Sun Oct 09, 2011 7:59 pm
Score: 0 Give a positive score

Re: :) it's me again

Postby Agusstosus15 » Fri Oct 14, 2011 6:23 pm

ow its working! but coordinates are freaky:)
Agusstosus15
 
Posts: 59
Joined: Sun Oct 09, 2011 7:59 pm
Score: 0 Give a positive score

Re: :) it's me again

Postby Agusstosus15 » Fri Oct 14, 2011 6:29 pm

it's not the real position of my actor
not even on screen
when i'm using xscreen i got the same effect
Agusstosus15
 
Posts: 59
Joined: Sun Oct 09, 2011 7:59 pm
Score: 0 Give a positive score

Re: :) it's me again

Postby Game A Gogo » Fri Oct 14, 2011 6:31 pm

not the real position? what do you mean by that?
Programming games is an art,
    Respect it.
User avatar
Game A Gogo
 
Posts: 3466
Joined: Wed Jun 29, 2005 10:49 pm
Location: French Canada *laughs*
Score: 181 Give a positive score

Re: :) it's me again

Postby Agusstosus15 » Fri Oct 14, 2011 6:47 pm

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
Agusstosus15
 
Posts: 59
Joined: Sun Oct 09, 2011 7:59 pm
Score: 0 Give a positive score

Re: :) it's me again

Postby Agusstosus15 » Fri Oct 14, 2011 6:50 pm

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
Agusstosus15
 
Posts: 59
Joined: Sun Oct 09, 2011 7:59 pm
Score: 0 Give a positive score

Re: :) it's me again

Postby Game A Gogo » Fri Oct 14, 2011 8:16 pm

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
Programming games is an art,
    Respect it.
User avatar
Game A Gogo
 
Posts: 3466
Joined: Wed Jun 29, 2005 10:49 pm
Location: French Canada *laughs*
Score: 181 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest