Just decided to post this as a trouble-shooter of sorts, for those problems common and not so much. And some tips, found below.
If anyone wants more info on one of the tips, please PM me or post a topic.
I'll add more as i remember them. If anyone has more, please post them below.
Note that i will fix typos and possibly simplify things when i add them here, please PM me if you have any questions/comments.
Modded the game files, but nothing changed in-game.Make sure finalBIG has administrative rights turned on. Otherwise when you save a new file in the C: directory, it will somehow be where you saved it in finalBIG but won't actually be in the folder if you navigate there outside of finalBIG. Also if you edit a file that is in C:, it will always appear modified in finalBIG but won't actually change anything in-game.Portable Structure type turret not turning.
Make sure the draw module, the one with the condition states and models, is
Draw = W3DOverlordTankDraw ModuleTag_01Added a new side. Game opens correctly, goes into skirmish menu just fine. But then it crashes while loading.Check your starting unit(s) and your starting building in PlayerTemplate.INI.added a unit in INIs. Game works fine. But, when the mouse is hovered over the build unit button, the game crashes.Check the Prerequisites of the unit. Make sure the building name in the Prerequisite is spelled correctly.Unit's weapon fires from the middle of the unit, not the barrel.Make sure the unit's firing bone(s) are named the same on the model and in the INIs.Your Zero Hour map with custom scripting is crashing all of a sudden?
Be extremely careful of the hidden character that is added to the end of unit and structure names when you use the dropdown list to fill in script commands.
Code:
*** IF ***
True.
*** THEN ***
Command button: 'Command_ConstructAmericaParticleCannonUplink
' is removed from all objects of type 'AmericaVehicleDozer'.
'Command_ConstructAmericaParticleCannonUplink|<- hidden character causes crash'
You can check for this new character by placing your cursor at the end of the string filled in by the dropbox and hitting backspace once. If a character isn't removed, that was the hidden character you just deleted Smile
'Command_ConstructAmericaParticleCannonUplink|'
*backspace*
'Command_ConstructAmericaParticleCannonUplink'
Unit is invisible in-game.Make sure the model's name is spelled correctly in it's INIs. Also, don't edit the name of the W3D after its saved.Edited CommandSet INIs, game crashes. Neither Worldbuilder or Game Debugging finds the problem. CommandButtons definitely have same names as CommandSet commands.Recheck the spelling and capitalization.
Example;
Commandset NorthKoreaDetentionCampCommandSet
14 = Command_Sell
End
here, the only thing wrong is the S in CommandSet is not capitalized.
Game crashes on unit spawn/create (e.g. about to roll out from factory)
Game can also crash on map load if the unit is to exist on that map from start.Typing error between multiple files - e.g. upgrade name in weaponsetupgrade.Projectile Weapons not shooting the right direction.
Make sure that the Pivot Point of the WeaponLaunchBone is facing the right direction; the X axis would be the direction it will shoot.PortableStructure facing the wrong way even though the model is facing the right way or its aiming offset by an angle.Check your attach point bones. Make the pivot point face the world's x-axis.\
This could be a neat effect when done right;
Make the X axis of the WeaponLaunchBone not face the direction of the model. This would also need a Missile Object with a modified Locomotor.
/
\
A tip; I'm not sure it does this with everyone, but when i make unit in Gmax/RenX with bones, save, load, and save it again, the bones will disappear. Which becomes a big problem when trying to skin the model.
You can prevent this by turning on Export Transform in W3D Tools for the bones when you export.
My fix for this is to use what i call Micro Bones. they work the same as regualer bones, but i still export their geometry. they are very small and inside other objects so they are invisible in-game.
/
\
When resizing the geometry in the INIs, GeometryMajor = Length and GeometryMinor = Width
/
\
You cannot remove Upgrade_GLAWorkerShoes from Upgrade.ini. If you do, the game will crash every time you try to move any unit.
/
\
If you want to go over the 128 upgrade limit, you can use objects. Basically build an invulnerable unit with no art parameters (so nothing will be drawn) that uses the GrantUpgradeCreate behavior. In my case, this allows Tank General and Airforce general to use a set of 16 upgrades (Upgrade_TechTreeX_Y where X and Y are between 1 and 4) to unlock various unit, upgrades and sciences. Or Airforce and Stealth generals can get Laser Missiles and AP Rockets respectively, but both use Upgrade_MissileDamage. The only problem is that you shouldn't allow the player to capture other generals' buildings, since one upgrade may have two very different costs depending on the general using it. You may be able to work your way around such problems.
Using the same upgrade for different units/factions will help to avoid the 128 limit.
/
\
If you're going to make a unit, use the most similar unit in FUNCTION, not in appearance.
For example, if you're going to convert the A10 into a controllable plane, you would be vastly better off basing it on the Raptor, not the A10. It will take a lot less time and have a lot less bugs.
/
\
If your making an airfield, you have to give the bones that tell the planes where to go a certain name. The name and purpose of each bone is hard-coded.
The bones are;
ExtraPublicBone = Runway1Parking1
ExtraPublicBone = Runway1Parking2
ExtraPublicBone = Runway2Parking1
ExtraPublicBone = Runway2Parking2
ExtraPublicBone = Runway1Park1Han
ExtraPublicBone = Runway1Park2Han
ExtraPublicBone = Runway2Park1Han
ExtraPublicBone = Runway2Park2Han
ExtraPublicBone = Runway1Prep1
ExtraPublicBone = Runway1Prep2
ExtraPublicBone = Runway2Prep1
ExtraPublicBone = Runway2Prep2
ExtraPublicBone = RunwayStart1
ExtraPublicBone = RunwayStart2
ExtraPublicBone = RunwayEnd1
ExtraPublicBone = RunwayEnd2
ExtraPublicBone = HeliPark01
You can use the aircraft carrier modules if you want a little more freedom to name things.
/
\
You can mimic the overlord addon code:
ContainInsideSourceObject = Yes
to spawn mixed infantry units inside a transport.
You can spawn any mixture of units in a transport. E.G. 4 Missile defenders + 1 pathfinder in a humvee or 4 minigunners and 4 tank hunters in an assault troop crawler.
All that is required is spawning the units via OCL from it's transport object, like the overlord does.
/
\
There are two methods to help debug your code (as far as i know).
1. change half the edited code back to what it was before. if the problem is still there, your problem is in the other half. keep doing this until you narrow it down to one unit/building/whatever.
2. Open Worldbuilder. Alot of bugs will be caught by this, and if so will be pinpointed down to the exact line the error is at. To go to the line quickly in FinalBIG, go to the INI at fault, and click Edit>Edit in Editor. this will open a notepad style editor. Then go to Edit>Go To. it will open a window where you can type in the line number, and it will take you there.
/
\
The Superweapon generals doesn't build barracks on normal AI.
This is why:
Code:Quote:
[ns A D][N]USA Barracks -N
*** IF ***
'SupW_AmericaBarracks' has been built by Player '<This Player>'
*** THEN ***
Build a building of type 'SupW_AmericaBarracks'
just a tip...:P
/
\
Some techbuilding stuffs.
Code:Quote:
*** IF ***
Player '<This Player>' has a tech building within 500.00 of area '[Skirmish]MyInnerPerimeter'
This script works different than you might think, i placed an oilderrick inside of the innerperimeter and the counter 'USA Tech Building Near' was set to 1 while its not within 500.00 but in the innerperimeter.
The result is that the ai builds the techcapture team to go to the nearest tech building in CombatZone which is not there so the team runs straight to the origin of the map (0.0,0.0), really funny imo.
Well to test some more i made a 4000x4000 map with an innerperimeter of 1000x1000 placed an oilderrick on (3800.00, 3800.00) and the counter 'USA Tech Building Near' was set to 1, wtfQuestion .
Point of this whole story....the 500.00 is not 500.00 in WB! and i think you can better use this script
Code:Quote:
*** IF ***
Player 'PlyrCivilian' has Greater Than or Equal To 1 unit or structure with Kind is 'TECH_BUILDING' in the area 'CombatZone'
than the one i mentioned at the top of the post.
If anyone knows some more details about this stuff than post it if you like.
/
\
If your going to make a large mod, say, two or more entire factions, it will help to have a sorting system for your models. The way i do it is to put three letters in front of the model. The first two are the faction it belongs to, and the third is what kind of model it is.
Example; NKV_Leopard = NorthKoreaVehicle_Leopard
/
\
Using the program
FinalBIG can help with INI editing, and you'll need it to make .BIG files. It has search(ctrl+f), a way to auto-add values and modules (right click). And you can use notepad inside of it by clicking “edit with editor,” which is useful to find a line of code as pointed out by using Worldbuilder for debugging.
/
\
When getting into modeling, you'll need
Gmax. You'll also need
Renx, an addon that lets you export models as W3D, and
Coofile's W3D Importer, so you can get your models back into Gmax to edit them.
Once you've gotten that stuff, this
tutorial will probley help you get started.
After installing Gmax, put Renx into the C:/gmax/gamepacks folder and put Coolfile's W3D Importer into C:/gmax/scripts, then you should be ready to go.
/
\
If you want a simple mod loader for something your
making, so it dosen't conflict with other mods, you can do this;Put your mod's .big file in your ZH data directory, in My Documents. Make a shortcut directly to your generals.exe in your main ZH folder. Then, go into the shortcut's properties, to the Target field, and add [-mod "YourModName.big"] without brackets.
Found this info here. Thanks to Zeke of Mystique Game Studios!
Edit; the link went dead, so i changed it to just go to the site. This tip can probably still be found somewhere there in its original form.
Edit2; Site no longer exists.
/
\
Want an easy way to have more than two turrets?
Make units spawn inside a unit/structure that has STATION bones, as seen here;
http://www.moddb.com/mod...working-turrets#imageboxSTATION bones basically tell a unit where to pop up when garrisoned inside a non-inclosing structure, such as the Firebase.
Use this code with your object (from precision_bomber's mod, Death Label: Aerial Superiority)
Code:Behavior = SpawnPointProductionExitUpdate ModuleTag_spawnloc
SpawnPointBoneName = STATION
End
Behavior = SpawnBehavior ModuleTag_spawnturt
SpawnNumber = 4
SpawnReplaceDelay = 10000 ;msec
SpawnTemplateName = CzAM_APDSTurret
CanReclaimOrphans = No
SpawnedRequireSpawner = Yes
SlavesHaveFreeWill = No
End
Edit; in this case, the bones can be named what you want them to be as long as they have a two digit number after their name. Bone names are designated infront of SpawnPointBoneName.
/
\
If you try putting ANY SCIENCE above Science_America/Science_China/Science_GLA that requires those sciences, the game crashes.
However if you the science you put does NOT have any required sciences then it's totally fine.
/
\
######################################################################Editor's note; At this point if I add more code boxes, the forum breaks and starts missing
where the boxes are supposed to end. From here down code is in
green.I can't simply indent using spaces, as the forum removes them, so I'll use - for that.
/
######################################################################\
You can combine some faction INIs into one file.
So far I've found its possible to put units, objects, buildings, locomotors, & weapons into a single ini file.
However, it needs to be in a certain order; objects, locomotors & weapons must be above the rest, as those respective ini files are read first.
I have not tried putting in OCLs and other stuff into it though.
Its easier to keep track if everything is in one file methinks.
Editor's note; I havn't tried this myself, but be aware that if you use this
method you might not be able to use, say, a weapon, on a unit in a different
INI due to the fact that the weapon won't be found in weapon.INI.
The game may not be able to find it when it is referenced outside of the file it's data is in.
Only one way to find out..
/
\
To make a building perform research you need a production update behavior;
01 Behavior = ProductionUpdate ModuleTag_06
02 --; nothing
03 EndElse the building is only able to use special powers.
/
\
To train units the exit and rally modules are needed;
01 DefaultProductionExitUpdate
02 --[logic requires NaturalRallyPoint x: co-ordinate to match the object GeometryMajorRadius]
03 --UnitCreatePoint = [x: y: z:]
04 --NaturalRallyPoint = [x: y: z:]
05 --UseSpawnRallyPoint = [Yes/No]
06 EndAnd ProductionUpdate;
01 ProductionUpdate
02
03 [module is required on an object that uses PublicTimer code for any SpecialPower and/or required for units/structures with object upgrades]
04
05 QuantityModifier = [object name,integer] [Redguards uses this so they can comeout of the barracks in pairs]
06 DisabledTypesToProcess = [disabled types list]
07
08 [Allows the use of the DOOR_x_WAITING_OPEN, DOOR_x_CLOSING, DOOR_x_OPENING Model condition state]
09 [X is from 1 to 4 since there's a hardcoded limit of four only]
10 NumDoorAnimations = [integer, maximum is 4] [How many doors to use when unit training is complete?]
11 DoorOpeningTime = [integer, milliseconds] [in mSeconds, how long you want doors to be in open state]
12 DoorWaitOpenTime = [integer, milliseconds] [in mSeconds, time the door stays open, so units can exit]
13 DoorCloseTime = [integer, milliseconds] [in mSeconds, how long you want doors to be in open state]
14
15 MaxQueueEntries = [integer] [If Set to 1, you can't build multiple upgrades at the same time]
16 ConstructionCompleteDuration = [integer, milliseconds] [in mSeconds, wait time so if you have multiple units they don't run over each other]
17
18 End/
\
If you mention a weapon's name (or anything else, generally) before writing its code, it will crash the game and worldbuilder will tell you that the thing's template was not found.
Example;
01 ;;;Example 1, This will cause a crash
02 ;======================================
03 Weapon EMPDefenderMissileWeapon
04 --Code....
05 --HistoricBonusTime = 1500
06 --HistoricBonusCount = 3
07 --HistoricBonusRadius = 20
08 --HistoricBonusWeapon = EMPDefenderSmallCreationWeapon
09 End
10 Weapon EMPDefenderSmallCreationWeapon
11 --DamageType = FLAME
12 --DeathType = BURNED
13 --FireOCL = SupW_OCL_PatriotEMPEffectSpheroid
14 End
15
16 ;======================================
17 ;======================================
18 ;======================================
19 ;Example 2, this will work
20 ;------------------------------------------------------------------------------
21 Weapon EMPDefenderSmallCreationWeapon
22 --DamageType = FLAME
23 --DeathType = BURNED
24 --FireOCL = SupW_OCL_PatriotEMPEffectSpheroid
25 End
26 ;------------------------------------------------------------------------------
27 Weapon EMPDefenderMissileWeapon
28 --Code....
29 --HistoricBonusTime = 1500
30 --HistoricBonusCount = 3
31 --HistoricBonusRadius = 20
32 --HistoricBonusWeapon = EMPDefenderSmallCreationWeapon
33 EndNotice that in Ex. 1 the code references EMPDefenderSmallCreationWeapon,
which is defined beneath it and therfore does not exist yet. This causes a crash.
Ex. 2 shows these in the correct order.
/
\
Changing the behaviour AIUpdateInterface in a map.ini for a tank will cause it to freeze in game, to solve this specify the tank's locomotor again in the code.
Example;
01 Object ChinaTankGattling
02 --ReplaceModule ModuleTag_03
03 ----Behavior = AIUpdateInterface ModuleTag_03_Override
04 ------;Code...
05 ----End
06 ----Locomotor = SET_NORMAL GattlingTankLocomotor
07 --End
08 End/
Edited by user Wednesday, December 26, 2018 3:05:16 AM(UTC)
| Reason: adding stuff