Coder Social home page Coder Social logo

Functions based on "ME" databases do not work for dynamically spawned groups because "ME" databases are not updated in updateDBTables() about missionscriptingtools HOT 4 CLOSED

mrskortch avatar mrskortch commented on June 14, 2024
Functions based on "ME" databases do not work for dynamically spawned groups because "ME" databases are not updated in updateDBTables()

from missionscriptingtools.

Comments (4)

mrSkortch avatar mrSkortch commented on June 14, 2024 1

getGroupRoute returns the route table as defined in the editor. There is no scripting function that returns a route currently assigned to a group. Thus it checks the ME DB to verify the group exists in the miz file. Currently mist doesn't save the route pushed with mist.goRoute or if you spawn a group with a route table. If you create your own route there is nothing stopping you from saving that somewhere to access at a later point similar to getGroupRoute.

from missionscriptingtools.

mrSkortch avatar mrSkortch commented on June 14, 2024

ME databases are specifically there as copy of the databases as the mission was saved in the editor. They aren't supposed to be used with dynamically added groups. Think of it like this, you have a group you placed in the editor, a few units die, and for whatever reason you decide to despawn the group. If you spawn the group later, keep the group name/id the same, but don't spawn the dead units in it, then updateDBTables and consequently mist.DBs.groupsByName, etc will be updated to reflect the new group contents. If you wanted to "repair" the group by respawning it in its entirety you could use a reference from mist.DBs.MEgroupsByName.

Basically had to choose between keeping an original copy or making a function that returned the same or similar format on request.

from missionscriptingtools.

plemtom avatar plemtom commented on June 14, 2024

Roger that. Makes sense. Some functions use ME DBs to find groups though. Like getGroupRoute for example. Is that intentional? I tried to use those with dynamically spawned groups and they just return alert that group is not found in ME database.

Original groups in ME DBs also have original routes? Perhaps there should be another set of functions to work with the living DB... dunno... I think I will just try that for now as a workaround.

from missionscriptingtools.

plemtom avatar plemtom commented on June 14, 2024

Then it seems this is not an issue. Closing.
Thanks for helping me understand this stuff.

from missionscriptingtools.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.