Posted by: haggis - Thursday, January 7, 2021 2:19:23 AM
1. How should I go about implementing OCLs to replace standard unit spawns in a barracks? Say, I want the faction barracks to have a button that spawns 6 rifles and 2 rockets as a standard platoon, in 1 go. I know how to make the OCL, but not how to implement the command button to the barracks' command set (mostly because there is no CommandButton with an OCL that I can copy off of - I tried looking at OverlordGattling but it's an upgrade and not repeatable).
2. Are there any downsides to using regular units instead of faction-specific ones when I use them in my OCLs (e.g. standard China redguards vs Tank General's redguards), if the units are otherwise the same? It would save me quite a few lines of pseudocode.
3. Is it possible to make "free shooting" weapons without resorting to hidden contain modules with custom untrainable infantry? I'd like to add short range AA machine guns to tanks, but don't know how to make them not bound to the direction the tank or the turret is facing.
4. Is it possible to change the size/radius of an explosion FX (e.g. the nuke cannon's explosion)? Or make it fit the radius of the weapon somehow?
Posted by: Annihilationzh - Thursday, January 7, 2021 4:21:43 AM
[quote]1. How should I go about implementing OCLs to replace standard unit spawns in a barracks? Say, I want the faction barracks to have a button that spawns 6 rifles and 2 rockets as a standard platoon, in 1 go. I know how to make the OCL, but not how to implement the command button to the barracks' command set (mostly because there is no CommandButton with an OCL that I can copy off of - I tried looking at OverlordGattling but it's an upgrade and not repeatable).[/quote]
I would use SpawnBehavior instead of an OCL.
I.E. Create an angry mob that doesn't enslave it's spawns. See the tunnel network for an example of non-slave spawns.
Side note: Without slaves, an angry mob will never despawn - ever. A deletionupdate can fix that.
[quote]2. Are there any downsides to using regular units instead of faction-specific ones when I use them in my OCLs (e.g. standard China redguards vs Tank General's redguards), if the units are otherwise the same? It would save me quite a few lines of pseudocode.[/quote]
The differences can be a problem. Upgrades, free veterancy, and similar won't apply.
You could spawn regular rebels as stealth general and they won't have camo - because he ironically doesn't actually have the camouflage upgrade.
[quote]3. Is it possible to make "free shooting" weapons without resorting to hidden contain modules with custom untrainable infantry? I'd like to add short range AA machine guns to tanks, but don't know how to make them not bound to the direction the tank or the turret is facing.[/quote]
In Weapon.ini, AcceptableAimDelta allows units to fire without turning. You can also have a second turret via AI modules (AltTurret).
[quote]4. Is it possible to change the size/radius of an explosion FX (e.g. the nuke cannon's explosion)? Or make it fit the radius of the weapon somehow?[/quote]
It's handled by FXList.ini and ParticleSystem.ini.
Fair warning here, it can take hours to do even the simplest things with particles. It took me hours just to recolour a nuke into an anthrax gamma bomb.
Posted by: haggis - Friday, January 8, 2021 12:34:35 AM
Thanks ^^
More questions today:
1. Is it possible to make a unit lose stealth when damaged below a threshold (to simulate the loss of stealth coating)?
I tried looking in the ModuleList file, but it doesn't specify what's "status bit types" or "object condition types".
[quote]
StealthUpdate
[This module allows the use of SoundStealthOn and SoundStealthOff parameters on the object and is hardcoded to display MESSAGE:StealthNeutralized when the object has been discovered]
UseRiderStealth = [Yes/No]
StealthDelay = [integer, milliseconds]
MoveThresholdSpeed = [integer]
StealthForbiddenConditions = [Object Condition types]
HintDetectableConditions = [Status Bit types]
FriendlyOpacityMin = [percentage]
FriendlyOpacityMax = [percentage]
PulseFrequency = [integer, milliseconds]
RevealDistanceFromTarget = [real number]
ForbiddenStatus = [Status Bit types]
RequiredStatus = [Status Bit types]
OrderIdleEnemiesToAttackMeUponReveal = [Yes/No]
InnateStealth = [Yes/No]
EnemyDetectionEvaEvent = [Entry from Eva.ini]
OwnDetectionEvaEvent = [Entry from Eva.ini]
GrantedBySpecialPower = [Yes/No]
BlackMarketCheckDelay = [integer, milliseconds]
[Note: This part needs the DISGUISER KindOf defined on the object and
[allows the use of DisguiseStarted and DisguiseRevealedSuccess
[and DisguiseRevealedFailure within UnitSpecificSounds section of the object]
DisguisesAsTeam = [Yes/No]
DisguiseFX = [entry from FXList.INI]
DisguiseRevealFX = [entry from FXList.INI]
DisguiseTransitionTime = [integer, milliseconds]
DisguiseRevealTransitionTime = [integer, milliseconds]
End[/quote]
2. I tried adding the following ECM behavior to (vanilla China's) ChinaTankOverlordPropagandaTower, but it doesn't work:
[quote]
Behavior = FireWeaponUpdate ModuleTag_23
Weapon = ECMTankMissileJammer
;ExclusiveWeaponDelay = 1000 ; If we fire a real weapon, we turn this module off for this long
End
[/quote]
3. Can I really put *anything* in "ModuleTag_xx"? Like "ModuleTag_Stealth", or "ModuleTag_PropTower"? I wouldn't need to double check the numbers if I just put names on the modules I add.
4. Is there a way to change a weapon into having 2 components? E.g. if I want to add a pistol sidearm to rocket guys and could modify the rocket weapon, I'd need quite a bit less edits than if I went into all 12 factions.
5. How important are KindOf tags? So far I haven't bothered adding any.
Posted by: Annihilationzh - Friday, January 8, 2021 4:21:04 AM
[quote]1. Is it possible to make a unit lose stealth when damaged below a threshold (to simulate the loss of stealth coating)? I tried looking in the ModuleList file, but it doesn't specify what's "status bit types" or "object condition types".[/quote]
I don't want to say no, because it might be possible with a convoluted workaround. But there is no simple way to do it.
All the kindofs, statusbits, et al are at the bottom of the file.
[quote]2. I tried adding the following ECM behavior to (vanilla China's) ChinaTankOverlordPropagandaTower, but it doesn't work:[/quote]
I would guess that's because it's technically garrisoned inside the overlord, but I'm not sure.
In world builder you can place an overlord propaganda tower on the floor by itself. You could see if it works there.
[quote]3. Can I really put *anything* in "ModuleTag_xx"? Like "ModuleTag_Stealth", or "ModuleTag_PropTower"? I wouldn't need to double check the numbers if I just put names on the modules I add.[/quote]
Pretty much. MT_PropTower or even just MTPT would work. I'm not sure about really extreme stuff like obscure unicode characters.
[quote]4. Is there a way to change a weapon into having 2 components? E.g. if I want to add a pistol sidearm to rocket guys and could modify the rocket weapon, I'd need quite a bit less edits than if I went into all 12 factions.[/quote]
You mean like a two-in-one weapon? You can try but I'm not sure you'd be able to get the pistol to actually look like bullets. The missile would be doing the bullet damage.
[quote]5. How important are KindOf tags? So far I haven't bothered adding any.[/quote]
They have various effects. The MOAB plane has kindofs to prevent it from being clicked. Heroes have a kindof to give them a minimap pip. DRONE makes them immune to neutron.
Some of them are only there so they can be identified by other units. Like the bunker needs to know that tanks aren't allowed inside; toxin pools need to only be targeted by cleanup; and it would be awkward if a nuke got shot by an avenger.
Posted by: haggis - Saturday, January 9, 2021 2:11:56 AM
[quote=Annihilationzh;150140][quote]2. I tried adding the following ECM behavior to (vanilla China's) ChinaTankOverlordPropagandaTower, but it doesn't work:[/quote]
I would guess that's because it's technically garrisoned inside the overlord, but I'm not sure.
In world builder you can place an overlord propaganda tower on the floor by itself. You could see if it works there.[/quote]
Sadly world builder isn't working for me due to my modding :/ the game launches fine but apparently the world builder is pickier about syntax.
Meanwhile I got more questions:
1. Do weapon ranges account for altitude? E.g. if a plane flies at 100 height and an AA gun had 99 range (or a bit lower than that to account for the unit's height), would it not be able to hit the plane?
2. When do I need to specify AutoChooseSources in weaponsets (beside "none", that one I can see the purpose)?
3. ScatterRadius in Weapon.ini... is there a way to set it to a cone (i.e. smaller radius if short range, larger if long range)? It looks pretty silly when I set a scatter radius and the close range shots look like they've been fired from a blunderbuss.
4. Is there a table for things I should be aware of when adding things? For instance, a custom weapon needs to be referenced in the unit's weaponset. Can I just add new damage types and reference them in armor.ini? New armor types and reference them in units?
Posted by: Annihilationzh - Saturday, January 9, 2021 4:15:48 AM
[quote]Sadly world builder isn't working for me due to my modding :/ the game launches fine but apparently the world builder is pickier about syntax.[/quote]
I am horrified that you're not fixing those errors.
[quote]1. Do weapon ranges account for altitude? E.g. if a plane flies at 100 height and an AA gun had 99 range (or a bit lower than that to account for the unit's height), would it not be able to hit the plane?[/quote]
AFAIK range ignores altitude - although I've never actually tested it so I could be wrong. Although a high damage explosion on the floor can hit planes.
[quote]2. When do I need to specify AutoChooseSources in weaponsets (beside "none", that one I can see the purpose)?[/quote]
I only ever do it when one of the weapons needs a none. I've never had any issues.
[quote]3. ScatterRadius in Weapon.ini... is there a way to set it to a cone (i.e. smaller radius if short range, larger if long range)? It looks pretty silly when I set a scatter radius and the close range shots look like they've been fired from a blunderbuss.[/quote]
Not that I know of. The closest would be giving the unit multiple weapons with different ranges, minimum ranges and scatter radius.
[quote]4. Is there a table for things I should be aware of when adding things? For instance, a custom weapon needs to be referenced in the unit's weaponset. Can I just add new damage types and reference them in armor.ini? New armor types and reference them in units?[/quote]
Pretty much the only lists/documentation for this game is the module list and what you find in the ini files themselves. We had to learn pretty much everything from trial and error - and world builder's error detection.
One day a major mod team tried to add one too many upgrades and discovered there is an upgrade limit of 128 (IIRC). The devs never told us anything.
Armor.ini tells you what the damage types are, and that's it. That's all you can work with. The rest are hard coded.
Posted by: thanasis92 - Saturday, January 9, 2021 6:10:47 AM
Hello gentlemen,
I am trying to add some simple mods just for fun to Zero Hour (for example make Tomahawk vehicle available to Laser General). Although I am realy careful with the procedure with the .ini files, following the available tutorials step-by-step, nothing happens in the game.
I have tried also the simplest of all, change the construnction cost of a vehicle or delete a prerequisite with no result! Game runs with the original values.
Any suggestion ?
Posted by: Annihilationzh - Saturday, January 9, 2021 7:19:39 AM
[quote=thanasis92;150145]Hello gentlemen,
I am trying to add some simple mods just for fun to Zero Hour (for example make Tomahawk vehicle available to Laser General). Although I am realy careful with the procedure with the .ini files, following the available tutorials step-by-step, nothing happens in the game.
I have tried also the simplest of all, change the construnction cost of a vehicle or delete a prerequisite with no result! Game runs with the original values.
Any suggestion ?[/quote]
90% you have the files in the wrong place.
Posted by: thanasis92 - Saturday, January 9, 2021 7:34:15 AM
[quote=Annihilationzh;150146]
90% you have the files in the wrong place.[/quote]
All the .ini files are extracted to ZeroHour\Data\INI.
Posted by: Annihilationzh - Saturday, January 9, 2021 8:34:52 AM
[quote=thanasis92;150147]All the .ini files are extracted to ZeroHour\Data\INI.[/quote]
That honestly sounds like the most common extraction mistake. But to be sure - what is the full directory of AIData.ini?
Posted by: thanasis92 - Saturday, January 9, 2021 8:43:55 AM
[quote=Annihilationzh;150148]
That honestly sounds like the most common extraction mistake. But to be sure - what is the full directory of AIData.ini?[/quote]
I wish to be a simple mistake as that! There are two AIData.ini:
1) C:\Program Files (x86)\CnC Generals\ZeroHour\Data\INI
2) C:\Program Files (x86)\CnC Generals\ZeroHour\Data\INI\Default
Posted by: Annihilationzh - Saturday, January 9, 2021 9:08:02 AM
Well you did not make the common mistake. But I've never seen this before:
C:\Program Files (x86)\[i][u][b]CnC Generals\ZeroHour[/b][/u][/i]\Data\INI
So does this mean your other files are here?
C:\Program Files (x86)\CnC Generals\ZeroHour\INIZH.big
C:\Program Files (x86)\CnC Generals\ZeroHour\Generals.exe
If yes, you have the right location for the INI files - and we'll have to figure out what else is going wrong.
Posted by: thanasis92 - Saturday, January 9, 2021 9:12:56 AM
[quote=Annihilationzh;150150]
So does this mean your other files are here?
[/quote]
Of course they are here... (during installation I have changed the original path "Command & Conquer... etc" in order to have smaller path)
Posted by: Annihilationzh - Saturday, January 9, 2021 9:21:44 AM
Sorry, I had to check. Sometimes you get people on here who do the strangest things.
Second thing to consider - your operating system. Windows has been known to stop people from editing program files. You may need to lookup a fix or move the folder.
If it's not that, I'm running out of ideas of what could be going wrong.
Posted by: thanasis92 - Saturday, January 9, 2021 9:30:32 AM
[quote=Annihilationzh;150152]Windows has been known to stop people from editing program files. You may need to lookup a fix or move the folder.[/quote]
My OS is Windows 10. I am aware of that annoying issue, but I am afraid it's not the case; I double check every .ini file after saving, by closing and reopening it, to be sure that the changes are there.
Posted by: Annihilationzh - Saturday, January 9, 2021 9:47:45 AM
Well I'm stumped. Something is stopping the game from reading the INIs and if it's not windows then I have no idea what it could be.
Posted by: thanasis92 - Saturday, January 9, 2021 9:54:04 AM
[quote=Annihilationzh;150154]Well I'm stumped. Something is stopping the game from reading the INIs and if it's not windows then I have no idea what it could be.[/quote]
I have deleted (temporarily) all the .ini files AND the INIZH.big and the game runs smoothly! I give up!
Posted by: Annihilationzh - Saturday, January 9, 2021 10:03:47 AM
I'm still suspicious of windows. I once had the exact issue you're having but in vista. My standing suggestion is to install the game outside of program files.
I keep my games on a different hard drive, and I haven't had this issue in years.
Posted by: thanasis92 - Saturday, January 9, 2021 10:06:32 AM
[quote=Annihilationzh;150156]I'm still suspicious of windows. I once had the exact issue you're having but in vista. My standing suggestion is to install the game outside of program files.
I keep my games on a different hard drive, and I haven't had this issue in years.[/quote]
I have nothing to lose. I will try that now.
Posted by: thanasis92 - Saturday, January 9, 2021 11:35:51 AM
[quote=Annihilationzh;150156]I'm still suspicious of windows.[/quote]
You had right! I reinstalled the game away from Program Files and finally, any change to .ini file is applied into the game! Thanx General, it's time for some experiments!
Posted by: haggis - Sunday, January 10, 2021 2:17:52 AM
[quote=Annihilationzh;150144][quote]Sadly world builder isn't working for me due to my modding :/ the game launches fine but apparently the world builder is pickier about syntax.[/quote]
I am horrified that you're not fixing those errors.[/quote]
I fixed most of them, but these 2 remain (World Builder can't find them):
Weapon FirestormSmallCreationWeapon
WeaponTemplate FirestormSmallCreationWeapon
Pretty sure that weapon exists? I copied it from inferno cannon to a new weapon I made, is it because my new weapon is at the top of the file?
Also I've no idea what to do with the World Builder once I'm in. It seems like a tool for making maps?
Posted by: Annihilationzh - Sunday, January 10, 2021 4:19:32 AM
[quote]fixed most of them, but these 2 remain (World Builder can't find them):
Weapon FirestormSmallCreationWeapon
WeaponTemplate FirestormSmallCreationWeapon[/quote]
I have seen that before but I can't remember what causes it. I'm thinking it's an error near the weapon or in the code of the unit, rather than the actual weapon.
You do need to be careful with anything world builder detects. Every error can make the game unstable.
This tool can help:
https://contra.cncguild.net/oldsite/Eng/checker.php
If you give me the results of a scan by this tool, I should be able to tell you what's wrong.
[quote]Also I've no idea what to do with the World Builder once I'm in. It seems like a tool for making maps?[/quote]
It is and that makes it great for testing mods. It's error checker is also gold.
Posted by: haggis - Sunday, January 10, 2021 9:11:24 PM
[quote=Annihilationzh;150160]
If you give me the results of a scan by this tool, I should be able to tell you what's wrong.[/quote]
That's a lot of warnings, not sure if it's because my INI folders only has the INIs I actually modified.
[quote]It is and that makes it great for testing mods. It's error checker is also gold.[/quote]
Does it only output maps? Do I make a map with objects in it, then load it up in-game like a save file? [ATTACH]2312[/Attach]
Posted by: Annihilationzh - Monday, January 11, 2021 3:32:10 AM
I'm laughing my head off at that result.
See the top of the error log. It only detected and scanned 15 ini files and 4 upgrades. There are 87 upgrades and 135 ini files in the base game. So the scan failed. It needs to scan all the ini files or it will detect all the missing things.
I'd understand if it detected 0 upgrades - that would mean it couldn't find upgrade.ini - but it found 4? lol? I'm guessing that you have a syntax error between upgrades 4 & 5 in upgrade.ini.
[quote]That's a lot of warnings, not sure if it's because my INI folders only has the INIs I actually modified.[/quote]
Most of the errors are because the error checker didn't find all the ini files. There are some minor errors in the base ini files though. Mostly stuff like death types not being covered.
Posted by: haggis - Monday, January 11, 2021 8:15:53 PM
I have 12 ini files in there, and upgrade.ini is not one of them :/
Posted by: Annihilationzh - Tuesday, January 12, 2021 4:01:11 AM
The scanner needs to scan all ini files or it won't work. Why do you only have 12? Did you delete some?
Posted by: haggis - Wednesday, January 13, 2021 1:40:18 AM
[quote=Annihilationzh;150167]The scanner needs to scan all ini files or it won't work. Why do you only have 12? Did you delete some?[/quote]
I only copied over the files I actually changed hehe... Is that not how I'm supposed to mod the game? (beside the obvious problem of the tool requiring all the files for the check)
Got some more questions in the meantime:
1. When I add ECM behavior to a unit, the unit keeps playing the shooting FX (with the muzzle fire, without actually shooting) in a loop. How do I fix this? (I have commented out the line where the ECM behavior stops when the main weapon shoots, not sure if that affects this)
2. Is it possible to add scatter to bullet weapons? I tried adding scatter to minigunner's anti-air weapon, it doesn't seem to do anything.
3. Is it possible to add pierce to gattlings? Or should I just add an AoE?
4. I added stealth to Overlord and would like it to lose it whenever it does anything. However, its gattling can shoot without breaking stealth, even though I have StealthForbiddenConditions = MOVING FIRING_PRIMARY ATTACKING RIDERS_ATTACKING
5. Is it possible to create a "support fire" link between units? I'm thinking of making arties have a second, longer range attack that requires a spotter (either infantry or a support vehicle). Would some kind of code from the Patriots work here? I looked at it but it seemed to require the same unit...
6. The Internet Center has a giant comment warning against changing its build limit of 1. Is it due to the satellite hack or to the hacker contain module? I'm thinking of adding other buildings/vehicles with hacker contain behavior, but only if it wouldn't give me random crashes.
Posted by: Annihilationzh - Wednesday, January 13, 2021 5:06:23 AM
[quote]1. When I add ECM behavior to a unit, the unit keeps playing the shooting FX (with the muzzle fire, without actually shooting) in a loop. How do I fix this? (I have commented out the line where the ECM behavior stops when the main weapon shoots, not sure if that affects this)[/quote]
So that's called WeaponMuzzleFlash in the draw module.
The simplest and quickest solution is to remove the muzzle flash entirely with HideSubObject.
However, It might stop doing that if you make the gun/cannon and muzzle flash the secondary weapon. I'm not sure.
[quote]Is it possible to add scatter to bullet weapons? I tried adding scatter to minigunner's anti-air weapon, it doesn't seem to do anything.[/quote]
Bullet weapons don't have AoE. So if you add scatter they'll miss 100% of the time. I can't remember at all if scatter does something different to air weapons.
[quote]3. Is it possible to add pierce to gattlings? Or should I just add an AoE?[/quote]
Pierce like going through the unit and damaging things behind? It's awkward in this game to create anything like that. You'd need a projectile weapon, and you'd have to disable collision so the projectile wouldn't just hit things, and the projectile would need it's own AoE weapon to do damage.
[quote]4. I added stealth to Overlord and would like it to lose it whenever it does anything. However, its gattling can shoot without breaking stealth, even though I have StealthForbiddenConditions = MOVING FIRING_PRIMARY ATTACKING RIDERS_ATTACKING[/quote]
You could have it reveal itself when the overlord's fake gattling gun fires. But that's about it. A seriously convoluted workaround might be able to do it.
[quote]5. Is it possible to create a "support fire" link between units? I'm thinking of making arties have a second, longer range attack that requires a spotter (either infantry or a support vehicle). Would some kind of code from the Patriots work here? I looked at it but it seemed to require the same unit...[/quote]
It's semi-feasible. You could experiment with drone spotting or the Avenger's designator.
The only way I can think of that might get the patriot method working would be to have the spotter and the artillery be the same unit. Like giving the spotter an upgrade into the artillery.
This is really pushing it, but the technical's variations might be able to make two different units identified as one.
[quote]6. The Internet Center has a giant comment warning against changing its build limit of 1. Is it due to the satellite hack or to the hacker contain module? I'm thinking of adding other buildings/vehicles with hacker contain behavior, but only if it wouldn't give me random crashes.[/quote]
It's the satellite.
I once converted the listening outpost into a hacker truck and the only bug was that the tank hunters would randomly decided not to shoot.
Posted by: Adjiesman - Thursday, January 14, 2021 9:37:02 AM
Hi, i'm new modder, I want to ask, I have finished modeling my tank, but when in the game, the tank that I made can not be clicked directly, how do I fix this?
Posted by: Annihilationzh - Thursday, January 14, 2021 1:11:13 PM
[quote=Adjiesman;150179]Hi, i'm new modder, I want to ask, I have finished modeling my tank, but when in the game, the tank that I made can not be clicked directly, how do I fix this?[/quote]
In code there's only one cause for that. The wrong kindofs. I can't help if it's a mistake in the model's design. I'm not that well versed in gmax.
Posted by: Adjiesman - Friday, January 15, 2021 1:12:00 PM
Thanks for your responding, but I mean the problem is that the unit I made can be drag select but cannot be directly select, for example I have a dozer in the field, then I directly select the dozer but nothing happens, as soon as I drag select it can, I have try to fix the kindofs and the model, it's still the same.
Posted by: haggis - Saturday, January 16, 2021 2:03:11 AM
A single question today:
Is it possible to force a weapon to only aim in the direction of a vehicle, without any Z-plane (up and down) delta?
I tried adding machine guns (well, cannons) to jets, and IRL they would only shoot where the jet's nose is pointing. But in game, the machine guns would shoot targets on the ground without the jet actually tipping its nose down (basically the reverse of a quad cannon shooting up).
Posted by: Annihilationzh - Saturday, January 16, 2021 9:18:55 AM
[quote=Adjiesman;150181]Thanks for your responding, but I mean the problem is that the unit I made can be drag select but cannot be directly select, for example I have a dozer in the field, then I directly select the dozer but nothing happens, as soon as I drag select it can, I have try to fix the kindofs and the model, it's still the same.[/quote]
Yeah I understood the first time. I can't help you to fix a model.
[quote=haggis;150182]A single question today:
Is it possible to force a weapon to only aim in the direction of a vehicle, without any Z-plane (up and down) delta?
I tried adding machine guns (well, cannons) to jets, and IRL they would only shoot where the jet's nose is pointing. But in game, the machine guns would shoot targets on the ground without the jet actually tipping its nose down (basically the reverse of a quad cannon shooting up).[/quote]
The marauder tank has that feature. Min/MaxTargetPitch. I presume it should work on planes.
Posted by: haggis - Saturday, January 16, 2021 6:03:46 PM
[quote=Annihilationzh;150183]The marauder tank has that feature. Min/MaxTargetPitch. I presume it should work on planes.[/quote]
1. I believe this worked, however it introduced a new issue:
If the jets cannot shoot at a ground target with the machine gun due to pitch, it will not attempt to find a proper attack vector; instead it will just circle the target (since its machine gun clip isn't empty, it will not return to base by itself - I did put the clip reloads upon return to base on the machine gun weapon) and take AA fire. How do I fix this?
I have found this in the A10:
[quote]
Behavior = DeliverPayloadAIUpdate ModuleTag_07
End
[/quote]
However it's an AI and I think a unit can't have 2 AI packages?
EDIT test that behavior out, the game launches with it (alongside the jet's default AI), however it doesn't do what I think it does and completely kills the jet/airfield interaction (jets will refuse to land).
2. What does this line actually do?
ArmedRidersUpgradeMyWeaponSet = Yes
I've seen it in the Assault Troop Crawler, which is quite puzzling since it's more or less just a mobile bunker no? It already has PassengersAllowedToFire = Yes
3. Why does the helix get a WeaponsetUpgrade with Black Napalm? I'd get it if the Napalm Bomb was part of its Weaponset, but it's not. Is it old code I can replace? (I'd like to use its WeaponsetUpgrade behevior for something else)
Posted by: Annihilationzh - Sunday, January 17, 2021 7:17:44 AM
[quote]1. I believe this worked, however it introduced a new issue:
If the jets cannot shoot at a ground target with the machine gun due to pitch, it will not attempt to find a proper attack vector; instead it will just circle the target (since its machine gun clip isn't empty, it will not return to base by itself - I did put the clip reloads upon return to base on the machine gun weapon) and take AA fire. How do I fix this?[/quote]
This has come up before with people wanting an A10 that lands at an airfield. We never found a way to get it to dive whilst attacking. You can do things like mimic the comanche or use an aurora's locomotor switch, but neither one really works well.
[quote]However it's an AI and I think a unit can't have 2 AI packages?[/quote]
That is correct. It won't crash but it won't work either.
[quote]2. What does this line actually do?
ArmedRidersUpgradeMyWeaponSet = Yes
I've seen it in the Assault Troop Crawler, which is quite puzzling since it's more or less just a mobile bunker no? It already has PassengersAllowedToFire = Yes[/quote]
When the crawler is empty it has no weapon. When it's occupied it has a dummy weapon. The dummy weapon is to fix targeting.
[quote]3. Why does the helix get a WeaponsetUpgrade with Black Napalm? I'd get it if the Napalm Bomb was part of its Weaponset, but it's not. Is it old code I can replace? (I'd like to use its WeaponsetUpgrade behevior for something else)[/quote]
I would remove it and see if anything changes. I'm pretty sure nothing will.
I'm thinking it was supposed to upgrade the napalm bomb in an earlier game version. In the current version the napalm bomb upgrades itself to black napalm. The helix has other obsolete code as well. Note the other WeaponsetUpgrade for the gattling cannon.
Posted by: Adjiesman - Sunday, January 17, 2021 9:08:36 AM
[quote=Annihilationzh;150183]Yeah I understood the first time. I can't help you to fix a model.[/quote]
Never mind, after all i've fixed it. This time, i have another question. is it possible to make America jet B3 that can shoot a missile like the Tomahawk or SCUD Launcher?
Posted by: Annihilationzh - Sunday, January 17, 2021 6:44:21 PM
[quote=Adjiesman;150186]Never mind, after all i've fixed it. This time, i have another question. is it possible to make America jet B3 that can shoot a missile like the Tomahawk or SCUD Launcher?[/quote]
Yup. Are you having trouble implementing it?
Posted by: haggis - Monday, January 18, 2021 2:53:54 PM
[quote=Annihilationzh;150185]This has come up before with people wanting an A10 that lands at an airfield. We never found a way to get it to dive whilst attacking. You can do things like mimic the comanche or use an aurora's locomotor switch, but neither one really works well.[/quote]
I tried making the weapon anti-air only, but the jets still won't go back to base after emptying their missiles.
1. It is possible for jets to return to base by themselves when there's nothing to shoot at in the skies with the (AA only) machine gun and empty missiles clip?
2. I tried adding the angry mob Molotov cocktails to Redguards. They sorta work (the inf makes a weird twitch when they throw it however), but they don't work at all on Minigunners (it has lower range than their gun but even at short range they won't throw them). Any ideas how to fix?
3. Is it possible to boost the range of a container? I think just garrisoning units comes with a 25% range boost, but I'd like choppers to have a bigger boost for their garrisoned units than Overlords (since projectiles should have more range from height).
4. I made INFA's helix bunker inherent to the helix; that part works fine, what doesn't is the draw module (I simply added the bunker's draw module to the helix). The bunker bits get drawn, but when the helix is tilted (it tilts as much as 45 degrees when going full speed), the bunker bits stay parallel to the ground.
5. Is there a smarter way to combine 2 buildings than copying all the code into the other? E.g. If I want to make a Gattling Gun Bunker, can I just use OCLs?
Posted by: Annihilationzh - Monday, January 18, 2021 7:54:35 PM
[quote]1. It is possible for jets to return to base by themselves when there's nothing to shoot at in the skies with the (AA only) machine gun and empty missiles clip?[/quote]
Not directly. It will stay in the air as long as it has any ammo of any kind. Planes are very limited in what you can do with their weapons without getting issues like this. Even bike logic doesn't work on them.
[quote]2. I tried adding the angry mob Molotov cocktails to Redguards. They sorta work (the inf makes a weird twitch when they throw it however), but they don't work at all on Minigunners (it has lower range than their gun but even at short range they won't throw them). Any ideas how to fix?[/quote]
See the comanche. They'll only use their primary weapon by default. You have to tell them when to use others. I'm actually surprised the red guard works.
[quote]3. Is it possible to boost the range of a container? I think just garrisoning units comes with a 25% range boost, but I'd like choppers to have a bigger boost for their garrisoned units than Overlords (since projectiles should have more range from height).[/quote]
I'm pretty sure that's a no.
[quote]4. I made INFA's helix bunker inherent to the helix; that part works fine, what doesn't is the draw module (I simply added the bunker's draw module to the helix). The bunker bits get drawn, but when the helix is tilted (it tilts as much as 45 degrees when going full speed), the bunker bits stay parallel to the ground.[/quote]
Well, now you know why I never suggested doing that with the overlord lol. The simplest solution is to just make a three-in-one addon. I've never bothered trying to fix it any other way.
[quote]5. Is there a smarter way to combine 2 buildings than copying all the code into the other? E.g. If I want to make a Gattling Gun Bunker, can I just use OCLs?[/quote]
Depends on how you do the OCL. You can put an overlord addon on practically anything. With a normal OCL you would end up with two seperate buildings overlapping each other.
Posted by: haggis - Monday, January 18, 2021 9:04:45 PM
[quote=Annihilationzh;150194]Not directly. It will stay in the air as long as it has any ammo of any kind. Planes are very limited in what you can do with their weapons without getting issues like this. Even bike logic doesn't work on them.[/quote]
I got it to "work" by removing the "return to base" behavior from the machine gun; now the jets will return by themselves after firing the missiles, even if they didn't fire the machine gun at all. I'll just put a big reload time on it (big enough that it won't have reloaded before returning to base) so that it effectively can only have 1 clip fired per sortie.
[quote]See the comanche. They'll only use their primary weapon by default. You have to tell them when to use others. I'm actually surprised the red guard works.[/quote]
I... don't quite get it. Don't most units use all their weapons? What's special about the Comanche/Minigunner/Redguard?
I added these lines to the Minigunner's AI and it works now:
[quote] ; this is a bit of a trick... normally, units cannot move-and-fire at
; the same time. we need the comanche to be able to. so we give it
; a "turret" (invisible) and put the two main weapons on it, but with
; no turn rate. voila!
Turret
TurretTurnRate = 0 ; this "turret" does not turn
TurretPitchRate = 0 ; nor does it pitch
ControlledWeaponSlots = TERTIARY
End[/quote]
Redguards still work out of the box, somehow. I tested it both with the player and an AI faction controlling the Redguards.
Also, I added a service rifle to the Supply Truck (those dudes work in the frontline!) and the Dozer... I don't know why, but somehow it killed the Supply Truck's KatyushaWeapon that I added earlier. I can still make it fire with ctrl + left click for attack ground, but the units will not fire the weapon:
1. if I target an actual enemy (both through clicking and through control clicking);
2. by themselves, ever
Also, unlike the Dozer (who just sits there and attacks with what's basically an infantry rifle just like an infantry unit would), it will shoot 1 shot of its rifle (it has a clip of 3) and immediately turn away. So even that part of the weapon does not work.
I have added the "CAN_ATTACK" kindof to it, doesn't change anything (also, the KatyushaWeapon worked fine before without this).
Is this related to what you said about the Comanche? Why (tanks work fine when I give them 3 weapons)? How do I fix this? They already have a turret behavior in their AI.
EDIT: I think this part may partly be due to attack range... the rocket barrage has a minimum range of 100, and the rifle has a maximum range of 100. If I just disable the rifle weapon, the rocket barrage works fine. Does this also mean I can't add a small caliber secondary weapon to artillery pieces for self defense?
Posted by: haggis - Tuesday, January 19, 2021 2:23:40 AM
Sorry for double post, another question...
How does one make historic weapon OCLs work?
I tried to follow the trail of FirestormSmallCreationWeapon. The weapon leads to OCL_FirestormSmall, the OCL leads to an Object named FirestormSmall, but the Object I can't find in WeaponObjects, nor anywhere else.
Then I tried following the trail of DirtyNukeCreationWeapon; it leads thru the OCL to an Object named CargoTruckNuke, which from the code looks like a carbon copy of the nuclear missile. I tried using its template to make my own historic OCL, but it doesn't work at all.
Posted by: Annihilationzh - Tuesday, January 19, 2021 5:37:43 AM
[quote]I... don't quite get it. Don't most units use all their weapons?[/quote]
The comanche fires the PRIMARY machine gun at everything. But it won't fire it's SECONDARY missiles at infantry because it's not told to in the code.
If you make the missiles the PRIMARY weapon they'll shoot at infantry.
[quote]Also, unlike the Dozer (who just sits there and attacks with what's basically an infantry rifle just like an infantry unit would), it will shoot 1 shot of its rifle (it has a clip of 3) and immediately turn away. So even that part of the weapon does not work.[/quote]
I don't remember ever coming across that before. They do have a weapon - mine removing. It's possible that code is messing with it.
[quote]I tried to follow the trail of FirestormSmallCreationWeapon. The weapon leads to OCL_FirestormSmall, the OCL leads to an Object named FirestormSmall, but the Object I can't find in WeaponObjects, nor anywhere else.[/quote]
You're looking for System.ini
Historic is handled entirely by the weapon. When the shot threshold is reached the weapon fires on the ground where it happened.
Have you tested the dirty nuke? I have a vague memory that says something is wrong with it.
Posted by: haggis - Tuesday, January 19, 2021 6:21:01 PM
[quote=Annihilationzh;150197]The comanche fires the PRIMARY machine gun at everything. But it won't fire it's SECONDARY missiles at infantry because it's not told to in the code.
If you make the missiles the PRIMARY weapon they'll shoot at infantry.[/quote]
Is that due to the lines
PreferredAgainst = PRIMARY INFANTRY
AutoChooseSources = PRIMARY FROM_PLAYER FROM_SCRIPT FROM_AI
Or is it some other part of the code?
The thing is, I got the molotov cocktail working on Minigunners working with the fake turret (copied from Comanche), not with weaponset stuff.
Anyhow my specific issue is resolved, just trying to understand how this all works.
[quote]I don't remember ever coming across that before. They do have a weapon - mine removing. It's possible that code is messing with it.[/quote]
Oh I meant the SupplyTrucks with their arty weapon I added, sorry if it wasn't clear.
I'm fairly sure that it's a weapon range issue now. Is it impossible to have a functional unit with 2 weapons that have non-overlapping ranges? (in this case I had 100-300 and 0-100)
[quote]You're looking for System.ini[/quote]
If I were to make a new weapon object, should it go to WeaponObjects.ini or System.ini?
Intuition says WeaponObjects, but I did just try that and it didn't work and there's this FirestormSmall that sits in System.ini and works.
[quote]Have you tested the dirty nuke? I have a vague memory that says something is wrong with it.[/quote]
I just tested it as a historic bonus on the Inferno Cannon (since I know for a fact that the Inferno Cannon's historic bonus works fine). It works great actually!
Two other historic bonus weapons did not work great, however:
1. I tried BlackNapalmFirestormSmallCreationWeapon on my Katyusha launchers since I know it works for other weapons and has a very distinctive look, it did not trigger at all. My code looks like this:
[quote]Weapon KatyushaWeapon
PrimaryDamage = 10.0
PrimaryDamageRadius = 10.0
ScatterRadiusVsInfantry = 20.0 ;When this weapon is used against infantry, it can randomly miss by as much as this distance.
SecondaryDamage = 5.0
SecondaryDamageRadius = 20.0
AttackRange = 350.0
MinimumAttackRange = 100.0 ;150.0 ; Rockets take some distance to target, and you don't want them to blow up in your face.
MinTargetPitch = -90
MaxTargetPitch = 79
DamageType = EXPLOSION ; ignored for projectile weapons
DeathType = EXPLODED
WeaponSpeed = 200 ; ignored for projectile weapons
ProjectileDetonationFX = WeaponFX_RocketBuggyMissileDetonation
ProjectileObject = InfernoTankShell ; KatyushaRocket TomahawkMissile InfernoTankShell RocketBuggyMissile
ProjectileExhaust = MissileExhaust
VeterancyProjectileExhaust = HEROIC HeroicMissileExhaust
RadiusDamageAffects = ALLIES ENEMIES NEUTRALS
ScatterRadius = 100 ; This weapon will scatter somewhere within a circle of this radius, instead of hitting someone directly
DelayBetweenShots = 100 ; time between shots, msec
ClipSize = 48 ; how many shots in a Clip (0 == infinite)
ClipReloadTime = 12000 ; how long to reload a Clip, msec
AutoReloadsClip = Yes
AutoReloadWhenIdle = 12100 ; If I haven't fired in this long, I will reload on my own (rather than only after the last one is fired)
FireFX = FX_BuggyMissileIgnition
FireSound = RocketBuggyWeapon
ProjectileCollidesWith = STRUCTURES
MissileCallsOnDie = Yes
HistoricBonusTime = 5000
HistoricBonusCount = 3
HistoricBonusRadius = 30
HistoricBonusWeapon = BlackNapalmFirestormSmallCreationWeapon
End[/quote]
My guess is that the scatter makes it never proc due to the condition not being met? Not sure.
2. I tried Nuke_NuclearTankDeathWeapon as historic weapon on the Inferno Cannon, doesn't work at all... What's causing this?
Extra question:
3. Can I make a unit not fire a specific weapon while contained? Molotov cocktails are nice and all but look kinda silly when thrown out of a Troop Crawler.
Posted by: Annihilationzh - Tuesday, January 19, 2021 7:15:55 PM
[quote]Is that due to the lines
PreferredAgainst = PRIMARY INFANTRY
AutoChooseSources = PRIMARY FROM_PLAYER FROM_SCRIPT FROM_AI
Or is it some other part of the code?[/quote]
No. IIRC that doesn't actually do anything. The primary weapon will always fire. It's this part:
[code=plain] PreferredAgainst = SECONDARY VEHICLE STRUCTURE[/code]
It tells the missiles when to fire. Otherwise they just won't fire at all.
[quote]I'm fairly sure that it's a weapon range issue now. Is it impossible to have a functional unit with 2 weapons that have non-overlapping ranges? (in this case I had 100-300 and 0-100)[/quote]
Have you tried giving the secondary weapon a PrefferedAgainst VEHICLE INFANTRY STRUCTURE?
[quote]If I were to make a new weapon object, should it go to WeaponObjects.ini or System.ini?
Intuition says WeaponObjects, but I did just try that and it didn't work and there's this FirestormSmall that sits in System.ini and works.[/quote]
Doesn't matter. You can put them anywhere in the object folder. Even XXX.ini
[quote]1. I tried BlackNapalmFirestormSmallCreationWeapon on my Katyusha launchers since I know it works for other weapons and has a very distinctive look, it did not trigger at all. My code looks like this:[/quote]
Does it work if you increase the radius to match the scatter? I don't know how the count works in the hard code, but I'm thinking it might be reset when a lot of projectiles land outside of the radius.
[quote]2. I tried Nuke_NuclearTankDeathWeapon as historic weapon on the Inferno Cannon, doesn't work at all... What's causing this?[/quote]
I honestly don't know. I've never seen this before.
[quote]3. Can I make a unit not fire a specific weapon while contained? Molotov cocktails are nice and all but look kinda silly when thrown out of a Troop Crawler.[/quote]
I don't think so. I could be misremembering though.
Posted by: haggis - Tuesday, January 19, 2021 11:27:00 PM
[quote=Annihilationzh;150202]Have you tried giving the secondary weapon a PrefferedAgainst VEHICLE INFANTRY STRUCTURE?[/quote]
Just tried the rocket launcher on PRIMARY, and the service rifle on SECONDARY Preferred Against INFANTRY, nope doesn't work.
[quote]Doesn't matter. You can put them anywhere in the object folder. Even XXX.ini[/quote]
Omg... Does this mean I could'a put all my new things (weapons, OCLs etc) into something called haggis.ini? Well 1 for each folder that is...
[quote]Does it work if you increase the radius to match the scatter? I don't know how the count works in the hard code, but I'm thinking it might be reset when a lot of projectiles land outside of the radius.[/quote]
Just tried it, nope doesn't work.
I tried commenting out MissileCallsOnDie = Yes... the only other line that doesn't usually appear on vanilla weapons with historic bonus. What does that line even do? Anyhow whether it's commented out doesn't change anything.
I have 3 hypothesis remaining... Either it just plain doesn't work on weapons with Scatter (but why?), or the amount of crap I'm generating is too much so the historic weapon is skipped (also unlikely... I have generated more crap before than this playing the vanilla game), or something funky is happening due to the vehicle firing the weapon (since I have problems with the vehicle too... maybe I missed something on the SupplyTruck).
[quote]So that's called WeaponMuzzleFlash in the draw module.
The simplest and quickest solution is to remove the muzzle flash entirely with HideSubObject.
However, It might stop doing that if you make the gun/cannon and muzzle flash the secondary weapon. I'm not sure.[/quote]
Btw I finally got around to testing this out, and it totally works when I swap the main gun with its muzzle flash (and all the other PRIMARY weapon draw modules) to SECONDARY.
Also, I haven't had another crash despite running Overlords with ECM behavior and the full 3 weapons. Maybe my earlier crash was due to something else?
Another question:
Is it possible to make a unit have a range A with its weapon, and a range B with its weapon if the fog of war is cleared by another unit? Maybe implemented as a special power with a separate weapon?
Posted by: Adjiesman - Wednesday, January 20, 2021 4:41:16 AM
[quote=haggis;150203]Omg... Does this mean I could'a put all my new things (weapons, OCLs etc) into something called haggis.ini? Well 1 for each folder that is...[/quote]
yes, you can do it, but it has to be in order, me thinks.
Posted by: Annihilationzh - Wednesday, January 20, 2021 11:49:19 AM
[quote]Omg... Does this mean I could'a put all my new things (weapons, OCLs etc) into something called haggis.ini? Well 1 for each folder that is...[/quote]
I've never actually tried it with weapons or ocls.
[quote]Is it possible to make a unit have a range A with its weapon, and a range B with its weapon if the fog of war is cleared by another unit? Maybe implemented as a special power with a separate weapon?[/quote]
The game kinda does that already with artillery. They can't see very far so other units have to scout for them. But you can enhance range with drone spotting.
Posted by: haggis - Wednesday, January 27, 2021 1:08:37 AM
I found the issue with my historic weapon woes!!
It was related to the earlier error prompt I got with WorldBuilder.
All my guesses were wrong. The problem was simply that my custom weapons were placed above the history weapons in the Weapons.ini file. Once I moved them to the bottom of the file everything works fine.
Posted by: Annihilationzh - Wednesday, January 27, 2021 9:15:01 PM
FYI that means one of your custom weapons has bad syntax. This is why we fix world builder errors. The game may not crash but you're getting glitches and instabilities.