Problems with General Codeing

Game Editor comments and discussion.

Problems with General Codeing

Postby SarisoftheOmegaX3 » Thu Apr 26, 2012 4:01 pm

Im trying hard to learn what im doing wrong, i've taught myself alot of the Basics and im having trouble with the Follow actor code. ive been trying to get Enemy A to follow Enemy B and so forth (like a train wave). unfortunately im not sure what im doing wrong at this point, Follow(enemy.1, enemy.2, XAxis 5) i know when it highlights something in red that the code is corrupt and will refuse to run but im not sure if its just because this code will not work with two of the same kind of actors or if what im doing is not meant to work in this fashion and i should look for another way :P

Details: The Enemy actors are clones no add ons no inheritance i have yet to add any destroy actor codes.
SarisoftheOmegaX3
 
Posts: 2
Joined: Mon Apr 23, 2012 11:23 pm
Score: 0 Give a positive score

Re: Problems with General Codeing

Postby skydereign » Thu Apr 26, 2012 4:15 pm

gE doesn't have code spell checking (so the text in red is not necessarily wrong). When text is in red, that means that it is a string, so in double quotes (if you type "this" it would appear red), or a number. If it is light blue it is either a character, comment, or a special syntax character. Functions are colored yellow. Now there isn't a follow function (unless you added one yourself). So if the Follow in your code is not yellow then it won't work no matter what you pass it. Perhaps you mean to use MoveTo? In that case you can use it to move the event actor to the next clone. Since you are using clones, you'll need to know a bit about strings.
Code: Select all
char next_clone[30]; // declares a string that we will use to get the next clone's clonename
sprintf(next_clone, "%s.%d", name, cloneindex+1); // this sets next_clone equal to the next clone's clonename
// with that you can use it for MoveTo's relative to argument

//MoveTo function (you want to move to the (0, 0) relative to the next_clone
User avatar
skydereign
 
Posts: 3440
Joined: Mon Jul 28, 2008 8:29 am
Score: 569 Give a positive score

Re: Problems with General Codeing

Postby SarisoftheOmegaX3 » Thu Apr 26, 2012 4:18 pm

Thanks :P that helped alot the numbers not the text was highlighted but im very new to this and im just guessing around here :P again thanks for the help
SarisoftheOmegaX3
 
Posts: 2
Joined: Mon Apr 23, 2012 11:23 pm
Score: 0 Give a positive score


Return to GE - General

Who is online

Users browsing this forum: No registered users and 1 guest

cron