Page 1 of 1

Problems with General Codeing

PostPosted: Thu Apr 26, 2012 4:01 pm
by SarisoftheOmegaX3
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.

Re: Problems with General Codeing

PostPosted: Thu Apr 26, 2012 4:15 pm
by skydereign
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

Re: Problems with General Codeing

PostPosted: Thu Apr 26, 2012 4:18 pm
by SarisoftheOmegaX3
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