Creating scripts for the Sorian Ai is verry simple.
Lets say you have a T1 Powerdefence with the UnitId "UEB0001" for UEF, and a PD Unit "XSB0001" for Seraphim.
Now create a new directory inside you modfolder named "lua"
Inside the Lua folder create a new directory named "customunits"
Now create an empty textfile and name it "TestPD.lua"
Copy this to TestPD.lua:
- Code: Select all
UnitList = {
T1GroundDefense = {
UEF = {'UEB0001', 50}, -- TECH1 Powerdefence
Seraphim = {'XSB0001', 50}, -- TECH1 Powerdefence
},
}
Thats all. Now the Ai can Build the Unit UEB0001 and XSB0001 as T1 Ground Defence.
if u want the Ai to build more units of this type, increase the "50" after the UnitID to 100 or 200. it's the Buildpriority
If u are now using my mod and simply press [SHIFT]+[a], you will see inside the Logwindow something like this:
- Code: Select all
INFO: Uveso Debugger: [UnitDebug.lua 714] - Unit UEB0001 veryfied, has Icon but no AI Support. Name:(Hammer) (Tech 1 Power Defence)
INFO: T1GroundDefense = {
INFO: UEF = {'UEB0001', 50}, -- Name: Hammer(Tech 1 Power Defence)
INFO: },
You simply copy this into any x.lua inside customunits and the AI will use it.
Some other functions from the Mod:
[SHIFT]+[c] Checks the Unitblueprint for common Erros like wrong Techlevel, missing Targetlayers etc. Also see DebugWindow for Reports.
[SHIFT]+[s] Plays all Unitsounds inside the Audio Array. Turn you spakers to low, if u use it. May freeze you game for 20-30 seconds.
[SHIFT]+[w] Same as [s] but plays the Weaponsounds of all customunits.
[SHIFT]+[m] Checks Display.Lod. Looking for missing Mesh, Albedo, Normals and Specular files in Unitfolder.
[SHIFT]+[q] is empty. Its executing the function Check(uID,uBP) inside UnitDebug.lua at line 1041. Its just for testing.
There are also some Hooks for testing and playing aginst the Sorian AI:
/Mods/Uveso Debugger/hook/lua/AI/SorianDefenseBuilders.lua:
With this hook, the AI is able to build T3 GroundDefences for all races, not only UEF, like default.
/Mods/Uveso Debugger/hook/lua/AI/SorianExperimentalBuilders.lua:
This allows the Ai to Build up to 4 land and 2 Air Experimentals at the same time. I also removed T4AirAttackCondition and some other functions that stops the AI from building Experimentals. Its also makes the T4EconExperimental (Paragon like structures) available for all races, not only Aeon.
/Mods/Uveso Debugger/hook/lua/sim/Unit.lua:
Inside the Unit.lua is a additional Cheat for the AI. After 30 minutes the Ai can Build everything at 1/100 Cost. (Buildfactor isn't changed)
/Mods/Uveso Debugger/hook/lua/ui/game/unitviewDetail.lua:
This is only a small bugfix for the unitTooltip. Its also displaying the UnitID for the actuall Unit.
Finaly there are 4 customunits (one for each faction). This unit moves automaticaly to the next wreck/mass/energy object and reclaim it. if u want the unit to stop, just disable cloak. I use the Unit for testing scripts etc. (Can be build in Tech1 Landfactory)
Well, i hope you can use it in any way.
greetings Uveso.
ModDownload:
[Edit] Version 3.6:
http://faforever.uveso.de/uvesodebug36.rar