Does entity script remember what it where doing when you leave ? and


#1

Does entity script remember what it where doing when you leave ? or nobody is around ?
And then just proceed where it did stop the last time ? I think the result is no.

But that sounds so usefull. Otherwise you need to write in pretty fast speed or i need to figure out how to detect nobody is around with entity script, so i can save settings into userdata when nobody is around anymore ?

does entity script have a command that calls a function when nobody is around ?
We talk about script inside entity ? It would make a few things i think better and simple with my door.


#2

No, Entity scripts only run for the instance they are active in client. This is why entities running a script is effected by everyone, and effects everyone running them. This is unless there is a logic gate that stops this from happening, such as interactions, controller checks or ID checks. Its exactly the reason why my fox bomb works.

This means if nobody is around the script will not be running because there is nothing there to run it. Assignment client scripts are different and is a script run by the server.

When someone appears, the script starts as if it was just created.


#3

Just how i know it.
Then i need to approach it in different way, i think in my mind i figured it out already.

It would be nice if there’s a javascript command that allow you to do some last actions before the script get stopped and removed from the client. And yes that is not complete foul proof to.


#4

I believe that is called scriptEnding().
Don’t know about the ‘fool proofability’ of it though :slight_smile: .


#5

Oh yes i know that command. but not complete sure if the works inside a script that is put in entity.


#6

That it does: scripts do know their state, scriptEnding a good way to remove all the other bindings you have too to avoid them from ghosting in the client.


#7

This lack of object constancy is quite bad. Trying to make it work as an assignment script is difficult at best because the environment is quite different than an entity script running in a client. I thought about firing up a permanent client, one with rendering disabled entirely, but then it suffers from distance issues; that is, the permanent observer client cannot see the entire domain. This problem by far is the most serious flaw in High Fidelity.


#8

I can confirm that entity scripts not remember the state where you logged out.
What i did is click my door so it start moving and then quick logout. You would think it steps at that point. But after login it where 90 degree open. and the whole script got confused.

I need to figure out how to intercept that, but it will be pretty hard.

Anyway, it does not remeber state and actions and what it where doing. because the script run client side. But is still a good screwup for many thinbgs. like doors.

Until i figured out how to intercept it. But i have some idea’s.