Jump to content
  • 0

Progress Bar / Facing Command.


GmOcean

Question


  • Group:  Members
  • Topic Count:  31
  • Topics Per Day:  0.01
  • Content Count:  666
  • Reputation:   93
  • Joined:  04/27/12
  • Last Seen:  

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
Link to comment
Share on other sites

5 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  31
  • Topics Per Day:  0.01
  • Content Count:  666
  • Reputation:   93
  • Joined:  04/27/12
  • Last Seen:  

bump. I still need help/requesting a command to find the direction a player is looking in. I wish to use it in conjunction with the PushPC command.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  75
  • Topics Per Day:  0.02
  • Content Count:  2223
  • Reputation:   593
  • Joined:  10/26/11
  • Last Seen:  

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) )

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  31
  • Topics Per Day:  0.01
  • Content Count:  666
  • Reputation:   93
  • Joined:  04/27/12
  • Last Seen:  

That's fine. I don't really care for which direction the client sees me as long as the src side is accurate.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  40
  • Topics Per Day:  0.01
  • Content Count:  587
  • Reputation:   104
  • Joined:  11/19/11
  • Last Seen:  

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
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  31
  • Topics Per Day:  0.01
  • Content Count:  666
  • Reputation:   93
  • Joined:  04/27/12
  • Last Seen:  

Thanks, but i managed to figure it out. I even made a setdirection command based on the info Brian gave me. I had the getdirection command store the information in variables.

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...