Skip to content

Commit be60dca

Browse files
authored
Script actions 99-110 (#402)
* Script actions 99-109 All the remaining from PR 296. * small fix * Changes suggested by the last review * Reverted some code that make crashes * Fix small mistakes When restoring code I though those code blocks were the same. Added a possible bugfix that could interrumpt the attack script in very rare cases. * restore missing hook 1 hook for saving the Team kills was lost during the merges. * post-merge fix in Readme file * Added the last Action 110 * Fixed bug in Action Argument 20 & new argument 35 Argument 35 is the old Argument 20 that covers Land vehicle factory and Naval factory. Now Argument 20 ignores Naval factories * Fixes and small improvements * Changed the 103,0 behavior due to feedback Gallback to CloseEnough value in Rulesmd.ini * Point to latest YRpp * Changes in how is stored the selected target * Added function for finding the Team Leader helper function * Fix a potential crash * fix missing break statement * · Fixed bug that made AI pick dead units as targets. · Replaced Armor comparison when selecting possible new targets by a new comparison based on total damage produced by the selected weapon. · Fixed "Case 33" in EvaluateObjectWithMask(...) · Small tweaks in Debug lines. * improvement for unknown actions * small change
1 parent 03deae5 commit be60dca

File tree

10 files changed

+636
-180
lines changed

10 files changed

+636
-180
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ Credits
8787
- **secsome (SEC-SOME)** - debug info dump hotkey, refactoring & porting of Ares helper code, introducing more Ares-derived stuff, disguise removal warhead, Mind Control removal warhead, Mind Control enhancement, shields, AnimList.PickRandom, MoveToCell fix, unlimited waypoints, Build At trigger action buildup anim fix, Undeploy building into a unit plays `EVA_NewRallyPointEstablished` fix, custom ore gathering anim, TemporaryClass related crash, Retry dialog on mission failure, Default disguise for individual InfantryTypes, PowerPlant Enhancer, SaveGame Trigger Action, QuickSave command, Numeric variables, Custom gravity for projectiles, Retint map actions bugfix
8888
- **Otamaa (Fahroni, BoredEXE)** - help with CellSpread, ported and fixed custom RadType code, togglable ElectricBolt bolts, customizable Chrono Locomotor properties per TechnoClass, DebrisMaximums fixes, Anim-to-Unit, NotHuman anim sequences improvements, Customizable OpenTopped Properties, hooks for ScriptType Actions 92 & 93, ore stage threshold for `HideIfNoOre`, occupied building `MuzzleFlashX` bugfix
8989
- **E1 Elite** - TileSet 255 and above bridge repair fix
90-
- **FS-21** - Dump Object Info enhancements, Powered.KillSpawns, Spawner.LimitRange, ScriptType Actions 71, 72, 73, 74 to 81, 92, 93, 94, 95 to 98, 111, 112, MC deployer fixes, help with docs, Automatic Passenger Deletion
90+
- **FS-21** - Dump Object Info enhancements, Powered.KillSpawns, Spawner.LimitRange, ScriptType Actions 71 to 112, MC deployer fixes, help with docs, Automatic Passenger Deletion
9191
- **AutoGavy** - interceptor logic, warhead critical damage system
9292
- **ChrisLv_CN** - interceptor logic, LaserTrails, laser fixes, general assistance (work relicensed under [following permission](images/ChrisLv-relicense.png))
9393
- **Xkein** - general assistance, YRpp edits

YRpp

docs/New-or-Enhanced-Logics.md

Lines changed: 42 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -871,7 +871,7 @@ In `aimd.ini`:
871871
x=83,n
872872
```
873873

874-
### `84-91` `AITargetTypes` Attack Action
874+
### `84-91`, `104-105` `AITargetTypes` Attack Action
875875

876876
- These Actions instruct the TeamType to use the TaskForce to approach and attack the target specified by the second parameter which is an index of a modder-defined group from `AITargetTypess`. Look at the tables below for the possible Actions (first parameter value) and Arguments (the second parameter value).
877877
- For threat-based attack actions `TargetSpecialThreatCoefficientDefault` and `EnemyHouseThreatBonus` tags from `rulesmd.ini` are accounted.
@@ -880,7 +880,7 @@ x=83,n
880880
In `aimd.ini`:
881881
```ini
882882
[SOMESCRIPTTYPE] ; ScriptType
883-
x=i,n ; where 84 <= i <= 91
883+
x=i,n ; where 84 <= i <= 91 or 104 <= i <= 105
884884
```
885885

886886
| *Action* | *Argument* | *Repeats* | *Target Priority* | *Description* |
@@ -893,6 +893,8 @@ x=i,n ; where 84 <= i <= 91
893893
89 | `AITargetTypes` index# | No | Farther, higher threat | Ends when a team member kill the designated target |
894894
90 | `AITargetTypes` index# | No | Closer | Ends when a team member kill the designated target |
895895
91 | `AITargetTypes` index# | No | Farther | Ends when a team member kill the designated target |
896+
104 | `AITargetTypes` index# | Yes | Closer | Picks 1 random target from the list |
897+
105 | `AITargetTypes` index# | Yes | Farther | Picks 1 random target from the list |
896898

897899
- The second parameter with a 0-based index for the `AITargetTypes` section specifies the list of possible `VehicleTypes`, `AircraftTypes`, `InfantryTypes` and `BuildingTypes` that can be evaluated. The new `AITargetTypes` section must be declared in `rulesmd.ini` for making this script work:
898900

@@ -944,14 +946,14 @@ In `rulesmd.ini`:
944946
; ...
945947
```
946948

947-
### `95-98` Moving Team to techno location
949+
### `95-98`, `106-109` Moving Team to techno location
948950

949951
- These Actions instructs the TeamType to use the TaskForce to approach the target specified by the second parameter. Look at the tables below for the possible Actions (first parameter value).
950952

951953
In `aimd.ini`:
952954
```ini
953955
[SOMESCRIPTTYPE] ; ScriptType
954-
x=i,n ; where 95 <= i <= 98
956+
x=i,n ; where 95 <= i <= 98 or 106 <= i <= 109
955957
```
956958

957959
| *Action* | *Argument* | Target Owner | *Target Priority* | *Description* |
@@ -960,6 +962,42 @@ x=i,n ; where 95 <= i <= 98
960962
96 | Target Type# | Enemy | Farther, higher threat | |
961963
97 | Target Type# | Friendly | Closer | |
962964
98 | Target Type# | Friendly | Farther | |
965+
99 | [AITargetType] index# | Enemy | Closer, higher threat | |
966+
100 | [AITargetType] index# | Enemy | Farther, higher threat | |
967+
101 | [AITargetType] index# | Friendly | Closer | |
968+
102 | [AITargetType] index# | Friendly | Farther | |
969+
106 | [AITargetType] index# | Enemy | Closer | Picks 1 random target from the selected list |
970+
107 | [AITargetType] index# | Enemy | Farther | Picks 1 random target from the selected list |
971+
108 | [AITargetType] index# | Friendly | Closer | Picks 1 random target from the selected list |
972+
109 | [AITargetType] index# | Friendly | Farther | Picks 1 random target from the selected list |
973+
974+
### `103` Modify Target Distance
975+
976+
- By default Movement actions `95-102` & `106-109` ends when the Team Leader reaches a distance declared in rulesmd.ini called CloseEnough. When this action is executed before the Movement actions `95-102` overwrites CloseEnough value. This action works only the first time and CloseEnough will be used again the next Movement action.
977+
978+
In `aimd.ini`:
979+
```ini
980+
[SOMESCRIPTTYPE] ; ScriptType
981+
x=103,n
982+
```
983+
984+
### `110` Set Move Action End Mode
985+
986+
- Sets how the Movement actions ends and jumps to the next line. This action works only the first time and CloseEnough will be used again the next Movement action.
987+
988+
In `aimd.ini`:
989+
```ini
990+
[SOMESCRIPTTYPE] ; ScriptType
991+
x=110,n
992+
```
993+
994+
- The possible argument values are:
995+
996+
| *Argument* | *Action ends when...* |
997+
| :------: | :-------------------------------------------: |
998+
0 | Team Leader reaches the minimum distance |
999+
1 | One unit reaches the minimum distance |
1000+
2 | All team members reached the minimum distance |
9631001

9641002
### `111` Un-register Team success
9651003

docs/Whats-New.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -237,12 +237,14 @@ New:
237237
- XDrawOffset for animations (by Morton)
238238
- Customizable OpenTopped properties (by Otamaa)
239239
- Automatic Passenger Deletion (by FS-21)
240-
- Script Action 74 to 81 and 84 to 91 for new AI attacks (by FS-21)
240+
- Script Action 74 to 81, 84 to 91 and 104 to 105 for new AI attacks (by FS-21)
241241
- Script Actions 82 & 83 for modifying AI Trigger Current Weight (by FS-21)
242242
- Script Action 92 for waiting & repeat the same new AI attack if no target was found (by FS-21)
243243
- Script Action 93 that modifies the Team's Trigger Weight when ends the new attack action (by FS-21)
244244
- Script Action 94 for picking a random script from a list (by FS-21)
245-
- Script Action 95 to 98 for new AI movements towards certain objects (by FS-21)
245+
- Script Action 95 to 102 and 106 to 109 for new AI movements towards certain objects (by FS-21)
246+
- Script Action 103 that Modify Target Distance in the new move actions (by FS-21)
247+
- Script Action 110 that Modify how ends the new move actions (by FS-21)
246248
- Script Action 111 that un-register Team success, is just the opposite effect of Action 49 (by FS-21)
247249
- Script Action 112 to regroup temporarily around the Team Leader (by FS-21)
248250
- ObjectInfo now shows current Target and AI Trigger data (by FS-21)

src/Ext/Rules/Body.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ void RulesExt::ExtData::LoadBeforeTypeData(RulesClass* pThis, CCINIClass* pINI)
7272
this->MissingCameo.Read(pINI, "AudioVisual", "MissingCameo");
7373
this->JumpjetAllowLayerDeviation.Read(exINI, "JumpjetControls", "AllowLayerDeviation");
7474

75-
// Section AITargetType
75+
// Section AITargetTypes
7676
int itemsCount = pINI->GetKeyCount(sectionAITargetTypes);
7777
for (int i = 0; i < itemsCount; ++i)
7878
{

0 commit comments

Comments
 (0)