World Primer

World Primer

7M Downloads

Timed Command has no variable substitution?

Peppe-KSP opened this issue ยท 3 comments

commented

Trying to run:

        worldprimer-timed-command 60 0 say Centering World Border on Player Position {PLAYER_X} {PLAYER_Z}
        worldprimer-timed-command 60 0 worldborder center {PLAYER_X} {PLAYER_Z}
        worldprimer-timed-command 60 0 worldborder set 16 0

Comes through chat with no sub. "say Centering World Border on Player Position {PLAYER_X} {PLAYER_Z}" in some of the other commands works.

Trying to set world border on where the player actual spawned as 0, 0 is not always spawn and another mod may be moving spawn as using{SPAWN_X} commands in the other world creation stages seems to always be 0,0.

Trying to use Botania with garden of glass enabled and garden of glass world type.

commented

The timed commands don't have any player context, so they won't do any of the PLAYER_* substitutions. The SPAWN_* substitutions should work in it though, from the looks of it? (I didn't test it though.)

However, for the particular task of centering the World Border on the spawn point, another option would be using the Just Enough Dimensions mod, which in the latest 1.6.0 beta versions has an option to center the world border on the dimension's spawn point on first load of the dimension.

This example config should do it (in this case for dimension 0):

{
    "config_version": {
        "id": "__default",
        "version": 0
    },
    "dimensions": [
        {
            "dim": 0,
            "worldinfo_onetime": {},
            "jed": {
                "WorldBorderCenteredOnSpawn": true,
                "SpawnPointSearchType": {
                    "type": "none"
                }
            }
        }
    ]
}
commented

Thanks i did get it to work using spawn_x/z in the timer. I may not have moved and modified the line right when I tried it on the timer after trying it on the post creation event.

I may need just enough dimensions to have a world border in the right spot for each dimension anyway.

commented

If you want to have proper spawn points for each dimension, and the world border centered on that spawn point, you can set up the border sizes, search for a suitable spawn point, and center the border on that spawn point via the JED dimension config.

The example config above used the spawn point search type 'none' to skip the spawn point search that JED would otherwise normally do for a WorldInfo overridden dimension, as an example of how to only do the world border centering, without affecting the existing spawn point. If you want JED to search for a proper safe spawn point, then you can either remove the SpawnPointSearchType object for overworld type dimensions to default to the overworld type spawn point search (or use the type overworld), or you can use the type cavern for nether-type dimensions (with a bedrock ceiling), optionally with a configurable y range.

And to set up the border size, you would add for example "BorderSize": 256 inside worldinfo_onetime (a vanilla tag that exists in the level.dat file).