20893 Posts in 3507 Topics - by 7106 Members - Latest Member: Talmar

Author Topic: [MOD] /showdist command - simple distance informations for serious captains  (Read 1977 times)

w00zla

  • Jr. Member
  • **
  • Posts: 71
  • coder4life
    • View Profile
Hello together,

i just wanted to give you the little mod i made for this lovely game, hopefully someone finds it as usefull as i did :D

DESCRIPTION:
This mod delivers you two commands which can be used to display the distance of the player to certain locations, measured in sectors.
Those locations can either be the center/core of the galaxy, the home sector of the player or a user-defined sector.

This may be usefull for different things like finding Boss Swoks ;) or planning some trading- and jump-routes...

Note:
I know there is already a mod with similar functionality, but i didnt know before beginning to create this one and i am still posting because it has more features ... funnily enough the mod creator had the same intention to find Swoks with his mod in the first place ;D


FEATURES:
Commands:

/showdist
Shows distance of player to defined location in chat window.
Usage:
/showdist center
/showdist home
/showdist home <PLAYER>
/showdist sector <XXX:YYY>
/showdist sector <XXX:YYY> <NAME>


/showdistjump
Shows distance to registered locations after each jump as notifications.
You can register multiple locations which will all be shown after jumps!
Usage:
/showdistjump center
/showdistjump home
/showdistjump home <PLAYER>
/showdistjump sector <XXX:YYY>
/showdistjump sector <XXX:YYY> <NAME>
/showdistjump off


Parameters:
<PLAYER> = name or index of existing player
<XXX:YYY> = coordinates value (like "321:456" or "12:-34")
<NAME> = name value (like "Trade1" or "SomeSector", no spaces)


INSTALLATION:
Download ZIP for latest release from GitHub and extract it to <Avorion>\data\ directory, like with other mods.
No vanilla script files will be overwritten, so there should be no problem with other mods or file changes due to game updates!

Multiplayer: This mod is server-side only, so no files have to be installed on clients for multiplayer games.


Changelog:
v0.4
- added possibility to show/register distance to any existing player's home-sector
- fixed problem with negative and reversed coordinates
- the /showdistjump command now remembers registered locations over saves and loads (you must use the /showdistjump off command now to get rid of the notifications!)
v0.3
- added possibilty to also define a name for user-defined sectors
- improved output of /help showdist and /help showdistjump commands
- minor changes and code comments =)
v0.2
- added possibility to register multiple user-defined sectors with /showdistjump command


Feedback:
Feel free to post feedback, bugs and feature suggestions if you like, I was having fun developing this and would really like to continue on it :)
« Last Edit: March 22, 2017, 03:52:39 PM by w00zla »

n0etics

  • Newbie
  • *
  • Posts: 29
    • View Profile
Great mod, and I love the additional features you've added to this idea. Is this server clientside or serverside or both? I could just look at the file I suppose but maybe you could edit the OP and include this information?

EDIT: is it possible to add a /showdisthelp command that prints out the commands for players in chat? That would be pretty useful for servers. Thanks
« Last Edit: February 27, 2017, 09:31:39 PM by n0etics »

w00zla

  • Jr. Member
  • **
  • Posts: 71
  • coder4life
    • View Profile
Great mod, and I love the additional features you've added to this idea. Is this server clientside or serverside or both? I could just look at the file I suppose but maybe you could edit the OP and include this information?

EDIT: is it possible to add a /showdisthelp command that prints out the commands for players in chat? That would be pretty useful for servers. Thanks

Very happy that you like my mod  ;D

I have just uploaded a new version 0.3 which improves the output of the standard /help command for showdist and showdistjump!
Just type "/help showdist" or "/help showdistjump" in your chat-window and you will get detailed info about the commands 8)
And btw, you can now also name the user-defined sectors so the output can be more usefull!

Also updated the post so it contains info about server-/client-side.
« Last Edit: February 28, 2017, 11:07:37 AM by w00zla »

w00zla

  • Jr. Member
  • **
  • Posts: 71
  • coder4life
    • View Profile
Update to version 0.4:
  • you can now show the distance to any existing player's home-sector, not only your own
  • locations registered with the /showdistjump command will now be remembered over saves and loads of the game/server
  • the problem with negative coordinates and reversed coordinates parameter (oops!!) has been fixed
« Last Edit: March 01, 2017, 12:42:26 PM by w00zla »

Devious

  • Sr. Member
  • ****
  • Posts: 431
    • View Profile
    • Rusty's Galaxies and Community
I like the extra features you put in!

Would it be possible to disable showing other players their location and home sector to the issuer of the command?
I scrolled through the scripts quickly but I'm not sure what to disable.

Dirtyredz

  • Full Member
  • ***
  • Posts: 159
  • David McClain - Dirtyredz
    • View Profile
    • Dirtyredz.com
Love the extra features the registered commands will be very useful, GJ.
David McClain - Dirtyredz
Programmer, Web Development, Modder
http://www.Dirtyredz.com


Fox

  • Full Member
  • ***
  • Posts: 197
  • "You're a good friend, Arthur!"
    • View Profile
    • FoxDie Inc.
Great Mod, Fox approved!
- Luck is no matter of coincidence or probability, but of attitude and perspective ! -