JereKuusela / valheim-dev

The Unlicense
15 stars 8 forks source link

[Suggestions] mixed #14

Open 4Magma opened 2 years ago

4Magma commented 2 years ago

Could you add a filter feature to manipulate the output of a command

Could you expand the goto command

AltPlusF4 commented 2 years ago

Hi 4Magma, i'm considering to contribute the extended goto command feature on my fork and start a pull request. Since a friend uses the mod for his server and sometimes needs to teleport to other players, I would extend and prefer the syntax as follows:

The [coordinates] argument represents coordinates in the form X Z, X Z Y X,Z X,Z,Y.

@JereKuusela and @4Magma please let me know what you think about the syntax.

Feel free to suggest other argument names for player=, savewp= and wp=.


Edit: The quotes for the names of players and waypoints are used to allow spaces in the names.

4Magma commented 2 years ago

@AltPlusF4 Syntax looks good

JereKuusela commented 2 years ago

Heyh, I appreciate both suggestions and contributions. Unfortunately I have been very busy with other mods so that's why I haven't done anything.

I think I did goto back some time ago.

I would suggest doing them as goto playername and goto waypointname by first checking is the parameter "back", then if it is waypoint name, then if it is player name and finally parsing coordinates if nothing else was found.

You can combine the parameters so no need to use quotes there (the terminal will split them up even with quotes).

It might be more clear to have the waypoint setup as a separate command. Like waypoint [name] to set as the current position and waypoint [name] [coordinates] as the given position. Same for teleporting other players.

But very happy to get help so any implementation is more than fine. 😁

AltPlusF4 commented 2 years ago

I think a separate command for waypoints is the cleaner way. Valheim Modding and Unity is currently a completely new area for me. Hence the question, is there an easy way to save the waypoints to a file, or do I have to use the standard C# IO?

JereKuusela commented 2 years ago

Standard C# IO. You can get the config folder with Paths.ConfigPath