View Full Version : Problems with Creating my New Mod
nitrotomato
13th Oct 08, 2:44 AM
Hello all.
I am creating a new mod for my own personal use (I will not release it, that would be plagiarism to the extreme, which I am very much against); and partly to learn things about scripting for computing. My mod is essentially an assimilation of my 2 favourite mods; Beghin’s Complex Mod and Why?!’s Rebalance Mod. Very simply put, I wish to add the majority of ships from the Complex mod into the Rebalance mod, whilst removing the complex element, and balancing the sides.
I am very new to modding, so need some help. I have 3 main issues here. The first is the Ion Cannon Frigate. The Rebalance mod has it so that the Ion Frigate now fires a heavy railgun, and the weapon script for the ion Cannon is modified. I wish to revert the ion frigate simply to its previous weapons and behaviour, but when I replace the railgun weapon scripts with proper ion cannon weapon scripts, it does not work properly; the ion cannon does hardly any damage and doesn’t fire with a proper effect. A similar issue is that I wish to add the pulsars and 2 regular strength ion turrets back onto the Battlecruiser. Any help on this issue would be much appreciated.
My second issue is the importing of ships from the Complex Mod. For example I want the rebalance mod to have the “Sniper Frigate”. I actually have no idea how to do this properly. I have extracted and decoded the files from the Complex Mod, and all I simply wish to do is copy their ship/research/weapon files over into the rebalance mod to allow me to build and play with them inside my updated rebalance mod. I always felt HW2 lacked the variety in ships that HW1 had, so I want to change that. The thing is, I have no idea how to get the new ship models/icons and the ships themselves playable into the game. I am pretty sure it is quite a simple process, as I have already have the ship files and things, I just don’t know how to get them into my new rebalance mod.
My final issue concerns the creation of 3 new ships. The first is a Transport Carrier. The transport carrier is essentially a docking station. All I want is a somewhat modified carrier which has a built-in hyperspace ability (which has no radius, so only the carrier can hyperspace), and cannot actually build ships itself. This means that fighters can dock with it easily and the carrier can then hyperspace to a point on the map and launch the ships. I’ve sketched some ideas for the coding but they don’t seem to work at all. The second is a heavy carrier; simply-put a carrier with some extra weapons, such as some missile launchers and flak turrets, and perhaps built-in improved manufacturing. The final, which is not necessary, is a support ship, which is essentially a resource collector with the harvest ability removed and the repair ability instead. I always felt using resource collectors to repair ships was wasteful.
That’s it, I know it’s a lot to ask, but help on any one of these issues would be much appreciated, and may help me gain an understanding in the game code which may allow me to develop later mods which aren’t simply amalgamations of someone else’s mods.
barnmaddo
13th Oct 08, 10:57 AM
1) Frankly the ion cannon frigate never seemed to do much damage in the first place, are you sure the previous weapon wasn't just more powerful? There may be some global settings somewhere that are restricting the weapons, I don't really know what would be causing that.
2) If you haven't already make sure you read
"Making the Keeper a playable race - a modding tutorial for newbies."
http://forums.relicnews.com/showthread.php?t=73876
it should cover most the stuff you need to know to add the complex ships to your mod.
3) You should be able to do these things with just a bit of editing of the .ship file. (You will need to add some hard points before you can add extra weapons though, and that is beyond me, but I think there are some tutorials on it.)
For example just set the first variable here to 1 to give a ship an innate hyperspacing ability.
addAbility(NewShipType,"HyperSpaceCommand",0,1,400,800,0,3);
addAbility(NewShipType,"HyperSpaceCommand",1,1,400,800,0,3);
Similarly you can remove the line for
addAbility(NewShipType,"CanBuildShips"...
to prevent the ship from building.
I'd suggest getting the commented "Relic Developer's Network" files reading through those and looking up the likely functions in Karos Graveyard (http://hw2wiki.net/wiki/index.php?title=KarosGraveyard). Then read through ship files similar to those you want to edit.
Ex. Look in the resource collectors file to see why it can repair and collect resources, look at the Assault Frigate and see how its flak guns are setup...
nitrotomato
13th Oct 08, 11:15 AM
I have another issue. I've found that simply copying some of the Data files from the Complex mod onto my mod gives me access to all the new ships, and I can edit research and things to suit my own mod.
However, my main issue is the AI. My new mod would almost be PERFECT, if not for the AI. The main reason I was building my mod on the Rebalance mod is the improved fighter + frigate AI used in the rebalance mod, created by Alex Drake I believe.
When I copy over some of Complex Mod's data files into rebalance, the AI reverts back to original HW2, which is boring. I was wondering if there was a way to change the AIs back to how they are supposed to be; dyanamic.
To do so I will either need to know which rebalance files NOT TO replace with the Complex Files, or I need to download the Dynamic Series, which I cannot find anywhere on google. Can someone help me with one of these?
Moleman
13th Oct 08, 11:17 AM
yea everything in the AI folder DO NOT replace thats what judges all of the AI functions
nitrotomato
13th Oct 08, 12:09 PM
Okay, I have a significantly different issue now. I've copied over all the ship and weapon files, which I decided I would manually add to the build manager. Before adding to the build manager, I tested the game and it ran fine, though I couldn't see any of the Complex ships (as to be expected)
I then added this to the Build.lua script:
{
Type = Ship,
ThingToBuild = "Hgn_tulwar",
RequiredResearch = "",
RequiredShipSubSystems = "",
DisplayPriority = 280,
DisplayedName = "Heavy Assault Frigate",
Description = "",
},
Now the game gets to universe when loading a map, and then crashes out. I have no idea why. Any advice? I checked the formatting, it matches the rest of my build stuff perfectly fine. hgn_tulwar is definitely a ship which exists, and its weapon definitely exists.
ford6
13th Oct 08, 1:48 PM
whats the hw2.log say? And make sure you have the -luatrace switch on your command line. With out that the hw2.log will be useless.
Missles are in a folder seperate from the weapons folder, make sure you copyed them over too.
nitrotomato
13th Oct 08, 2:02 PM
Says this:
Mon Oct 13 20:06:27 2008
Loaded Archive: 'Homeworld2.big'
UTIL -- filepath failure, path doesn't exists 'C:\PROGRA~1\Sierra\HOMEWO~1\data\locale\english'
Loaded Archive: 'english.big'
Uing ..profiles\ for profiles folder
GAME -- Using player profile Chon
Changing from a 32 bit colour depth in winNT (5.1 build 2600), Service Pack 2
Using NVIDIA Corporation's 2.1.2 GeForce FX 5200/PCI/SSE2 renderer (Suspected driver is nvoglnt.dll 6.14.11.7519)
Loaded Archive: 'englishSpeech.big'
Loaded Archive: 'Music.big'
SOUND -- created destination [ fdaudio ], handle [ 4 ] with [ 48 ] channels created
SOUND -- created destination [ fda streamer ], handle [ 5 ] with [ 8 ] channels created
Build name: The Dust Wars - AutoBuild3569 - Ordered by smmatte
Built by : mrbuild
Data path : C:\PROGRA~1\Sierra\HOMEWO~1\data
Could not initialize all fragment programs. Please use the '-fragment_program 0' command line parameter
Unabled to find data:animatics/combined512x512x30HzNS.avi
Resetting fp control word.
CmdLine: -overridebigfile
Starting Level: data:LevelData\Multiplayer\Deathmatch\2P_HOSTILITIES_END.LEVEL
SUBSYSTEM ERROR: problem loading the subs file for DISTANCE
HardPointStatic::setDefaultSubSystemId: Error: Cannot find subsystem called Distance -- FATAL EXIT -- hardpointstatic/72:! --stack trace-- 0x0048BC03: GSLobbySessionDesc::operator= () 0x003E46B5: lua_error () 0x003E4749: lua_error () 0x003E4751: lua_error () 0x003E47EE: lua_error () 0x003E481E: lua_call () 0x003E4A13: lua_dobuffer () 0x0046CB81: GSLobbySessionDesc::operator= () 0x0047681E: GSLobbySessionDesc::operator= () 0x00442EA9: GSLobbySessionDesc::operator= () 0x00431692: GSLobbySessionDesc::operator= () 0x00541B86: GSTracker::operator= () 0x005424C6: GSTracker::operator= () 0x00578204: getLibraryID () 0x00579086: getLibraryID () 0x0059865E: getLibraryID () 0x00599CDD: getLibraryID () 0x004952A1: GSLobbySessionDesc::operator= () 0x00490C11: GSLobbySessionDesc::operator= () 0x004911D2: GSLobbySessionDesc::operator= ()
Have no idea what any of it means, though.
Joe 2987
13th Oct 08, 2:37 PM
You have a subsystem called "Distance" referenced to in some file, but there is no subsystem "Distance". Either create one or remove the refence.
nitrotomato
13th Oct 08, 3:29 PM
Okay, thanks so much for the help guys, but this problem's still stumping me.
This is literally all I added to build.lua:
{
Type = Ship,
ThingToBuild = "Hgn_tulwar",
RequiredResearch = "",
RequiredShipSubSystems = "",
DisplayPriority = 280,
DisplayedName = "Heavy Assault Frigate",
Description = "",
},
When I remove it, the game works, and when I add it it doesnt and I get the "Distance" error. I've checked the files and there doesn't seem to be anything, any ideas?
Edit: I took a look in the Tulwar.ship file, and found this:
StartShipHardPointConfig(NewShipType,"Distance","Hardpoint_Support","System","Innate","Damageable","Distance","","","","","","","","")P")
Thats the closest thing I could find as a reference to "distance". I don't know how to change it or remove it or anything though.
Edit 2: Last Edit, I removed that line from the ship file and the error changed to a subsystem called position, which was also in the file. I deleted that line and this happened:
CmdLine: -overridebigfile -luatrace
Starting Level: data:LevelData\Multiplayer\Deathmatch\2P_HOSTILITIES_END.LEVEL
parameter: unfinished string;
last token read: `"EM
' at line 165 in string ""
Error: could not find static data for build data (Hgn_tulwar) -- FATAL EXIT -- builddata/176:! --stack trace-- 0x00541BB5: GSTracker::operator= () 0x005424C6: GSTracker::operator= () 0x00578204: getLibraryID () 0x00579086: getLibraryID () 0x0059865E: getLibraryID () 0x00599CDD: getLibraryID () 0x004952A1: GSLobbySessionDesc::operator= () 0x00490C11: GSLobbySessionDesc::operator= () 0x004911D2: GSLobbySessionDesc::operator= ()
ford6
13th Oct 08, 3:48 PM
Could you post the tulwar file.
looks like there's a problem with the "EMP" shield line aka:
last token read: `"EM
With out the end of the line, you'll get errors like that. because it errors out, the game blanks the data, and therefore since there isn't any data in the build file for the ship the game throws the cant find static data error.
nitrotomato
13th Oct 08, 4:17 PM
NewShipType = StartShipConfig()
NewShipType.displayedName = "Tulwar Frigate"
NewShipType.sobDescription = "Anti-Corvette/Frigate"
NewShipType.maxhealth = 26000
NewShipType.regentime = 1500
NewShipType.minRegenTime = 150
NewShipType.sideArmourDamage = 1.2
NewShipType.rearArmourDamage = 1.2
NewShipType.isTransferable = 1
NewShipType.useEngagementRanges = 1
NewShipType.unitCapsNumber = 2
NewShipType.SquadronSize = 1
NewShipType.formationSpacing = 250
NewShipType.passiveFormation = "Spear"
NewShipType.defensiveFormation = "x"
NewShipType.aggressiveFormation = "Claw"
NewShipType.mass = 115
NewShipType.collisionMultiplier = 1
NewShipType.thrusterMaxSpeed = 150
NewShipType.mainEngineMaxSpeed = 150
NewShipType.rotationMaxSpeed = 35
NewShipType.thrusterAccelTime = 7
NewShipType.thrusterBrakeTime = 2
NewShipType.mainEngineAccelTime = 8
NewShipType.mainEngineBrakeTime = 2
NewShipType.rotationAccelTime = 0.4
NewShipType.rotationBrakeTime = 0.2
NewShipType.thrusterUsage = 0.5
NewShipType.accelerationAngle = 40
NewShipType.mirrorAngle = 0
NewShipType.secondaryTurnAngle = 0
NewShipType.maxBankingAmount = 20
NewShipType.descendPitch = 20
NewShipType.goalReachEpsilon = 30
NewShipType.slideMoveRange = 100
NewShipType.controllerType = "Ship"
NewShipType.tumbleStaticX = 10
NewShipType.tumbleStaticY = 20
NewShipType.tumbleStaticZ = 5
NewShipType.tumbleDynamicX = 2
NewShipType.tumbleDynamicY = 10
NewShipType.tumbleDynamicZ = 5
NewShipType.tumbleSpecialDynamicX = 2
NewShipType.tumbleSpecialDynamicY = 10
NewShipType.tumbleSpecialDynamicZ = 5
NewShipType.relativeMoveFactor = 3
NewShipType.swayUpdateTime = 4
NewShipType.swayOffsetRandomX = 10
NewShipType.swayOffsetRandomY = 10
NewShipType.swayOffsetRandomZ = 10
NewShipType.swayBobbingFactor = 0.05
NewShipType.swayRotateFactor = 0
NewShipType.useTargetRandom = 1
NewShipType.targetRandomPointXMin = -0.3
NewShipType.targetRandomPointXMax = 0.4
NewShipType.targetRandomPointYMin = -0.35
NewShipType.targetRandomPointYMax = 0.6
NewShipType.targetRandomPointZMin = -0.75
NewShipType.targetRandomPointZMax = 0.85
NewShipType.dustCloudDamageTime = 160
NewShipType.nebulaDamageTime = 200
NewShipType.MinimalFamilyToFindPathAround = "MotherShip"
NewShipType.BuildFamily = "Frigate_Hgn"
NewShipType.AttackFamily = "Frigate"
NewShipType.DockFamily = "Frigate"
NewShipType.AvoidanceFamily = "Frigate"
NewShipType.DisplayFamily = "Frigate"
NewShipType.AutoFormationFamily = "Frigate"
NewShipType.CollisionFamily = "Big"
NewShipType.ArmourFamily = "MediumArmour"
NewShipType.UnitCapsFamily = "Frigate"
--NewShipType.UnitCapsShipType = "IonFrigate"
NewShipType.fighterValue = 0
NewShipType.corvetteValue = 0
NewShipType.frigateValue = 16
NewShipType.neutralValue = 0
NewShipType.antiFighterValue = 2
NewShipType.antiCorvetteValue = 6
NewShipType.antiFrigateValue = 9
NewShipType.totalValue = 17
NewShipType.buildCost = 1100
NewShipType.buildTime = 70
NewShipType.buildPriorityOrder = 30
NewShipType.retaliationRange = 5500
NewShipType.retaliationDistanceFromGoal = 160
NewShipType.visualRange = 1250
NewShipType.prmSensorRange = 6000
NewShipType.secSensorRange = 7000
NewShipType.detectionStrength = 1
NewShipType.TOIcon = "Diamond"
NewShipType.TOScale = 1
NewShipType.TODistanceFade0 = 9000
NewShipType.TODistanceDisappear0 = 7000
NewShipType.TODistanceFade1 = 4500
NewShipType.TODistanceDisappear1 = 3500
NewShipType.TODistanceFade2 = 12000
NewShipType.TODistanceDisappear2 = 38500
NewShipType.TOGroupScale = 1
NewShipType.TOGroupMergeSize = 0
NewShipType.mouseOverMinFadeSize = 0.045
NewShipType.mouseOverMaxFadeSize = 0.1
NewShipType.healthBarStyle = 1
NewShipType.nlips = 0.000125
NewShipType.nlipsRange = 6000
NewShipType.nlipsFar = 0.0001
NewShipType.nlipsFarRange = 10000
NewShipType.SMRepresentation = "HardDot"
NewShipType.meshRenderLimit = 60000
NewShipType.dotRenderLimit = 10
NewShipType.visibleInSecondary = 1
NewShipType.minLOD = 0.25
NewShipType.goblinsStartFade = 4500
NewShipType.goblinsOff = 4500
NewShipType.upLOD = 4500
NewShipType.upLOD = 5000
NewShipType.downLOD = 4515
NewShipType.downLOD = 5015
NewShipType.minimumZoomFactor = 0.6
NewShipType.selectionLimit = 150000
NewShipType.preciseATILimit = 0
NewShipType.selectionPriority = 75
NewShipType.militaryUnit = 1
addAbility(NewShipType, "MoveCommand", 1, 0)
addAbility(NewShipType, "CanDock", 1, 0)
NewShipType.dockTimeBetweenTwoFormations = 1
NewShipType.dockTimeBeforeStart = 2
NewShipType.dockNrOfShipsInDockFormation = 1
NewShipType.dockFormation = "delta"
NewShipType.queueFormation = "dockline"
NewShipType.dontDockWithOtherRaceShips = 1
NewShipType.ignoreRaceWhenDocking = 0
addAbility(NewShipType, "CanLaunch")
NewShipType.launchTimeBetweenTwoFormations = 1
NewShipType.launchTimeBeforeStart = 2
NewShipType.launchNrOfShipsInDockFormation = 1
NewShipType.launchFormation = "delta"
addAbility(NewShipType, "ParadeCommand", 1)
addAbility(NewShipType, "WaypointMove")
addAbility(NewShipType,"DefenseFieldAbility",1,0,135,1000,100,1,0.4,0,"defensefield_sphere_spray")
addAbility(NewShipType, "HyperSpaceCommand", 0, 1, 200, 500, 1, 3)
addAbility(NewShipType, "CanAttack", 1, 1, 0, 1, 0.35, 1.5, "SmallCapitalShip, BigCapitalShip, Mothership, Capturer, Frigate, Corvette, Fighter, ResourceLarge, Resource, Utility", "Frontal",
{
SubSystem = "FrontalVsSubSystem",
},
{
Fighter = "MoveToTargetAndShoot",
},
{
Corvette = "MoveToTargetAndShoot", })
addAbility(NewShipType, "GuardCommand", 1, 3000, 600)
addAbility(NewShipType, "HyperspaceViaGateCommand", 1, 3, 1, 0.3)
addAbility(NewShipType, "CanBeCaptured", 30, 0.1)
addAbility(NewShipType, "CanBeRepaired")
addAbility(NewShipType, "RetireAbility", 0, 1)
AddShipMultiplier(NewShipType, "HealthRegenerationRate", "OwnShipsWithinRadiusExcludingThisShip", "Linear", 1.4, 1, 900)
LoadModel(NewShipType, 1)
StartShipWeaponConfig(NewShipType,"Hgn_PlasmaTulwar","Weapon_NoseCannon","PL")
StartShipWeaponConfig(NewShipType,"Hgn_PulsarTulwar","Weapon_PV","P1")
StartShipWeaponConfig(NewShipType,"Hgn_PulsarTulwar","Weapon_SV","P2")
StartShipWeaponConfig(NewShipType,"Hgn_PulsarTulwar","Weapon_PD","P3")
StartShipWeaponConfig(NewShipType,"Hgn_PulsarTulwar","Weapon_SD","P4")
StartShipWeaponConfig(NewShipType,"Hgn_SmallEMPTulwar","Weapon_CD","EMP1")
StartShipWeaponConfig(NewShipType,"Hgn_SmallEMPTulwar","Weapon_CV","EMP2")
addShield(NewShipType, "EMP", 310, 20)
addAbility(NewShipType, "SpecialAttack", 0, "EM
--SpawnSalvageOnDeath(NewShipType,"Slv_Chunk_Sml04",1,1,30,60,0,60,15,200,20,125,0,0,0,120,0,0,0,50)
--SpawnSalvageOnDeath(NewShipType,"Slv_Chunk_Sml06",1,0.4,60,60,30,60,35,80,65,75,0,0,0,60,0,0,0,50)
NewShipType.battleScarMaxTriBase = 75
NewShipType.battleScarMaxTriInc = 100
NewShipType.sobDieTime = 1
NewShipType.sobSpecialDieTime = 1
NewShipType.specialDeathSpeed = 40
NewShipType.chanceOfSpecialDeath = 0
NewShipType.deadSobFadeTime = 0
NewShipType.trailLinger = 4
setEngineGlow(NewShipType, 1, 1, 1.02, 20, 300, 50, 1.5,
{ 0.27, 0.47, 0.69, 0.25, })
loadShipPatchList(NewShipType, "data:sound/sfx/ship/Hiigaran/Frigate/", 0, "Engines/HFrigateEng", "", 1, "Ambience/HFrigateAmb", "")
I mustn't forget, this was made for another mod with different abilities. As the mod I'm porting them to doesn't have those abilities, I have to remove them from the ship files.
Edit: Found the string which should've contained EMP, and fixed it. Got this error instead.
Tue Oct 14 00:18:25 2008
Loaded Archive: 'Homeworld2.big'
UTIL -- filepath failure, path doesn't exists 'C:\PROGRA~1\Sierra\HOMEWO~1\data\locale\english'
Loaded Archive: 'english.big'
Uing ..profiles\ for profiles folder
GAME -- Using player profile Chon
Changing from a 32 bit colour depth in winNT (5.1 build 2600), Service Pack 2
Using NVIDIA Corporation's 2.1.2 GeForce FX 5200/PCI/SSE2 renderer (Suspected driver is nvoglnt.dll 6.14.11.7519)
Loaded Archive: 'englishSpeech.big'
Loaded Archive: 'Music.big'
SOUND -- created destination [ fdaudio ], handle [ 4 ] with [ 48 ] channels created
SOUND -- created destination [ fda streamer ], handle [ 5 ] with [ 8 ] channels created
Build name: The Dust Wars - AutoBuild3569 - Ordered by smmatte
Built by : mrbuild
Data path : C:\PROGRA~1\Sierra\HOMEWO~1\data
Could not initialize all fragment programs. Please use the '-fragment_program 0' command line parameter
Unabled to find data:animatics/combined512x512x30HzNS.avi
Resetting fp control word.
CmdLine: -overridebigfile -luatrace
Starting Level: data:LevelData\Multiplayer\Deathmatch\2P_HOSTILITIES_END.LEVEL
parameter: `)' expected (to close `(' at line 165);
last token read: `NewShipType' at line 168 in string ""
Error: could not find static data for build data (Hgn_tulwar) -- FATAL EXIT -- builddata/176:! --stack trace-- 0x00541BB5: GSTracker::operator= () 0x005424C6: GSTracker::operator= () 0x00578204: getLibraryID () 0x00579086: getLibraryID () 0x0059865E: getLibraryID () 0x00599CDD: getLibraryID () 0x004952A1: GSLobbySessionDesc::operator= () 0x00490C11: GSLobbySessionDesc::operator= () 0x004911D2: GSLobbySessionDesc::operator= ()
ford6
13th Oct 08, 5:34 PM
its the same line as the last error. just remark "--" out that line.
nitrotomato
14th Oct 08, 10:56 AM
I've fixed that. Thanks so much for the advice.
I'm going to ask for one last bit of advice, because it's the last thing keeping my mod back, I think. How do I make the dreadnaught from Single Player playable + buildable in MP? I've tried so many things and none of them quite work right.
ford6
14th Oct 08, 12:29 PM
best bet is to make a copy and add it like you would a new ship. If you mess with the HGN_Dreadnought the SP campaign will crash as it makes lua calls to modify the ship (aka: disabling the cannon,) and there are hard-coded things that restrict it from being built.
Moe's "Making the keepers a playable race" has instructions on how to make it build-able.
vBulletin v3.0.7, Copyright ©2000-2010, Jelsoft Enterprises Ltd.