Skip to content

Pass reference to the player, who has triggered a script #2726

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

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Vankata453
Copy link
Member

Previously, there was no way to know which player executed a script.

Squirrel weak references to entries under a SquirrelEnvironment table in sector.triggers.{trigger_object}.{name_of_reference} are now supported. For example, a reference to the player who has triggered a script trigger, can be found under sector.triggers.{script_trigger_name}.Tux. The object must have a name to support trigger info. Before running a script of an object, the triggers table of that object is deleted.

References to the player who has activated a script are supported in PushButton, ScriptedObject hit script, ScriptTrigger and Switch.

An idea for the future would be to provide such player references from BadGuy death scripts as well.

Previously, there was no way to know which player executed a script.

References to entries under a `SquirrelEnvironment` table in `sector.triggers.{trigger_object}.{name_of_reference}` are now supported. For example, a reference to the player who has triggered a script trigger, can be found under `sector.triggers.{script_trigger_name}.Tux`.

References to the player who has activated a script are supported in `PushButton`, `ScriptedObject` hit script, `ScriptTrigger` and `Switch`.

An idea for the future would be to provide such player reference from `BadGuy` death scripts as well.
@Vankata453 Vankata453 added category:code involves:scripting status:needs-review Work needs to be reviewed by other people labels Jan 1, 2024
@tylerandari13
Copy link
Contributor

actually so real

tried it out and it appears to work fine

@Vankata453
Copy link
Member Author

I will try to make more triggers support this.

@Vankata453 Vankata453 marked this pull request as draft January 3, 2024 20:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:code involves:scripting status:needs-review Work needs to be reviewed by other people
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants