cim wrote:Capt. Murphy wrote:Can we make the
model
parameter of
mission.runScreen
accept both a role string or a
dataKey
string as valid inputs?
So try to interpret it as a role, and if that fails try to interpret it as a shipdata key? (and the same for addShips, etc.)
Alternatively there could be separate parameters and functions in the same way that escort_role and escort_ship are separated. Which is less likely to be confusing?
Mmm, to my mind the first option is the least confusing (certainly in the context of
mission.runScreen
), and with the introduction of
dataKey
to JS is a guaranteed unique parameter (unlike
role
or
ship.name
), it just makes sense to me that it would be used to define a model in this context. The specific use I'm thinking of is to display a specific player flyable ship on the missionScreen and obviously role "player" doesn't cut it.
For spawning ships I guess there are issues to consider in allowing
dataKey
or
ship.name
as an alternative input to role, in deciding what role will be assigned to the resulting ship if it has several available (and AI if the
autoAI
key isn't set. But I guess that can be handled as normal with role probabilities. Alternatively perhaps the command syntax could be expanded to...
addShips(role : String[, dataKey: String], count : Number [, position: vectorExpression] [, radius: Number]) : Array
with
dataKey
as an optional parameter in addition to role. Perhaps something similar for
mission.runScreen
?