#Really long distance travel

1 messages · Page 1 of 1 (latest)

scarlet mountain
#

Will it be possible to create mod that will allow us to teleport really far? Think Stargates. Do you have any advice on how to do that?

jade owl
scarlet mountain
#

Is there a way to teleport player to specific coordinates on the target island?

#

The way I imagine it working would be as follows:

#

when you place it for the first time it has a "key" inside that points to this gate coordinates

#

you need to place that kay in the second gate for you to achieve one way travel

#

if you swap keys of 2 gates you achieve 2 way travel

#

alternatively I could try mc waystone approach with gates connecting to any other gate.

jade owl
scarlet mountain
#

or do I first need to wait for player to arrive at the specific island and then tp him to specific spot?

jade owl
#

no idea

#

probably have to wait

#

i didn't set up the system

scarlet mountain
#

yeah, sounds likely

#

but there should be some "player arrived" event fired so I can use that

#

next question: items have this setData, getData,removeData. is there anything like that for the entire save?

#

it doesn't look like saveData or saveDataGlobal have these

jade owl
#

You need to save that data with the mod.savedata stuff unfortunately

#

Sorry, I know that system is kinda terrible

scarlet mountain
#

#wayward message crafting ingredients

scarlet mountain
#

I decided to not go with key approach

#

too much hassle

#

instead I will do something more basic

#

Travel action on doodad will open UI with the list of all possible travel destinations

#

those will be saved in the player

#

hmm, is there a way to get data from some far off island?

#

game.islands can do it

#

so...

#

it would be cool if player travelled by walking into the gate

#

so doodad could just have "change address" action

#

anyway, I will have to check if target portal exists multiple times through the process

#

UI for the target address picker could be simple list with "Island name - portal name"

#

in case of missing portal just "island name - missing portal" in red

#

chiri - is there any better way of checking if specific doodad exists on specific island than filtering island.doodads?

#

if player will have more than a few teleporters it will add a lot of overhead from just filtering things

scarlet mountain
#

how do I add action now?

jade owl
#

you're missing a (

scarlet mountain
#

so this is the correct way?

jade owl
#

I mean I don't see anything else here that wouldn't work

scarlet mountain
#

I had another question, but I guess I can just dismantle DebugTools 🙂

#

I was wondering if I should use actions or usableActions

jade owl
#

If a player is going to use the action via actions context menus or the action bar, it must have a UsableAction

#

If the action does things that affect the game state for all players, the code that does that must be within an Action handler

#

Almost all Actions have a UsableAction counterpart and vice versa

#

UsableAction with no Action is the least common, because it means the thing acts like the other actions that affect the world, but in actuality it just messes with your own personal UI. Action with no UsableAction is a bit more common because Actions can be executed by other UI code if you like

scarlet mountain
#

hmm this seems complex, but maybe it explains weirdness here #1379222876636446840 message

#

I had weird issue with actions and usable actions in that topic

jade owl
#

I didn't really understand the thread when I saw it and I've been very busy so I didn't say anything

#

It probably is some kind of fundamental misunderstanding with how UsableActions and Actions work

#

And maybe even registrations

#

I'm not sure exactly

scarlet mountain
#

I just wanted to switch all "pin" from action to usableAction

#

but going back on track.

#

would it be possible to display that teleportation UI when the player walks into the gate?

#

not from the actions but from the "walking finished" event for that specific player?

scarlet mountain