Suggestion - Face Direction

Started by Meowster, Tue 28/10/2003 20:41:26

Previous topic - Next topic

Meowster

Just a suggestion for the next version... it's sort of petty but anyway...

When making a character face a direction, you use FaceLocation, right? (Or FaceCharacter, but you need another character present to do that); Well since most people only have Left, Right, Up and Down walking sprites, it seems a bit excessive for those people to have to use coordinates the whole time to make their characters face left or right.

Now I'm crap at explaining myself, because I really don't have a clue what I'm talking about, but perhaps it would be easier if there were a command that was simply:

FaceDir(EGO,left);

If you know what I mean. Rather than having to come up with X and Y coordinates when all you want EGO to do is turn left.


And maybe a button that automatically reads your background pictures and lays out the walkable areas, hotspots and walk-behinds...

DoorKnobHandle

Good idea!!!

If you have 8 Directions you could use for that second parameter:

FaceDir(EGO, LeftUp);

Proskrito

#2
i think you could make a custom function for that in less than a minute  ;)
EDIT: example:
function FaceDir(int charid, string dir);
int xcoord=character[charid].x;
int ycoord=character[charid].y;
if (StrCaseComp("left", dir)==0) xcoord=-1000;
else if (StrCaseComp("right", dir)==0) xcoord=1000;
else if (StrCaseComp("up", dir)==0) ycoord=-1000;
else if (StrCaseComp("down", dir)==0) ycoord=1000;
FaceLocation(charid,xcoord,ycoord);
}

well, i havent tested it, but if it doesnt work you could use it for reference or ideas   :)

DoorKnobHandle

Of course!

I am a stupid idiot!

Thanks!!

a-v-o

--- script header ---
#define FACE_LEFT 1
#define FACE_RIGHT 2
#define FACE_UP 3
#define FACE_DOWN 4
import function FaceDir(int charid, int dir);

--- global script ---

function FaceDir(int charid, int dir);
int xcoord=character[charid].x;
int ycoord=character[charid].y;
if (dir == FACE_LEFT) xcoord=xcoord-10;
else if (dir == FACE_RIGHT) xcoord=xcoord+10;
else if (dir == FACE_UP) ycoord=ycoord-10;
else if (dir == FACE_DOWN) ycoord=ycoord+10;
FaceLocation(charid,xcoord,ycoord);
}

This should also work with rooms larger than 1000 and execute somewhat faster because no string comparison is needed.

Not tested.

SMF spam blocked by CleanTalk