Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
89 commits
Select commit Hold shift + click to select a range
fc9d1ba
Initial commit
FS-21 Oct 26, 2021
176b038
Merge remote-tracking branch 'origin/develop' into feature/script-act…
FS-21 Oct 27, 2021
7080aa1
move action 113 to 120
FS-21 Oct 28, 2021
d1d3af2
added aggro action
FS-21 Nov 8, 2021
72f82f5
improvements
FS-21 Nov 10, 2021
327ddea
Merge branch 'develop' into feature/script-action-houses-anger
FS-21 Nov 15, 2021
4eea7a2
Merge branch 'develop' into feature/script-action-houses-anger
FS-21 Nov 15, 2021
0ea00ab
new features when finding the most hateful house
FS-21 Nov 15, 2021
a6badea
debug fixes
FS-21 Nov 15, 2021
b0fed20
Some fixes & improvements
FS-21 Nov 18, 2021
2589daa
Update src/Ext/Script/Body.cpp
FS-21 Nov 21, 2021
bbb1a81
Update src/Ext/Script/Body.cpp
FS-21 Nov 21, 2021
54e8894
Update src/Ext/Script/Body.cpp
FS-21 Nov 21, 2021
f96e576
Update src/Ext/Script/Body.cpp
FS-21 Nov 21, 2021
b386b46
Update src/Ext/Script/Body.cpp
FS-21 Nov 21, 2021
f693142
Update src/Ext/Script/Body.cpp
FS-21 Nov 21, 2021
ce0fbe8
fixes
FS-21 Nov 21, 2021
5decc70
Merge branch 'develop' into feature/script-action-houses-anger
FS-21 Nov 24, 2021
1f9abd2
Added debug lines
FS-21 Nov 29, 2021
412d7e7
Remove some useless comments
FS-21 Nov 29, 2021
c74d648
improvement for unknown actions
FS-21 Nov 30, 2021
beb614d
Merge branch 'develop' into feature/script-action-houses-anger
FS-21 Dec 27, 2021
08a9b81
small fix
FS-21 Dec 27, 2021
aacdcc0
Point to latest YRpp
FS-21 Dec 27, 2021
9d9c17a
Merge branch 'develop' into feature/script-action-houses-anger
FS-21 Jan 14, 2022
ebb0e64
Update YYpr
FS-21 Jan 14, 2022
0c93a2e
removing unnecessary lines
FS-21 Jan 14, 2022
ffc1302
Merge remote-tracking branch 'FS-21/develop' into feature/script-acti…
FS-21 Jan 22, 2022
4942a41
Merge branch 'develop' into feature/script-action-houses-anger
FS-21 Mar 4, 2022
b4ac77e
Point to latest YRpp
FS-21 Mar 4, 2022
1b91d93
Added AngerNodes documentation
FS-21 Mar 4, 2022
138b2c3
Small information change in action 114
FS-21 Mar 4, 2022
156b588
Merge remote-tracking branch 'origin/develop' into feature/script-act…
FS-21 Mar 7, 2022
007cffa
Point to latest YRpp
FS-21 Mar 9, 2022
16ed163
Merge branch 'develop' into feature/script-action-houses-anger
FS-21 Mar 13, 2022
375038d
Merge branch 'develop' into feature/script-action-houses-anger
FS-21 Mar 15, 2022
f9a5559
Merge branch 'develop' into feature/script-action-houses-anger
FS-21 Apr 7, 2022
aafa7f8
point to latest YRpp
FS-21 Apr 7, 2022
7dc644a
FS-21 Apr 9, 2022
557e434
Merge branch 'develop' into feature/script-action-houses-anger
FS-21 Apr 10, 2022
46ae6ed
point to latest YRpp
FS-21 Apr 10, 2022
dbbf0b7
Merge branch 'develop' into feature/script-action-houses-anger
FS-21 Apr 10, 2022
02e7afa
Merge branch 'develop' into feature/script-action-houses-anger
FS-21 Apr 17, 2022
94cdad2
Merge branch 'develop' into feature/script-action-houses-anger
FS-21 Jul 4, 2022
a680fcc
Point to latest YRpp
FS-21 Oct 17, 2022
7f80a31
Merge remote-tracking branch 'origin/develop' into feature/script-act…
FS-21 Oct 17, 2022
0dcecfe
updated documentation and other missing bits
FS-21 Oct 17, 2022
bbe08b1
Extra debug info
FS-21 Oct 17, 2022
b3d71ce
small fix
FS-21 Oct 17, 2022
d904d71
.
FS-21 Oct 17, 2022
0034449
Fixed bug
FS-21 Dec 5, 2022
cd47838
Merge branch 'develop' into feature/script-action-houses-anger
FS-21 Dec 5, 2022
d175e0a
Merge branch 'develop' into feature/script-action-houses-anger
FS-21 Feb 12, 2023
60782ac
Compilation fixes
FS-21 Feb 12, 2023
f76fd7b
Tweaks
FS-21 Feb 12, 2023
9aaceeb
tweaks and small changes
FS-21 Feb 12, 2023
5cb74db
Merge branch 'develop' into feature/script-action-houses-anger
FS-21 May 27, 2023
3e73bab
YRpp
FS-21 Jul 22, 2023
8906a85
Merge branch 'develop' into feature/script-action-houses-anger
FS-21 Jul 22, 2023
5bf725f
YRpp fix
FS-21 Jul 22, 2023
2b8862e
Merge branch 'develop' into feature/script-action-houses-anger
FS-21 Sep 22, 2023
675d708
Merge branch 'develop' into feature/script-action-houses-anger
FS-21 Sep 25, 2023
469187a
Merge remote-tracking branch 'origin/develop' into feature/script-act…
FS-21 Mar 10, 2024
826f0c1
Merge remote-tracking branch 'origin/develop' into feature/script-act…
FS-21 Mar 10, 2024
848881b
Merge branch 'develop' into feature/script-action-houses-anger
FS-21 Mar 12, 2024
15c2592
Merge branch 'develop' into feature/script-action-houses-anger
FS-21 Apr 29, 2024
8a5f2c5
Moved code into a new file and updated code
FS-21 Apr 29, 2024
a700b06
Tweak
FS-21 May 1, 2024
5d8bc3a
Refactored code
FS-21 Jul 13, 2024
d4de5c3
Small teak
FS-21 Jul 13, 2024
f2d1480
small tweak
FS-21 Jul 13, 2024
f29da38
tweaks
FS-21 Jul 13, 2024
11449a9
Update src/Ext/Script/Body.AngerNodes.cpp
FS-21 Jul 13, 2024
0c159a0
Merge branch 'develop' into feature/script-action-houses-anger
FS-21 Jul 14, 2024
a20af99
Merge remote-tracking branch 'origin/develop' into feature/script-act…
FS-21 Aug 29, 2024
535d929
FA2 documentation
FS-21 Aug 29, 2024
9474ea9
Merge branch 'develop' into feature/script-action-houses-anger
FS-21 Aug 30, 2024
31676c9
Merge branch 'develop' into feature/script-action-houses-anger
FS-21 Oct 27, 2024
e9a8d92
Merge branch 'develop' into feature/script-action-houses-anger
FS-21 Oct 28, 2024
c9260f2
Merge branch 'develop' into feature/script-action-houses-anger
FS-21 Feb 18, 2025
0a738cd
Merge branch 'develop' into feature/script-action-houses-anger
FS-21 May 20, 2025
5dfb900
Merge branch 'develop' into feature/script-action-houses-anger
FS-21 May 24, 2025
0d6ea74
Merge branch 'develop' into feature/script-action-houses-anger
FS-21 May 29, 2025
bf6196b
Merge branch 'develop' into feature/script-action-houses-anger
FS-21 May 30, 2025
f81fca6
Merge branch 'develop' into feature/script-action-houses-anger
FS-21 Jun 8, 2025
959b253
Merge remote-tracking branch 'origin/develop' into feature/script-act…
FS-21 Jul 7, 2025
eb2182a
Merge branch 'develop' into feature/script-action-houses-anger
FS-21 Aug 7, 2025
51317cb
Update YRpp
FS-21 Aug 7, 2025
d240315
Merge branch 'develop' into feature/script-action-houses-anger
FS-21 Sep 2, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CREDITS.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ This page lists all the individual contributions to the project by their author.
- Warhead activation target health thresholds enhancements
- Event 606: AttachEffect is attaching to a Techno
- Linked superweapons
- Script actions for modifying AI anger against other houses
- **Starkku**:
- Misc. minor bugfixes & improvements
- AI script actions:
Expand Down
1 change: 1 addition & 0 deletions Phobos.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
<ClCompile Include="src\Ext\ParticleType\Hooks.cpp" />
<ClCompile Include="src\Ext\Scenario\Hooks.cpp" />
<ClCompile Include="src\Ext\Scenario\Hooks.Variables.cpp" />
<ClCompile Include="src\Ext\Script\Body.AngerNodes.cpp" />
<ClCompile Include="src\Ext\Sidebar\Body.cpp" />
<ClCompile Include="src\Ext\Sidebar\Hooks.cpp" />
<ClCompile Include="src\Ext\Surface\Body.cpp" />
Expand Down
168 changes: 168 additions & 0 deletions docs/AI-Scripting-and-Mapping.md
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,174 @@ In `aimd.ini`:
x=14003,0
```

### `14005` Override OnlyTargetHouseEnemy Value

- The value of the tag `OnlyTargetHouseEnemy` in AI triggers can be modified for the new attack & move actions. Only affects the next new attack or move action script.
- These anger values are applied only in the house owner of the team.
- Only works for new Phobos actions, not vanilla YR or Ares actions.

In `aimd.ini`:
```ini
[SOMESCRIPTTYPE] ; ScriptType
x=14005,n ; integer n=-1
```

- The possible argument values are:

| *Argument* | *Description* |
| :--------: | :-------------------------------------------: |
| -1 | Use default value specified in `OnlyTargetHouseEnemy` |
| 0 | Force `OnlyTargetHouseEnemy` value to `FALSE` |
| 1 | Force `OnlyTargetHouseEnemy` value to `TRUE` |
| 2 | Force `OnlyTargetHouseEnemy` value to `TRUE` or `FALSE` randomly |

### `14006` Set House Hate Value Modifier

- Affects how much hate applies to a selected house (depends of the script action).
- Positive values increase hate and negative values decrease hate.
- Affects script actions: `14007`, `14008`, `14009`, `14010`, `14011` & `14012`.

In `aimd.ini`:
```ini
[SOMESCRIPTTYPE] ; ScriptType
x=14006,n ; integer n=0
```

### `14007` Modify House Hate Using House Index

- Modifies the team's hate towards a specific house using its house index.

In `aimd.ini`:
```ini
[SOMESCRIPTTYPE] ; ScriptType
x=14007,n ; integer n >= 0
```

### `14008` Modify Hate Values From A List Of Countries

- The house team picks a list of countries from the `rulesmd.ini` section called `[AIHousesList]`.
- The house team modify the hate towards all houses in the map that use the countries in that list.

In `aimd.ini`:
```ini
[SOMESCRIPTTYPE] ; ScriptType
x=14008,n ; integer n >= 0
```

The second parameter is a 0-based index for the `AIHousesList` section that specifies the list of possible `Countries` that can be evaluated. The new `AIHousesList` section must be declared in `rulesmd.ini` for making this script work:

In `rulesmd.ini`:
```ini
[AIHousesList] ; List of Countries lists
0=SOMECOUNTRY,SOMEOTHERCOUNTRY,SAMPLECOUNTRY
1=ANOTHERCOUNTRY,YETANOTHERCOUNTRY
; ...
```

### `14009` Modify Hate Value Against A Random Country From A List Of Countries

- Like action `14008` but the house owner of the Team only picks 1 house randomly from the specified list of countries.
- The house team modify the hate towards all houses in the map that use the selected country.

In `aimd.ini`:
```ini
[SOMESCRIPTTYPE] ; ScriptType
x=14009,n ; integer n >= 0
```

### `14010` Set The Most Hated House ("<" Comparison)

- Increases the team house hate against an enemy house making that enemy house as the main target.

In `aimd.ini`:
```ini
[SOMESCRIPTTYPE] ; ScriptType
x=14010,n ; integer
```

The possible argument values are:

| *Argument* | *Description* |
| :------: | :-------------------------------------------: |
| -10 | The house with less factories is selected (excluded the aircraft factories) |
| -9 | The house with less aircraft docks is selected |
| -8 | The house with less naval units is selected |
| -7 | The house with less house kills is selected |
| -6 | The house with less free power (free = production - consumption) is selected |
| -5 | The house with less power production is selected |
| -4 | The house with less power consumption is selected |
| -3 | The nearest enemy Human base is selected |
| -2 | The poorest house is selected |
| -1 | The enemy house with nearest unit to the Team Leader is selected |
| > 0 | *Target Type#* index. The house with less threat of the selected *Target Type#* (sum of all the units of the same checked type * threat value) |

### `14011` Set The Most Hated House (">" Comparison)

- Increases the team house hate against an enemy house making that enemy house as the main target.

In `aimd.ini`:
```ini
[SOMESCRIPTTYPE] ; ScriptType
x=14011,n ; integer
```

The possible argument values are:

| *Argument* | *Description* |
| :--------: | :-------------------------------------------: |
| -10 | The house with more factories is selected (excluded the aircraft factories) |
| -9 | The house with more aircraft docks is selected |
| -8 | The house with more naval units is selected |
| -7 | The house with more kills is selected |
| -6 | The house with more free power (free = production - consumption) is selected |
| -5 | The house with more power production is selected |
| -4 | The house with more power consumption is selected |
| -3 | The farthest enemy Human base is selected |
| -2 | The richest house is selected |
| -1 | The enemy house with farthest unit to the Team Leader is selected |
| > 0 | *Target Type#* index. The house with more threat of the selected *Target Type#* (sum of all the units of the same checked type * threat value) |

### `14012` Set The Most Hated House Randomly

- Increases the Team house hate against an enemy house picked randomly.

In `aimd.ini`:
```ini
[SOMESCRIPTTYPE] ; ScriptType
x=14012,0
```

### `14013` Reset Hate Against Other Houses

- All hate levels in the team house against every House are set to 0.

In `aimd.ini`:
```ini
[SOMESCRIPTTYPE] ; ScriptType
x=14013,0
```

### `14014` Set A House As The Most Hated House Of The Map

- A House will become the most hated House of the map (the effects are only visible if the other houses are enemies of the selected house)

In `aimd.ini`:
```ini
[SOMESCRIPTTYPE] ; ScriptType
x=14014,n ; integer
```

The possible argument values are:

| *Argument* | *Description* |
| :--------: | :-------------------------------------------: |
| -5 | Selects a random House, including civilians. The own house is excluded in the selection of the most hated by everyone |
| -4 | Any random civilian house |
| -3 | All Human players will be hated by everyone |
| -2 | The Team House will be the most hated by everyone (allies won't pick allies as enemies) |
| -1 | Selects a random House. The own house & civilians are excluded in the selection of the most hated by everyone |
| >= 0 | House index that will be hated by everyone |

### `16000-16999` Flow Control

#### `16000` Start a Timed Jump to the Same Line
Expand Down
5 changes: 4 additions & 1 deletion docs/New-or-Enhanced-Logics.md
Original file line number Diff line number Diff line change
Expand Up @@ -2608,7 +2608,10 @@ OmniFire.TurnToTarget=no ; boolean

- In addition to allowing custom radiation types, several enhancements are also available to the default radiation type defined in `[Radiation]`, such as ability to set owner & invoker or deal damage against buildings. See [Custom Radiation Types](#custom-radiation-types) for more details.

### Strafing aircraft weapon customization
### `500 - 523` Edit Variable
- Operate a variable's value
- The variable's value type is int16 instead of int32 in trigger actions for some reason, which means it ranges from -2^15 to 2^15-1.
- Any numbers exceeding this limit will lead to unexpected results!

![image](_static/images/strafing-01.gif)
*Strafing aircraft weapon customization in [Project Phantom](https://www.moddb.com/mods/project-phantom)*
Expand Down
14 changes: 14 additions & 0 deletions docs/Whats-New.md
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,15 @@ HideLightFlashEffects=false ; boolean
10102=Regroup Temporarily Around the Team Leader,20,0,1,[LONG DESC]
10103=Load Onto Transports,0,0,1,[LONG DESC]
10104=Chronoshift to Enemy Base,20,0,1,[LONG DESC]
14006=Set House Hate Value Modifier,20,0,1,[LONG DESC]
14007=Modify House Hate Using House Index,20,0,1,[LONG DESC]
14008=Modify Hate Values From A List Of Countries,28,0,1,[LONG DESC]
14009=Modify Hate Value Against A Random Country From A List Of Countries,28,0,1,[LONG DESC]
14010=Set The Most Hated House ("<" Comparison),20,0,1,[LONG DESC]
14011=Set The Most Hated House (">" Comparison),20,0,1,[LONG DESC]
14012=Set The Most Hated House Randomly,0,0,1,[LONG DESC]
14013=Reset Hate Against Other Houses,0,0,1,[LONG DESC]
14014=Set A House As The Most Hated House Of The Map,20,0,1,[LONG DESC]
18000=Local variable set,22,0,1,[LONG DESC]
18001=Local variable add,22,0,1,[LONG DESC]
18002=Local variable minus,22,0,1,[LONG DESC]
Expand Down Expand Up @@ -321,6 +330,10 @@ HideLightFlashEffects=false ; boolean
25=Local variables,-4
26=Global variables,-5
27=Global variables,-6
28=AI Houses List, -7

[ScriptParamTypes]
7=AIHousesList,1,1,0
```
````

