I had another look at the global script for the "int chartofollow" and i didn't find any other reference,
but what i did notice was that in the function there was "int charidtogo"
and i was wondering if placing this in the script header instead, as this was missing?
function GoToCharacterEx(int charidwhogoes, int charidtogo, int direction, int xoffset, int yoffset, int NPCfacesplayer, int blocking){
Ã, //Goes to a character staying at the side defined by 'direction': 1 up, 2 right, 3 down, 4 left
Ã, //and it stays at xoffset or yofsset from the character. NPCfacesplayer self-explained.
Ã, // blocking: 0=non-blocking; 1=blocking; 2=semi-blocking.
Ã, // returns 1 if player arrived.
Ã, int playerchar,charidx,charidy,playerx,playery;
Ã, if (charidwhogoes!=GetPlayerCharacter() && blocking==2) blocking=0;//npcs cant perform semi-blocking actions
Ã, playerchar=charidwhogoes;
Ã, charidx=character[charidtogo].x;
Ã, charidy=character[charidtogo].y;
Ã, playerx=character[playerchar].x;
Ã, playery=character[playerchar].y;
Ã, Ã, Ã, int arrived = 1;
Ã, Ã, Ã, if ((Offset (playerx, charidx) > xoffset) || (Offset (playery, charidy) > yoffset)){
Ã, Ã, Ã, Ã, if (direction==0){ // shortest way.
Ã, Ã, Ã, Ã, Ã, if (Offset(charidx,playerx)>=Offset(charidy,playery)){ // left or right
Ã, Ã, Ã, Ã, Ã, Ã, if (playerx>=charidx) direction=2; //right
Ã, Ã, Ã, Ã, Ã, Ã, else direction=4; //left
Ã, Ã, Ã, Ã, Ã, }
Ã, Ã, Ã, Ã, Ã, else{
Ã, Ã, Ã, Ã, Ã, Ã, if (playery>=charidy) direction=3; //down
Ã, Ã, Ã, Ã, Ã, Ã, else direction=1;
Ã, Ã, Ã, Ã, Ã, }
Ã, Ã, Ã, Ã, }
Ã, Ã, Ã, Ã, // calculate target position
Ã, Ã, Ã, Ã, if (direction==1) charidy-=yoffset;
Ã, Ã, Ã, Ã, else if (direction==2) charidx+=xoffset;
Ã, Ã, Ã, Ã, else if (direction==3) charidy+=yoffset;
Ã, Ã, Ã, Ã, else if (direction==4) charidx-=xoffset;
Ã, Ã, Ã, Ã, // move character
Ã, Ã, Ã, Ã, if (blocking==0){
Ã, Ã, Ã, Ã, Ã, MoveCharacter(playerchar,charidx,charidy);
Ã, Ã, Ã, Ã, Ã, arrived = 0;
Ã, Ã, Ã, Ã, }
Ã, Ã, Ã, Ã, else if (blocking==1){
Ã, Ã, Ã, Ã, Ã, MoveCharacterBlocking(playerchar,charidx,charidy,0);
Ã, Ã, Ã, Ã, Ã, arrived = 1;
Ã, Ã, Ã, Ã, }
Ã, Ã, Ã, Ã, else if (blocking==2) arrived = MovePlayer(charidx,charidy);
Ã, Ã, Ã, }
Ã, Ã, Ã, if (arrived > 0){
Ã, Ã, Ã, Ã, // characters only face each other after the moving character arrived at the target point
Ã, Ã, Ã, Ã, if (NPCfacesplayer==1)Ã, FaceCharacter(charidtogo, playerchar);
Ã, Ã, Ã, Ã, FaceCharacter(playerchar, charidtogo);
Ã, Ã, Ã, }
Ã, Ã, Ã, return arrived;
}
but what i did notice was that in the function there was "int charidtogo"
and i was wondering if placing this in the script header instead, as this was missing?
function GoToCharacterEx(int charidwhogoes, int charidtogo, int direction, int xoffset, int yoffset, int NPCfacesplayer, int blocking){
Ã, //Goes to a character staying at the side defined by 'direction': 1 up, 2 right, 3 down, 4 left
Ã, //and it stays at xoffset or yofsset from the character. NPCfacesplayer self-explained.
Ã, // blocking: 0=non-blocking; 1=blocking; 2=semi-blocking.
Ã, // returns 1 if player arrived.
Ã, int playerchar,charidx,charidy,playerx,playery;
Ã, if (charidwhogoes!=GetPlayerCharacter() && blocking==2) blocking=0;//npcs cant perform semi-blocking actions
Ã, playerchar=charidwhogoes;
Ã, charidx=character[charidtogo].x;
Ã, charidy=character[charidtogo].y;
Ã, playerx=character[playerchar].x;
Ã, playery=character[playerchar].y;
Ã, Ã, Ã, int arrived = 1;
Ã, Ã, Ã, if ((Offset (playerx, charidx) > xoffset) || (Offset (playery, charidy) > yoffset)){
Ã, Ã, Ã, Ã, if (direction==0){ // shortest way.
Ã, Ã, Ã, Ã, Ã, if (Offset(charidx,playerx)>=Offset(charidy,playery)){ // left or right
Ã, Ã, Ã, Ã, Ã, Ã, if (playerx>=charidx) direction=2; //right
Ã, Ã, Ã, Ã, Ã, Ã, else direction=4; //left
Ã, Ã, Ã, Ã, Ã, }
Ã, Ã, Ã, Ã, Ã, else{
Ã, Ã, Ã, Ã, Ã, Ã, if (playery>=charidy) direction=3; //down
Ã, Ã, Ã, Ã, Ã, Ã, else direction=1;
Ã, Ã, Ã, Ã, Ã, }
Ã, Ã, Ã, Ã, }
Ã, Ã, Ã, Ã, // calculate target position
Ã, Ã, Ã, Ã, if (direction==1) charidy-=yoffset;
Ã, Ã, Ã, Ã, else if (direction==2) charidx+=xoffset;
Ã, Ã, Ã, Ã, else if (direction==3) charidy+=yoffset;
Ã, Ã, Ã, Ã, else if (direction==4) charidx-=xoffset;
Ã, Ã, Ã, Ã, // move character
Ã, Ã, Ã, Ã, if (blocking==0){
Ã, Ã, Ã, Ã, Ã, MoveCharacter(playerchar,charidx,charidy);
Ã, Ã, Ã, Ã, Ã, arrived = 0;
Ã, Ã, Ã, Ã, }
Ã, Ã, Ã, Ã, else if (blocking==1){
Ã, Ã, Ã, Ã, Ã, MoveCharacterBlocking(playerchar,charidx,charidy,0);
Ã, Ã, Ã, Ã, Ã, arrived = 1;
Ã, Ã, Ã, Ã, }
Ã, Ã, Ã, Ã, else if (blocking==2) arrived = MovePlayer(charidx,charidy);
Ã, Ã, Ã, }
Ã, Ã, Ã, if (arrived > 0){
Ã, Ã, Ã, Ã, // characters only face each other after the moving character arrived at the target point
Ã, Ã, Ã, Ã, if (NPCfacesplayer==1)Ã, FaceCharacter(charidtogo, playerchar);
Ã, Ã, Ã, Ã, FaceCharacter(playerchar, charidtogo);
Ã, Ã, Ã, }
Ã, Ã, Ã, return arrived;
}