Event_SaveLocation

Author Topic: Event_SaveLocation  (Read 2068 times)

Can someone make an event that saves your current location so I can do stuff like

OnActivate>Player>SaveLocation & OnActivate>Player>GoToLocation

It could possibly be done reusing code from player persistence

should it save location across death?
what about rejoining the server?
and what about when the server closes?
should it also save rotation?

should it save location across death?
what about rejoining the server?
and what about when the server closes?
should it also save rotation?
it just saves your current location so if you use the load event you get teleported where you saved, simple. nothing of what you just said should or would have any sort of impact on the event.

It is quite literally just this http://orbs.daprogs.com/rtb/forum.returntoblockland.com/dlm/viewFileadbc.html?id=56 except for location
« Last Edit: April 09, 2020, 07:53:49 AM by Beyond Neptune »

it just saves your current location so if you use the load event you get teleported where you saved, simple. nothing of what you just said should or would have any sort of impact on the event.
actually, all of what i asked is very relevant
i guess you'll have to wait for somebody else to come by and make it then, since i don't know what you actually want - i don't exactly remember how the save/load item worked, i think it saved across death but not client rejoin/server restart, but it might have done that

you could always enable player persistence, that saves the players last location (some other stuff too though)

i get why you would want a separate event for this though, might make this if im not busy later

« Last Edit: April 10, 2020, 01:33:52 AM by Goth77 »

player persistence is only on rejoining the server i think, and saves the last location before leaving the server
the event could be used more often than those two cases

player persistence is only on rejoining the server i think, and saves the last location before leaving the server
the event could be used more often than those two cases
oh, duh. right you are. But yeah

probably something like

onActivate > client > transformSave
onActivate > client > transformLoad

seems like a proper way to do it

more likely player, that way they need to have a player object to set/save the position of
the actual data could be saved to the client, that way it's saved across death, but i'm unsure if that's what he wanted, since he chose to keep that a secret

more likely player, that way they need to have a player object to set/save the position of
the actual data could be saved to the client, that way it's saved across death, but i'm unsure if that's what he wanted, since he chose to keep that a secret
I've kept nothing secret, I just said nothing of what you said would impact the event or saved config from it. The data would save after death, just like Item Saving which is why I said earlier it should be exactly like it except for location. It's pretty stand up and straight to the point.

Everything phflack said was pretty relevant. Typically you want to describe everything in detail so whoever attempts this doesn’t have to get another add on and figure out how it works to make this one.

I've kept nothing secret, I just said nothing of what you said would impact the event or saved config from it. The data would save after death, just like Item Saving which is why I said earlier it should be exactly like it except for location. It's pretty stand up and straight to the point.

If it saves beyond death, it should not store your location on your Player object, as that will get deleted.
If it saves through a rejoin, it should not store your location on your GameConnection object, as that will get deleted.
Of it saves through a server restart, it needs to store your location in a file on your hard drive, instead of just... in memory.

Anyway...  I have no way of testing this right now and I'm working off of memory here but-
Code: (server.cs) [Select]
registerOutputEvent("Player","saveTransform");
function Player::saveTransform(%this){if(isObject(%this.client)){%this.client.savedTransform = %this.getTransform();}}
registerOutputEvent("Player","loadTransform");
function Player::loadTransform(%this){if(isObject(%this.client)){if(%this.client.savedTransform !$= ""){%this.setTransform(%this.client.savedTransform);}}}

I sure hope that works.
« Last Edit: April 10, 2020, 12:26:15 PM by Tendon »

its not good to ask technical details from someone who doesnt know how the technical stuff works. its better just to ask what he wants, which he said - item saving, but positions. also, if there's technical discussion going on, probably shouldnt respond directly to it

tendon's code will work.

i want an addon that does stuff. someone make it for me please

its not good to ask technical details from someone who doesnt know how the technical stuff works. its better just to ask what he wants, which he said - item saving, but positions. also, if there's technical discussion going on, probably shouldnt respond directly to it

tendon's code will work.
preach brother

tried to keep it as direct to the point as i could, but even that isn't enough most of the time
which is why i was only asking about desired behaviour and how it would be used
if the person asking doesn't know how they're going to use it, then they probably don't actually need it