Page 1 of 1

storing x and y variables from actor wrappers

PostPosted: Thu Jan 26, 2012 5:00 pm
by Fojam
Code: Select all
Actor*enemy1=getclone2(player1Name, 0);
int enemy1x;

enemy1->enemy1x=x;


what is the correct way to do this?

Re: storing x and y variables from actor wrappers

PostPosted: Thu Jan 26, 2012 5:21 pm
by Hblade
place int enemyx above Actor*

Re: storing x and y variables from actor wrappers

PostPosted: Thu Jan 26, 2012 5:55 pm
by skydereign
Placing the int above won't do anything. Currently you are trying to access an actor's enemy1x variable and set it equal to the event actor's x. This won't work because enemy1x is not an actor variable. You just declared it in that script. Assuming in your actual setup it is an actor variable, that code would work, but it doesn't sound like what you want it to do. From your topic's title, I would think you want something more like this (note that enemy1x is a global variable defined elsewhere).
Code: Select all
Actor* enemy1 = getclone2(player1Name, 0);

enemy1x = enemy1->x;

As for how you are "supposed" to do it. That depends greatly on what you are actually trying to do.

Re: storing x and y variables from actor wrappers

PostPosted: Thu Jan 26, 2012 11:23 pm
by Fojam
thank you that worked