PROBably PROBlem with my version :(

Non-platform specific questions.

PROBably PROBlem with my version :(

Postby QbiWan » Mon Dec 26, 2011 12:18 pm

Hi. I'm new here.
I have some problems with Global Code Editor. There's tutorial on:

http://game-editor.com/Creating_board/strategy_games

I wanted to follow it a little, but when i pasted the code:

int findcell(int xx, int yy) //returns the current cell
{
int vcell=round((xx-controller.x)/32);
int hcell=round((yy-controller.y)/32);
int mycell=vcell+(hcell*10);
return mycell;
}

i saw this:

GE Error.jpg


What is going on?? What kind of mistake did i make??
QbiWan
 
Posts: 4
Joined: Fri Dec 16, 2011 12:21 pm
Score: 0 Give a positive score

Re: PROBably PROBlem with my version :(

Postby schnellboot » Mon Dec 26, 2011 12:44 pm

you need to create an actor named controller
schnellboot
 
Posts: 819
Joined: Sat Mar 31, 2007 1:35 pm
Location: Germany
Score: 102 Give a positive score

Re: PROBably PROBlem with my version :(

Postby QbiWan » Mon Dec 26, 2011 1:33 pm

THX :)
But why tutorial didn't mentioned it??
And how this actor should look like (actions, parent, normal/wire frame, etc.)??
QbiWan
 
Posts: 4
Joined: Fri Dec 16, 2011 12:21 pm
Score: 0 Give a positive score

Re: PROBably PROBlem with my version :(

Postby Jagmaster » Mon Dec 26, 2011 3:31 pm

Create an object to handle all the pieces. This actor will be off-screen, and all pieces will be children of this actor. In this way, you can then move this actor at will to move the entire game board at will!


Since the controller will be off-screen you would be safe with a normal actor. In fact, most of the time, if it's not specified, you should use a normal actor.

Now I have a question, I thought you couldn't manipulate actor variables in global script unless you commented the name of the actor at the beginning of the script. Are you still able to read them without doing any of that?
User avatar
Jagmaster
 
Posts: 875
Joined: Sun May 08, 2011 4:14 pm
Location: Not where you think.
Score: 82 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest