Bringing bits together

I’ve now got what’s shaping up to be a pretty good UI system:

  • The UI styling is defined via data in space-format (JSONish)
  • The layout of the UI is then defined by a second space-format file:
  • Then the “actions”, in the case above the single button, are defined in a space-script file:

    Basically, the UI Layout says the button will execute the function named “SeedButton”. That function creates a new button that will execute the function named “OutputNum”.

This all works well, surprisingly. The only gap is that every “execution” of the script, or execution of a function in the script, is completely independent of any other execution. Meaning that I can’t store information between button presses, at least not in the script.

To get around this, I’ll likely implement a key-store as a regular Engine Function so that scripts can store information for later use, even when it’s only ever needed by the script.

I didn’t think of this before because I only ever imagined scripting things like enemy behaviour, which would just access and set what it needed to.

2 Replies to “Bringing bits together”

  1. Hello,
    I found out your blog today while looking for information about grand strategy games projects, because I’d like to start my own soon. I’m impressed how much effort you have put into it for 2 years and can only admire such level of commitment. A lot of usefull information can be found here and i hope other game developers will discover this blog.

    Keep up the good work!
    Regards.

Leave a Reply

Your email address will not be published. Required fields are marked *