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

terminal_exit Lua trigger is called at the start of a new game #498

Closed
jonirons opened this issue Jun 7, 2024 · 0 comments
Closed

terminal_exit Lua trigger is called at the start of a new game #498

jonirons opened this issue Jun 7, 2024 · 0 comments

Comments

@jonirons
Copy link

jonirons commented Jun 7, 2024

If I have a Solo Lua script enabled that sets the terminal_exit trigger, and start a new game, the trigger is called regardless of the presence of terminals in the level or the state of the player looking at a terminal. It also occurs before init is triggered.

This occurs only the first time I start a new game after starting the program. I have confirmed that I do not encounter this behavior when restoring from a saved game, even if it's the first thing I do after starting the program.

I have confirmed this on Aleph One 1.7.1 and 1.8.1

Here is a sample Lua script:

Triggers = {}

function Triggers.init(restore)
    print("Triggers.init", restore)
end

function Triggers.terminal_exit(terminal, player)
    print("Triggers.terminal_exit", terminal, player)
end

Here is the output to stdout with # commentary.

First run:

$ alephone ~/games/Mararthon\ Infinity/
Aleph One Linux 2024-05-13 1.8.1
[...]
Triggers.terminal_exit	nil	player 0
Triggers.init	false
Triggers.init	false

Note that the terminal object was nil.

You can see from Triggers.init that I started two new games. In each case, I saved the game using Game.save(). The first save was intended to capture any relevant state that might cause or prevent the behavior upon load. The second was to see if an untainted save would start exhibiting the behavior. Neither had this issue. The # comments were actually typed into the CLI, to help me keep track of which was which.

$ alephone ~/games/Mararthon\ Infinity/ # restore from first save
Aleph One Linux 2024-05-13 1.8.1
[...]
Triggers.init	true

$ alephone ~/games/Mararthon\ Infinity/ # restore from second save
Aleph One Linux 2024-05-13 1.8.1
[...]
Triggers.init	true
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

1 participant