Skip to content

Run code from a .sw file as part of a scenario's goal condition #828

Closed as not planned
@kostmo

Description

Is your feature request related to a problem? Please describe.

One may have goal evaluation code that is complicated and only feasible to write as a .sw file.
This code might be tested using real robots, so that the author can observe the code's behavior in real time.
When it comes time to convert that to a condition, would like to re-use the code from the same file.

Describe the solution you'd like

Definitions within that file should be brought into scope for "inline" use subsequently in the condition code.

Would like to be able to write the following condition code:

run "myscript.sw";

x <- function1FromMyScript;
if x {return false} {function2FromMyScript;}

Related observation

Organizing code into a "function library" .sw file for use across multiple scenarios does not seem possible today.

Metadata

Assignees

No one assigned

    Labels

    G-ScenariosAn issue having to do with scenario design, the way scenarios are described and loaded, etc.Z-FeatureA new feature to be added to the game.Z-Temporary workaroundShort-term solution intended to be deprecated

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions