aboutsummaryrefslogtreecommitdiff
path: root/docs/appendices/script-vm.md
Commit message (Collapse)AuthorAgeFilesLines
* fix(ai): preserve raw script problem argumentsValentin Popov2026-11-141-4/+7
| | | | Keep the target logical ID across Handler(2) and Handler(29). Verified slots 0, 1 and 2 with GOG ai.dll at RVA 0xc182. Single.01 now distinguishes nearby building IDs and leaves robot selection as the next blocker.
* feat(ai): evaluate clan combat strength in scriptsValentin Popov2026-11-141-0/+6
| | | | Use the live roster and Control weapon and capacity data in Handler(38). The original ai.dll rating formula was exercised with three capacity vectors. Single.01 reaches Handler(35) and retains factory production. Remaining ammunition and the exact selector 0x36 capacity are reported as an approximation.
* fix(ai): propagate problem priority to dependent ordersValentin Popov2026-11-141-0/+3
| | | | Read Handler(12) from the active problem, as verified by calling ai.dll. The Two Fortresses transport section now submits its dependent production request. Transport assignment and design selection are still uncovered.
* fix(ai): wait for the factory before restarting robot jobsValentin Popov2026-11-141-0/+2
| | | | Track the factory assigned by ST_SOLVING and the ACTION_NOTHING_DOING expression. Stock Single.01 completes the first robot at 27 seconds without duplicate busy-factory rejections. Keep other expression variants explicitly uncovered.
* feat(ai): honor clan construction class limitsValentin Popov2026-11-141-0/+3
| | | | Use the live per-class varset limits and roster count in Handler(11). Both enemy clans in stock Single.02 now request mines and enter their Start sections. Pending buildings and the hangar/lab counters are still uncovered.
* feat(ai): let clan scripts resume mining at existing shaftsValentin Popov2026-11-141-0/+3
| | | | Handle the free-mine lookup and the mine order in Problems0. Preserve a live shaft's deposit binding, claim nearby free reserves, and leave neighboring live shafts alone. Stock Single.02 now reaches the mine limit check instead of stopping on the lookup.
* fix(script): copy live DWORD values between script cellsValentin Popov2026-11-141-0/+3
| | | | The native record-copy branch covers 73 DWORD-to-DWORD instructions in the shipped shared varset. Stock mission 11 now copies the protection request value and reaches group assignment at Handler(25).
* fix(production): let separate factories build concurrentlyValentin Popov2026-11-141-0/+2
| | | | Reserve each slot at order time and advance one order per live factory. Hostile completion no longer changes the player's status. A stock Two Fortresses regression starts the player's factory during an enemy job and observes completions from both.
* feat(ai): build battle robots from clan factory scriptsValentin Popov2026-11-141-0/+6
| | | | Route the construct order from PBM_ROBOT_NEEDED into shared factory ownership, free quota, and paid production. Stock Single.01 builds an enemy robot at 27 seconds in the fixed-step report and about 27.4 seconds in the Vulkan window. Count accepted and rejected orders by clan and factory; configured prebuild selection and the global order slot remain approximations.
* feat(ai): advance clan jobs past unloaded laboratory researchValentin Popov2026-11-141-3/+8
| | | | Bind placed units for the duration of a Start section and report the native unloaded-catalog result with a stub counter. Consider the other pending priorities so the stock factory and transport Start sections are reached.
* feat(ai): start the highest-priority clan script problemValentin Popov2026-11-141-2/+5
| | | | Open the matching Start section after Problems0, expose its arguments, and support completion and unreserved placed-unit selection. Two Fortresses enters its laboratory job and reaches Handler(6). Timing, ties and continuation remain explicit approximations.
* feat(ai): queue clan script problems by native identityValentin Popov2026-11-141-6/+4
| | | | Pass Handler(2) operands through the existing scheduler and require matching script sections. The stock Two Fortresses clan queues research, transport, and robot problems before its combat-strength query. Pending dispatch is counted by clan and problem kind.
* feat(script): query clan storage and follow forward jumpsValentin Popov2026-11-141-0/+7
| | | | Use live storage capacity for Handler(16), expose the unbound research policy as a counted Handler(56) stub, and honor forward control-3 jumps. Checked storage arithmetic, flag truthiness and raw jump behavior by calling ai.dll. Stock Single.01 now reaches problem submission.
* fix(mining): feed placed mines from nearby depositsValentin Popov2026-11-141-0/+6
| | | | Bind stock mines to TMA reserves within the Behavior collection radius and report the live clan reserve to Problems0. Verified extraction from stock Single.01 and preserved the Field Camp mine order. Single.01 reaches Handler(56) in the 120-second report and renders with clean Vulkan validation.
* feat(ai): read free clan power in problem scriptsValentin Popov2026-11-141-0/+5
| | | | The typed event host stores the finite or negative float result in the script cell. A direct call to ai.dll verifies available minus requested power. Single.01 evaluates the energy branch and reaches its mine resource query.
* feat(ai): expose clan roster counts to problem scriptsValentin Popov2026-11-141-0/+6
| | | | Handler(49) counts free native-format startup slots and Handler(34) reads the live clan roster. The Two Fortresses reaches the research-dependent Handler(65) from every scheduled Problems0 invocation.
* feat(ai): dispatch periodic clan problem scriptsValentin Popov2026-11-141-0/+7
| | | | Runs the supported Problems0 prefix for AI clans and counts every stop by clan, event and instruction. Single.01 now reaches the native scenario body and identifies Handler(49) as the next unsupported command. Existing defensive behavior remains active.
* feat(ai): dispatch scripted attacks against logical targetsValentin Popov2026-11-141-0/+4
| | | | Resolve the stock logical target and feed it to unit combat. Mission 20 assigns the attack at startup and continues through the remaining Init commands. All 29 original missions completed 15 minutes without a hard Init or periodic Mission stop.
* feat(ai): queue scenario move orders for mobile unitsValentin Popov2026-11-141-0/+6
| | | | Runs the stock order sequence in mission 16. Both mobile headquarters receive five destinations in script order. Movement uses existing terrain routing until the native Go task is wired.
* feat(ai): patrol around script-selected objectsValentin Popov2026-11-141-0/+4
| | | | Uses the TMA logical ID to route a warbot around the current position of a building or unit. The original Behavior.dll confirms target class selection and radius. Mission 13 now assigns building patrols at stock startup.
* feat(ai): honor scenario warbot shutdown ordersValentin Popov2026-11-141-0/+4
| | | | Behavior.dll task dispatch selects ShutDown for order 0x13. Stop autonomous motion and fire until a new supported order is assigned. The field-camp clan now completes Init and all three placed warbots receive the shutdown order.
* fix(script): honor numeric condition scopes during InitValentin Popov2026-11-141-0/+10
| | | | Shares condition execution with Mission and compares a float left operand as f32. Native ai.dll confirms all six operators on the observed difficulty comparison. The complete 900 s corpus has no crashes or periodic Mission stops; remaining Init stops are Handlers 15 and 68.
* fix(script): evaluate products before adding formula termsValentin Popov2026-11-141-3/+5
| | | | Reuses the original operand formats and rounds each product before adding or subtracting. The original ai.dll agreed on three campaign difficulty expressions. Mission 19 now reaches comparison branches in Init.
* feat(ai): reserve placed units for scenario ordersValentin Popov2026-11-141-0/+9
| | | | Handler(51) changes availability in the owning clan, matching a direct ai.dll call. Reserved units stay out of the free capturer query. Campaign mission 7 now finishes Init and mission 13 reserves the addressed unit.
* feat(script): evaluate scenario deadlines and timeout testsValentin Popov2026-11-141-0/+16
| | | | Handler(59) stores a DWORD deadline in Init or Mission. Handler(60) compares it strictly against the current scenario clock. The original ai.dll confirms overflow and the equality boundary. Mission 16 now reaches its scheduled message.
* feat(ai): issue scripted place patrols from clan InitValentin Popov2026-11-141-2/+5
| | | | Handler(15) читает живые клетки и направляет размещённого варбота в указанную точку. Кампания 01, миссия 02 при штатном старте ставит четыре патруля и продолжает Init до Handler(51).
* feat(runtime): execute scripted place patrol ordersValentin Popov2026-11-141-5/+12
|
* fix(runtime): set tutorial production thresholds from live clansValentin Popov2026-11-141-1/+8
|
* feat(runtime): count exact clan classes in mission scriptsValentin Popov2026-11-141-0/+7
|
* feat(runtime): resolve mission objectives and outcomeValentin Popov2026-11-141-6/+24
|
* feat(runtime): count live clan objects in mission scriptsValentin Popov2026-11-141-0/+14
|
* feat(runtime): trigger tutorial voices from tactical areasValentin Popov2026-11-141-0/+21
|
* feat(runtime): dispatch the periodic Mission script eventValentin Popov2026-11-141-2/+30
|
* feat(runtime): start missions with explicit Init stubsValentin Popov2026-11-141-1/+4
|
* fix(script): apply immediate Init assignmentsValentin Popov2026-11-141-0/+9
|
* feat(runtime): project factory-2 selector 6 metadataValentin Popov2026-10-311-1/+63
|
* docs(runtime): correct Control and collision interface contractsValentin Popov2026-10-311-7/+34
|
* feat(script): evaluate additive FML expressions during InitValentin Popov2026-10-311-21/+76
|
* feat(runtime): restore indexed Control provider queryValentin Popov2026-10-311-0/+74
|
* feat(runtime): project initial Behavior control groupsValentin Popov2026-10-311-0/+43
|
* feat(runtime): restore Control selector 15Valentin Popov2026-10-311-0/+65
|
* feat(assets): decode research tables and calculate candidate costsValentin Popov2026-10-311-5/+65
|
* feat(script): execute numeric FML assignments during mission InitValentin Popov2026-10-311-14/+90
|
* fix(script): read Init guards in native disk orderValentin Popov2026-10-311-5/+17
|
* test(runtime): pin native Control activation clock bitsValentin Popov2026-10-301-26/+59
|
* feat(runtime): recompute loaded Control owner profilesValentin Popov2026-10-291-9/+137
|
* docs(runtime): clarify Control load callback orderValentin Popov2026-10-291-7/+8
|
* feat(runtime): project load-time Control profile valuesValentin Popov2026-10-291-0/+137
|
* feat(runtime): project native Control object classesValentin Popov2026-10-291-0/+55
|
* feat(runtime): retain Control owner profiles during loadingValentin Popov2026-10-291-0/+24
|