Jump to content

Recommended Posts

So I made Telestone item that can remeber location and you can teleport to that location at later time.

It works in caves and thats where problems start, cause there can be more than one cave per world (we don't know the exact number of caves spawned on surface world) and caves has 2 levels, no idea how to recognize in witch cave level we are loading or witch cave number it is. 

Any way of doing stuff like that?

As we have to remember the point of the marked location and mark prefab GUID.

Telestone.zip

maybe tag current caves as caveN, where N is index of array of tags

like

cavetags = {"cave1"}
then check tags in circle and if tags not exists than add new one, like

N = #cavetags+1cavetags[N] = "cave"..tostring(N)
if current world havent tag from this array, then make new tag.

after this u can make 2 dimensional array, where first index - cave (world) number, second one - index of location

like

caveloc[N] = {} -- init new cavecaveloc[N][1] = Vector3(pos) 
but probably there way to define number of cave :-)

good thing that tagging current world will work in any location, in cave or ruin or usual world or even adventure mode.

Edited by iWitch

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
  • Create New...