Expand Down Expand Up @@ -941,6 +954,7 @@ New:
- Script action to regroup temporarily around the Team Leader (by FS-21)
- Script action to randomly skip next action (by FS-21)
- Script action for timed script action jumps (by FS-21)
- Script action for modifying AI anger against other houses (by FS-21)
- ObjectInfo now shows current Target and AI Trigger data (by FS-21)
- Shield absorption and passthrough customization (by Morton)
- Limbo Delivery of buildings (by Morton)
Expand Down
1 change: 1 addition & 0 deletions src/Commands/ObjectInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

#include <Ext/TechnoType/Body.h>
#include <Ext/Techno/Body.h>
#include <Ext/Script/Body.h>

const char* ObjectInfoCommandClass::GetName() const
{
Expand Down
21 changes: 21 additions & 0 deletions src/Ext/Rules/Body.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
#include <Utilities/TemplateDef.h>
#include <FPSCounter.h>
#include <GameOptionsClass.h>
#include <HouseTypeClass.h>
#include <GameStrings.h>

#include <Ext/BulletType/Body.h>
#include <Ext/TechnoType/Body.h>
Expand Down Expand Up @@ -350,6 +352,24 @@ void RulesExt::ExtData::LoadBeforeTypeData(RulesClass* pThis, CCINIClass* pINI)

this->AIScriptsLists.emplace_back(std::move(objectsList));
}

