storing x and y variables from actor wrappers

Game Editor comments and discussion.

storing x and y variables from actor wrappers

Postby Fojam » Thu Jan 26, 2012 5:00 pm

Code: Select all
Actor*enemy1=getclone2(player1Name, 0);
int enemy1x;

enemy1->enemy1x=x;


what is the correct way to do this?
CLICK TO GIVE ME POINTS

My Latest Projects:
Super Smash Bros: viewtopic.php?f=6&t=12307 PLEASE help by making sprites!
User avatar
Fojam
 
Posts: 513
Joined: Thu Mar 19, 2009 10:02 pm
Location: under your bed!!!
Score: 69 Give a positive score

Re: storing x and y variables from actor wrappers

Postby Hblade » Thu Jan 26, 2012 5:21 pm

place int enemyx above Actor*
Subscribe to my YouTube? - Yes| No
User avatar
Hblade
 
Posts: 4455
Joined: Fri Dec 08, 2006 11:14 pm
Score: 181 Give a positive score

Re: storing x and y variables from actor wrappers

Postby skydereign » Thu Jan 26, 2012 5:55 pm

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.
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score

Re: storing x and y variables from actor wrappers

Postby Fojam » Thu Jan 26, 2012 11:23 pm

thank you that worked
CLICK TO GIVE ME POINTS

My Latest Projects:
Super Smash Bros: viewtopic.php?f=6&t=12307 PLEASE help by making sprites!
User avatar
Fojam
 
Posts: 513
Joined: Thu Mar 19, 2009 10:02 pm
Location: under your bed!!!
Score: 69 Give a positive score


Return to GE - General

Who is online

Users browsing this forum: No registered users and 1 guest