|
| bool | SetOutcome (uint missionEntityId, int outcomeIndex, bool isSuccess) |
| | Declares one of the four outcomes of a mission that ships no JSON. Index is mandatory and follows the same rule as "_missionOutcomes": 0 gone wrong and skill failed, 1 gone wrong but skill passed, 2 as planned but skill failed, 3 as planned and skill passed. Effects are attached with AddOutcomeEffect.
|
| |
| bool | AddOutcomeEffect (uint missionEntityId, int outcomeIndex, string effectType, string effectValue) |
| | Adds one effect to an outcome of a mission that ships no JSON - what the crew, the base or the squadron gains or loses when the mission ends that way.
|
| |
| bool | CreateMission (string flightMissionId) |
| | Creates a mission and puts it on the war map now, bypassing the weekly draw and the mission's own requirements. This is how a script hands out a follow-up in reaction to what just happened - a chain that JSON requirements cannot express, because the decision depends on more than the previous mission's outcome.
|
| |
| bool | AddMissionRequirement (uint missionEntityId, string requirementType, string value) |
| | Adds one appearance gate to a mission that ships no JSON, the way "_missionRequirements" does for a mission that has a file. Without at least one of these a script-authored mission has no gates at all, which means the weekly draw may hand it out on any map and on any date once it has been created for the first time.
|
| |
| bool | SetTags (uint missionEntityId, params string[] tags) |
| | Declares which maps a mission that ships no JSON belongs to, the way "_tags" does for a mission that has a file. A map declares the tags it supports in its own "_tags" and the mission declares the tags it is written for; the mission may appear only where the two share a tag.
|
| |
| bool | SetMissionStat (uint missionEntityId, string skillType, int minValue, int maxValue) |
| | Sets the min/max range for one skill of a mission, the way "_missionStats" does for a mission that has JSON. Call it from initialize_mission; a mission needs the two skills its script rolls on, and the first one set is the one rolled when all goes to plan.
|
| |
| bool | SetAsPlannedChance (uint missionEntityId, int chance) |
| | Sets the chance, 0 to 100, that the mission goes as planned - the "_asPlannedChance" of a JSON mission. Without it the mission always counts as having gone wrong.
|
| |
| bool | SetMissionLocation (uint missionEntityId, string locationName) |
| | Places the mission at a named war map location and derives its distance and fuel level from it, exactly as a JSON mission's "_potentialLocations" does. Without a location the mission still flies, but sits at the map origin.
|
| |
| bool | SetMaxAirplaneSlots (uint missionEntityId, int slots) |
| | Sets how many airplanes the player may assign - the "_maxPlaneSlots" of a JSON mission.
|
| |
| bool | SetDifficulty (uint missionEntityId, int difficultyRating) |
| | Sets the star rating shown to the player, 1 to 3 - the "_difficultyRating" of a JSON mission.
|
| |
| uint[] | GetMissionAirplaneFormation (uint missionEntityId) |
| | Get airplane formation assigned to a mission.
|
| |
| int | GetEnemyCount (uint missionEntityId) |
| | Get the number of enemy planes reported.
|
| |
| bool | IsMissionSuccessful (uint missionEntityId) |
| | Get mission result.
|
| |
| string | GetMissionId (uint missionEntityId) |
| | Get the id of the mission definition (the JSON file name) an entity was created from. The shared default mission script uses this instead of a hard-coded id per script.
|
| |
| int | GetNumberOfEventsSent (uint missionEntityId) |
| | Get the amount of events sent during a mission.
|
| |
This class is available under a global missions_api variable.
| bool CreateMission |
( |
string | flightMissionId | ) |
|
|
inline |
Creates a mission and puts it on the war map now, bypassing the weekly draw and the mission's own requirements. This is how a script hands out a follow-up in reaction to what just happened - a chain that JSON requirements cannot express, because the decision depends on more than the previous mission's outcome.
Prefer the JSON route where it fits: "_requirementType": 3 with "<id>,success" or "<id>,failure" already covers "unlock B when A succeeded". Reach for this when the condition is something only a script knows - who flew, what the base looks like, how many times this has happened before.
- Parameters
-
| flightMissionId | Id of the mission to create |
- Returns
- False when the id is unknown, or when called while a mission is being created