Jump to content
  • 0

Character face forward


ScarrFace

Question


  • Group:  Members
  • Topic Count:  17
  • Topics Per Day:  0.01
  • Content Count:  66
  • Reputation:   0
  • Joined:  10/23/19
  • Last Seen:  

any char face forward script or src working on latest version?

 

-	script	kdjhfksdjf	-1,{
OnPCLoginEvent:
	setdir DIR_SOUTH;
	end;
}

this is not working and if i use this i got error.

Quote

parse_line: expect command, missing function name or calling undeclared function
*    4 :        's'etdir DIR_SOUTH;

how to fix that ? or anyone can recommend new script or src side? thank you 

Link to comment
Share on other sites

7 answers to this question

Recommended Posts

  • 0

  • Group:  Forum Moderator
  • Topic Count:  25
  • Topics Per Day:  0.01
  • Content Count:  830
  • Reputation:   316
  • Joined:  02/11/19
  • Last Seen:  

2 hours ago, ScarrFace said:

any char face forward script or src working on latest version?

 


-	script	kdjhfksdjf	-1,{
OnPCLoginEvent:
	setdir DIR_SOUTH;
	end;
}

this is not working and if i use this i got error.

how to fix that ? or anyone can recommend new script or src side? thank you 

https://github.com/rathena/rathena/blob/master/conf/battle/client.conf#L135-L137

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  19
  • Topics Per Day:  0.01
  • Content Count:  398
  • Reputation:   246
  • Joined:  07/04/19
  • Last Seen:  

On 12/11/2019 at 8:15 AM, ScarrFace said:

any char face forward script or src working on latest version?

 


-	script	kdjhfksdjf	-1,{
OnPCLoginEvent:
	setdir DIR_SOUTH;
	end;
}

this is not working and if i use this i got error.

how to fix that ? or anyone can recommend new script or src side? thank you 

to solve your error you need to declare setdir first in src/script.

 

BUILDIN_FUNC(setdir) {
    TBL_PC *sd;
    if ( script_hasdata(st,4) ) {
        if ( data_isstring( script_getdata(st,4) ) )
            sd = map_nick2sd( script_getstr(st,4),false );
        else
            sd = map_id2sd( script_getnum(st,4) );
    } else
        sd = map_id2sd(st->rid);
    if ( sd ) {
        int value = 0;
        if ( script_hasdata(st,3) ) {
            value = script_getnum(st,3);
            if ( value < 0 || value > 2 )
                value = 0;
        }
        pc_setdir( sd, script_getnum(st,2), value );
        clif_changed_dir( &sd->bl, AREA );
    }
    return SCRIPT_CMD_SUCCESS;
}

BUILDIN_FUNC(checkdir) {
    TBL_PC *sd;
    if ( script_hasdata(st,3) ) {
        if ( data_isstring( script_getdata(st,3) ) )
            sd = map_nick2sd( script_getstr(st,3),false );
        else
            sd = map_id2sd( script_getnum(st,3) );
    } else
        sd = map_id2sd(st->rid);
    if ( sd ) {
        int value = 0;
        if ( script_hasdata(st,2) )
            value = script_getnum(st,2);
        script_pushint( st, value > 0 ? sd->head_dir : sd->ud.dir );
    }
    return SCRIPT_CMD_SUCCESS;
}

  • MVP 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  17
  • Topics Per Day:  0.01
  • Content Count:  66
  • Reputation:   0
  • Joined:  10/23/19
  • Last Seen:  

20 hours ago, BeWan said:

to solve your error you need to declare setdir first in src/script.

 

BUILDIN_FUNC(setdir) {
    TBL_PC *sd;
    if ( script_hasdata(st,4) ) {
        if ( data_isstring( script_getdata(st,4) ) )
            sd = map_nick2sd( script_getstr(st,4),false );
        else
            sd = map_id2sd( script_getnum(st,4) );
    } else
        sd = map_id2sd(st->rid);
    if ( sd ) {
        int value = 0;
        if ( script_hasdata(st,3) ) {
            value = script_getnum(st,3);
            if ( value < 0 || value > 2 )
                value = 0;
        }
        pc_setdir( sd, script_getnum(st,2), value );
        clif_changed_dir( &sd->bl, AREA );
    }
    return SCRIPT_CMD_SUCCESS;
}

BUILDIN_FUNC(checkdir) {
    TBL_PC *sd;
    if ( script_hasdata(st,3) ) {
        if ( data_isstring( script_getdata(st,3) ) )
            sd = map_nick2sd( script_getstr(st,3),false );
        else
            sd = map_id2sd( script_getnum(st,3) );
    } else
        sd = map_id2sd(st->rid);
    if ( sd ) {
        int value = 0;
        if ( script_hasdata(st,2) )
            value = script_getnum(st,2);
        script_pushint( st, value > 0 ? sd->head_dir : sd->ud.dir );
    }
    return SCRIPT_CMD_SUCCESS;
}

thank you so much!

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  105
  • Topics Per Day:  0.02
  • Content Count:  446
  • Reputation:   229
  • Joined:  03/20/12
  • Last Seen:  

@Mael's thing is correct. No need for src mod and stuff because it is already implemented in rAthena since 2014.

// When a player teleports, changes maps, or logs in, will they face the direction they were facing before warped?
// Official: Disabled, players always face North.
spawn_direction: 0

just set spawn_direction to 1.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  19
  • Topics Per Day:  0.01
  • Content Count:  398
  • Reputation:   246
  • Joined:  07/04/19
  • Last Seen:  

1 hour ago, Mabuhay said:

@Mael's thing is correct. No need for src mod and stuff because it is already implemented in rAthena since 2014.


// When a player teleports, changes maps, or logs in, will they face the direction they were facing before warped?
// Official: Disabled, players always face North.
spawn_direction: 0

just set spawn_direction to 1.

try to char select and log in

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  105
  • Topics Per Day:  0.02
  • Content Count:  446
  • Reputation:   229
  • Joined:  03/20/12
  • Last Seen:  

Oh i see, well, doesnt matter, its not like it adds +100 damage when your character face south upon login.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  19
  • Topics Per Day:  0.01
  • Content Count:  398
  • Reputation:   246
  • Joined:  07/04/19
  • Last Seen:  

2 hours ago, Mabuhay said:

Oh i see, well, doesnt matter, its not like it adds +100 damage when your character face south upon login.

?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...