Sorian AI Script Helper

Everything about mods can be found here.

Moderator: Morax

Sorian AI Script Helper

Postby Uveso » 29 Mar 2016, 23:28

@ Krapougnak (and whoever is reading this).

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
Last edited by Uveso on 09 Apr 2016, 20:04, edited 7 times in total.
User avatar
Uveso
Supreme Commander
 
Posts: 1788
Joined: 11 Dec 2015, 20:56
Location: Germany
Has liked: 70 times
Been liked: 291 times
FAF User Name: Uveso

Re: Sorian AI Script Helper

Postby Krapougnak » 30 Mar 2016, 14:31

Thank you Uveso, I will definitely try your mod this week-end, I have a lot of units in my custom compilation mod that aren't build by the AI so maybe your mod will help me to identify them and give them the right platoon inside customunits. 8-)
User avatar
Krapougnak
Contributor
 
Posts: 340
Joined: 12 Jul 2012, 11:03
Has liked: 193 times
Been liked: 24 times
FAF User Name: Krapougnak

Re: Sorian AI Script Helper

Postby Uveso » 05 Apr 2016, 12:25

v3.5

I added a ceck for lod0.scm and lod1scm files. Press [SHIFT]+[m]

This will validate filepath and filenames for Display.Mesh.LODs.MeshName (unitid_LOD0.scm and unitid_LOD1.scm)
(prevents [WARNING: GetResource: Invalid name ""] error in some cases)

It also suggest to set the IconFadeInZoom to 130, if the blueprint has a different zoom value.
User avatar
Uveso
Supreme Commander
 
Posts: 1788
Joined: 11 Dec 2015, 20:56
Location: Germany
Has liked: 70 times
Been liked: 291 times
FAF User Name: Uveso

Re: Sorian AI Script Helper

Postby Uveso » 06 Apr 2016, 15:43

V3.6

[SHIFT]+[m] checks now the following files and filepath inside unit blueprint:

..Mesh.scm
..Albedo.dds
..Normals.dds
..Specular.dds

It also scanns the files on disk and will find misstyped path's and files.
Also hoocked units are checked for correct filepath.
User avatar
Uveso
Supreme Commander
 
Posts: 1788
Joined: 11 Dec 2015, 20:56
Location: Germany
Has liked: 70 times
Been liked: 291 times
FAF User Name: Uveso

Re: Sorian AI Script Helper

Postby Krapougnak » 09 Apr 2016, 07:48

Link is broken.
User avatar
Krapougnak
Contributor
 
Posts: 340
Joined: 12 Jul 2012, 11:03
Has liked: 193 times
Been liked: 24 times
FAF User Name: Krapougnak

Re: Sorian AI Script Helper

Postby Uveso » 09 Apr 2016, 20:01

Oh you are right, V3.6 is "uvesodebug36.rar" and not "uvesodebug35.rar"

Link is updated :)
User avatar
Uveso
Supreme Commander
 
Posts: 1788
Joined: 11 Dec 2015, 20:56
Location: Germany
Has liked: 70 times
Been liked: 291 times
FAF User Name: Uveso


Return to Mods & Tools

Who is online

Users browsing this forum: No registered users and 1 guest