Jump to content

Problem with luautils.walkAdj()


RoboMat

Recommended Posts

I have a problem with the luautils.walkAdj function that I can't figure out.

 

When I use it in my Sleeping Overhaul the player goes to sleep before walking to the object. It also happens sometimes that after he wakes up he is on the outside of the building he tried to sleep in.

 

This is the code I use:

if luautils.walkAdj(ISSleepMenu.object.square) then        if ISSleepMenu.player == nil then            ISSleepMenu.player = getSpecificPlayer(ISContextMenu.globalPlayerContext);        end... do more stuffend

 

Does anyone know how to make the game wait for the player to walk to the object before executing the rest of the block?

Link to comment
Share on other sites

Well the only thing the dummy would do is being passed to the queue and call the sleeping functions once it is reached. Then the walkAdj would be executed correctly, right?

 

I haven't spent too much time looking through the Timed Actions so I might be wrong here, but I don't think the sleeping mechanics of my mod would work with a timed action. For example its length isn't predetermined but changed randomly while it is executed.

Link to comment
Share on other sites

Well the only thing the dummy would do is being passed to the queue and call the sleeping functions once it is reached. 

 

That's precisely what a timed action does :)

 

 

Then the walkAdj would be executed correctly, right?

 

Yes, just call the sleep code in the perform() method.

Link to comment
Share on other sites

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...