Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is the LOCK state preserved across CALL's at all, like INST is? #31

Open
PuppyPi opened this issue May 20, 2021 · 4 comments
Open

Is the LOCK state preserved across CALL's at all, like INST is? #31

PuppyPi opened this issue May 20, 2021 · 4 comments

Comments

@PuppyPi
Copy link

PuppyPi commented May 20, 2021

The INST state is preserved by pushing it to a stack of some kind across CALL's and restoring it when the CALL completes, but what about the LOCK state?

@Vermidia
Copy link
Member

If you mean that if the current script is in a CALLed script, yeah the caller script can't be interrupted if it was LOCKed before. If you mean can the CALLed script be interrupted if the caller script was LOCKed first, it seems yes. If the CALLed script is interrupted, the CALL doesn't end, it still waits for the current instance to end.

@PuppyPi
Copy link
Author

PuppyPi commented May 20, 2021

Wow that's interesting, thanks so much!
Hmmmmm,
So..

• A CALLed script always starts UNLK'ed?

• What if it calls UNLK explicitly? The CALLer's LOCK state isn't affected? Meaning it keeps a record of whether each script in a CALL stack was in a LOCK state separately, instead of just keeping in like a single hidden agent-wide variable? (That's what I meant with my confusingly-worded question ^^' )

If the CALLed script is interrupted, the CALL doesn't end, it still waits for the current instance to end.

• So wait you mean if you MESG or the game sends an Event, that it will interrupt the CALLed script with the new script, but when that script is done, it will return to the CALLer script?! (That's wild if true! :o )

@Vermidia
Copy link
Member

  1. DBG# says 0 when checking LOCK, so yes
  2. Somehow I'm unable to replicate my previous results(I seem to be able to run the CALLer during a CALLed script if it's during a WAIT), but calling UNLK on the CALLed script does not affected the CALLer.(I'm currently not sure how I got the first results, I might need to mess around with that bit more, I've been using mesg to test this stuff so I'll mess around more)
  3. Yes

@PuppyPi
Copy link
Author

PuppyPi commented May 21, 2021

Goooood to know!
Thanks so much for taking the time to check these things! :D

I mentioned it in—Oh well thanks GitHub, isn't that nifty! XD

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants