Jump to content
  • 0

Progress Bar / Facing Command.


Question

Posted (edited)

Edit: I was able to make the ProgressBar do what i want, as it was a simple edit/change.

Secondly, I would like to request a command, that can effectively return a numerical value equal to that of an NPC in terms of direction facing.

For instance something like this:

getdirection <player ID>;
getdirection "player name";
//returns a value of 1-8 For direction facing (same as when you choose an NPC's facing). Returns 0, if no one is found.

Thank you very much for reading this, all help is greatly appreciated. If you have any further questions regarding my requests please don't not hesitate to ask, I will answer to the best of my ailities.

Edited by GmOcean

5 answers to this question

Recommended Posts

Posted

I think the server does not always know which direction a player is facing.

server-side: player's facing direction is based on the last direction they walked

client-side: after you stop walking, you can shift-click to face a different direction, but this change is not sent to the server

To demonstrate, use a Soul Linker:

- walk north

- stop walking

- use Shift-click to face south

- use High Jump

--> you'll jump in the North direction but still be facing south on your client

This is where it's stored, hope it helps:

(unit_data for facing direction, and map_session_data for head direction)

#define pc_setdir(sd,b,h)     ( (sd)->ud.dir = ( ,(sd)->head_dir = (h) )

Posted (edited)

BUILDIN_FUNC(getdirection)
{
   TBL_PC* sd;
   struct script_data *data;

   if(script_hasdata(st,2)){
    data = script_getdata(st,2);
    get_val(st,data);
    if( data_isstring(data) ){
	    sd = map_nick2sd(conv_str(st,data));
    }else
	    sd = map_id2sd(conv_num(st,data));
   }else
    sd = script_rid2sd(st);

   if( sd == NULL )
    script_pushint(st,-1);
   else
    script_pushint(st,sd->ud.dir);

   return 0;
}

BUILDIN_DEF(getdirection,"?"),

Edited by QQfoolsorellina
  • Upvote 1

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...