RelicNews Forums

Go Back   RelicNews Forums > RDN - Relic Game Mods > Homeworld 2 - Tanis Shipyards
User Name
Password
Register FAQ Members List Arcade Mark Forums Read



Closed Thread
 
Thread Tools
Old 18th Oct 03, 6:51 AM   # 1
starfleet
Guest
 

Lua Translation needed - Or AI won't build any additional Ships :(

If some one could translate the build, resource, research, submodule, classdef, military lua's from the ai directory would be helpful with out them anything new you add won't be built by the cpu at all.... which as you can imagin is highly annoying.

hrmm.. Nixs that by looking at the ClassDef file i think that is the one that is needed to be done for new classes to be built and i'm thinking submodule is the one for the submodules.

Last edited by starfleet : 18th Oct 03 at 6:56 AM.
 
Old 19th Oct 03, 12:44 AM   # 2
starfleet
Guest
 

Ok this is a list of the files that it appears you need to edit to get the AI to recongnise that there are new units etc and to build them notes and if it's translated is next to it

Classdef.lua - This file sets each craft into a set class, it has been translated by Thought and allows the AI To reckonise that the units exist are threats etc etc. But not to build them.

Debug Info notes are in red
Code:
-- Karos Graveyard -- Homeworld 2 Scripting Wiki -- -- Created by Thought (http://hw2.tproc.org) -- Translated: ai/classdef.lua aitrace("CPU: CLASSDEF LOADED") -- Do NOT CHANGE THIS squadclass = {} --Do NOT CHANGE THIS -- This next section is what ships belong to each class add ships in as they are needed squadclass[eMotherShip] = {HGN_MOTHERSHIP, VGR_MOTHERSHIP, VGR_MOTHERSHIP_MAKAAN} squadclass[eCollector] = {HGN_RESOURCECOLLECTOR, VGR_RESOURCECOLLECTOR} squadclass[eScout] = {HGN_SCOUT, HGN_SCOUT2, HGN_PROBE, HGN_PROXIMITYSENSOR, HGN_ECMPROBE, VGR_SCOUT, VGR_PROBE, VGR_PROBE_PROX, VGR_PROBE_ECM} squadclass[eRefinery] = {HGN_RESOURCECONTROLLER, VGR_RESOURCECONTROLLER} squadclass[eBuilder] = {HGN_MOTHERSHIP, HGN_CARRIER, HGN_ESCORTCARRIER, HGN_SHIPYARD, VGR_MOTHERSHIP, VGR_MOTHERSHIP_MAKAAN, VGR_CARRIER, VGR_SHIPYARD} squadclass[eDropOff] = {HGN_MOTHERSHIP, HGN_CARRIER, HGN_ESCORTCARRIER, HGN_SHIPYARD, HGN_RESOURCECONTROLLER, VGR_MOTHERSHIP, VGR_MOTHERSHIP_MAKAAN, VGR_CARRIER, VGR_SHIPYARD, VGR_RESOURCECONTROLLER} squadclass[eSalvageDropOff] = {HGN_MOTHERSHIP, HGN_CARRIER, HGN_ESCORTCARRIER, HGN_SHIPYARD, VGR_MOTHERSHIP, VGR_MOTHERSHIP_MAKAAN, VGR_CARRIER, VGR_SHIPYARD} squadclass[eFighter] = {HGN_INTERCEPTOR, HGN_INTERCEPTORADV, HGN_ADVANCEDFIGHTERTECH, HGN_ATTACKBOMBER, HGN_ATTACKBOMBER2, HGN_ATTACKBOMBERADV, HGN_ATTACKBOMBERELITE, VGR_INTERCEPTOR, VGR_BOMBER, VGR_LANCEFIGHTER} squadclass[eCorvette] = {HGN_ASSAULTCORVETTE, HGN_PULSARCORVETTE, HGN_MINELAYERCORVETTE, VGR_MISSILECORVETTE, VGR_LASERCORVETTE, VGR_MINELAYERCORVETTE, VGR_COMMANDCORVETTE} squadclass[eFrigate] = {HGN_ASSAULTFRIGATE, HGN_DEFENSEFIELDFRIGATE, HGN_IONCANNONFRIGATE, HGN_MARINEFRIGATE, HGN_MARINEFRIGATE_SOBAN, HGN_TORPEDOFRIGATE, HGN_TORPEDOFRIGATEELITE, VGR_ASSAULTFRIGATE, VGR_HEAVYMISSILEFRIGATE, VGR_INFILTRATORFRIGATE} squadclass[eCapture] = {HGN_MARINEFRIGATE, HGN_MARINEFRIGATE_SOBAN, VGR_INFILTRATORFRIGATE} squadclass[eShield] = {HGN_DEFENSEFIELDFRIGATE} squadclass[ePlatform] = {HGN_GUNTURRET, HGN_IONTURRET, VGR_WEAPONPLATFORM_GUN, VGR_WEAPONPLATFORM_MISSILE, VGR_HYPERSPACE_PLATFORM} squadclass[eAntiFighter] = {HGN_INTERCEPTOR, HGN_INTERCEPTORADV, HGN_ASSAULTCORVETTE, HGN_ASSAULTFRIGATE, HGN_GUNTURRET, VGR_INTERCEPTOR, VGR_ASSAULTFRIGATE, VGR_WEAPONPLATFORM_GUN} squadclass[eAntiCorvette] = {HGN_PULSARCORVETTE, HGN_INTERCEPTORADV, HGN_TORPEDOFRIGATE, HGN_TORPEDOFRIGATEELITE, HGN_DESTROYER, VGR_LANCEFIGHTER, VGR_LAZERCORVETTE, VGR_DESTROYER} squadclass[eAntiFrigate] = {HGN_IONTURRET, HGN_ATTACKBOMBER, HGN_ATTACKBOMBERELITE, HGN_IONCANNONFRIGATE, HGN_MARINEFRIGATE, HGN_MARINEFRIGATE_SOBAN, HGN_DEFENSEFIELDFRIGATE, HGN_DESTROYER, HGN_BATTLECRUISER, VGR_BOMBER, VGR_HEAVYMISSILEFRIGATE, VGR_INFILTRATORFRIGATE, VGR_DESTROYER, VGR_BATTLECRUISER, VGR_WEAPONPLATFORM_MISSILE} squadclass[eCapital] = {HGN_CARRIER, HGN_ESCORTCARRIER, HGN_MOTHERSHIP, HGN_SHIPYARD, HGN_DESTROYER, HGN_BATTLECRUISER, HGN_DREADNAUGHT, VGR_CARRIER, VGR_MOTHERSHIP, VGR_MOTHERSHIP_MAKAAN, VGR_SHIPYARD, VGR_DESTROYER, VGR_BATTLECRUISER} squadclass[eNonThreat] = {HGN_RESOURCECOLLECTOR, VGR_RESOURCECOLLECTOR, HGN_RESOURCECONTROLLER, VGR_RESOURCECONTROLLER, HGN_CARRIER, HGN_MOTHERSHIP, HGN_SHIPYARD, VGR_CARRIER, VGR_MOTHERSHIP, VGR_MOTHERSHIP_MAKAAN, VGR_SHIPYARD, HGN_SCOUT, HGN_PROBE, HGN_PROXIMITYSENSOR, HGN_ECMPROBE, VGR_SCOUT, VGR_PROBE, VGR_PROBE_PROX, VGR_PROBE_ECM, VGR_HYPERSPACE_PLATFORM} squadclass[eHyperspaceGate] = {VGR_HYPERSPACE_PLATFORM} squadclass[eSubSystemAttackers] = {HGN_ATTACKBOMBER, HGN_ATTACKBOMBER, HGN_ATTACKBOMBER2, HGN_ATTACKBOMBERADV, HGN_ATTACKBOMBERELITE, VGR_BOMBER} squadclass[eNonCriticalSubSys] = {CLOAKGENERATOR, FIRECONTROLTOWER, HYPERSPACEINHIBITOR, ADVANCEDARRAY, CLOAKSENSOR} squadclass[eGoodRepairAttackers] = {HGN_INTERCEPTOR, HGN_ASSAULTFRIGATE, HGN_IONCANNONFRIGATE, HGN_DESTROYER, HGN_BATTLECRUISER, VGR_INTERCEPTOR, VGR_MISSILECORVETTE, VGR_ASSAULTFRIGATE, VGR_DESTROYER, VGR_BATTLECRUISER} -- Play if you want at your own risk with the next 3 lines eUselessShips = eMaxCount eBattleCruiser = eMaxCount + 1 sg_maxClasses = eBattleCruiser + 1 -- Think this next line are those ships which are considered useless for attacks etc. I've noticed the CPU rarely builds minelayers etc. squadclass[eUselessShips] = {HGN_MINELAYERCORVETTE, VGR_MINELAYERCORVETTE, VGR_COMMANDCORVETTE} -- Fairly Obvious, which vessels are counted as Battlecruisers squadclass[eBattleCruiser] = {HGN_BATTLECRUISER, VGR_BATTLECRUISER} -- Mess with these lines at your own risk function FastAddToClass(tbl, classid) for a, b in tbl do AddToClass(b, classid) end end function ClassInitialize() for i = 0, sg_maxClasses do if squadclass[i] then FastAddToClass(squadclass[i], i) end end -- Now lets those etags there real names.... AddClassName(eMotherShip, "Motherships") AddClassName(eCollector, "Collectors") AddClassName(eDropOff, "DropOffs") AddClassName(eFighter, "Fighters") AddClassName(eFrigate, "Frigates") AddClassName(eCorvette, "Corvettes") AddClassName(eCapital, "Capital") AddClassName(eAntiFighter, "AntiFighter") AddClassName(eAntiCorvette, "AntiCorvette") AddClassName(eAntiFrigate, "AntiFrigate") AddClassName(ePlatform, "Platform") AddClassName(eRefinery, "Refinery") AddClassName(eHyperspaceGate, "HypGates") AddClassName(eShield, "Shields") AddClassName(eCapture, "Capture") AddClassName(eSubSystemAttackers, "SubSysKillas") AddClassName(eBattleCruiser, "BattleCruiser") end


Ok next file i can see in need of translation is

cpu_build.lua - it seems to go through and tell it what to build depending on what mood the AI is in.

cpubuildsubsystems.lua - tells the ai what subsystems it can build along with what to build depending on it's mood.

cpumilitary.lua - Doesn't appear to effect the building of units but it does seem to have a nice bunch of info on things such as what it is to do at certain times.. example

Code:
24 [109] SETGLOBAL 3 ; cp_attackPercent 25 [110] GETGLOBAL 6 ; aitrace 26 [110] PUSHSTRING 7 ; "I'm Losing!! Go on defence" 27 [110] CALL 0 0


cpuresearch.lua - Contains MORE research info for the AI. With out this file any research types you add won't be reckonised with out them being in here.

cpuresource.lua - Just contains the AI's resource collecting info.

default.lua - This is the CORE file, it calls to every other file in the AI directory in the first few lines.

so from what i see 3 files need to be translated.. before any ai's gonna reconise anything..

- cpu_build.lua
- cpubuildsubsystems.lua
- cpuresearch.lua

and given how much I messed up that last one i was trying to translate i'm not game to even look at doing these I can look at the code and point out what does what but i can't translate it by hand why couldn't it be nice and simple... a language i know fully like php :P
 
Old 19th Oct 03, 11:00 AM   # 3
starfleet
Guest
 

hrmm on a funnier note found this in the scripts as well

Code:
67 [268] GETGLOBAL 4 ; print 68 [268] PUSHSTRING 19 ; "Each AI has been given " 69 [268] GETLOCAL 1 ; extra_money 70 [268] PUSHSTRING 20 ; " RUs. Lets hope they dont spend it all on hookers and beer"


Also a FYI AI will build units if it can build them with out having to research for them so long as you mod the classdef.lua file.
 
Closed Thread



Go Back   RelicNews Forums > RDN - Relic Game Mods > Homeworld 2 - Tanis Shipyards
User Name
Password
Register FAQ Members List Arcade Mark Forums Read



Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




All times are GMT -7. The time now is 4:46 AM.

Page generated in 0.49642706 seconds (96.35% PHP - 3.65% MySQL) with 9 queries

Powered by: vBulletin Version 3.0.7
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.