// Section AIHousesList
int houseItemsCount = pINI->GetKeyCount("AIHousesList");
for (int i = 0; i < houseItemsCount; ++i)
{
std::vector<HouseTypeClass*> objectsList;

char* context = nullptr;
pINI->ReadString("AIHousesList", pINI->GetKeyName("AIHousesList", i), "", Phobos::readBuffer);

for (char* cur = strtok_s(Phobos::readBuffer, Phobos::readDelims, &context); cur; cur = strtok_s(nullptr, Phobos::readDelims, &context))
{
if (const auto pNewHouse = HouseTypeClass::Find(cur))
objectsList.emplace_back(pNewHouse);
}

this->AIHousesLists.emplace_back(std::move(objectsList));
}
}

// this should load everything that TypeData is not dependant on
Expand Down Expand Up @@ -389,6 +409,7 @@ void RulesExt::ExtData::Serialize(T& Stm)
Stm
.Process(this->AITargetTypesLists)
.Process(this->AIScriptsLists)
.Process(this->AIHousesLists)
.Process(this->Storage_TiberiumIndex)
.Process(this->HarvesterDumpAmount)
.Process(this->InfantryGainSelfHealCap)
Expand Down
1 change: 1 addition & 0 deletions src/Ext/Rules/Body.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ class RulesExt
public:
std::vector<std::vector<TechnoTypeClass*>> AITargetTypesLists;
std::vector<std::vector<ScriptTypeClass*>> AIScriptsLists;
std::vector<std::vector<HouseTypeClass*>> AIHousesLists;

Valueable<int> Storage_TiberiumIndex;
Valueable<float> HarvesterDumpAmount;
Expand Down
Loading
Loading