Posted by: haggis - Wednesday, December 9, 2020 12:42:35 AM
Hi guys,
I'm new to modding Generals so I'm just doing slight tweaks, such as adding/changing weapons without actually making a model for the weapon barrels etc.
The end goal here is to have the supply truck double up as a Katyusha rocket platform in endgame. I basically made a new weapon based on the rocket buggy and that part works fine.
The problem I'm running into is that the rockets are fired in direct-fire mode, and I want them to be launched at a pitch, just like a Katyusha. I Googled a bit and found this thread: http://www.cnclabs.com/forums/cnc_postst9649_Modifying-Units.aspx
I tried adding the turret AI module to the supply truck, but it crashes the game on launch for me, I think due to some sort of conflict with the supply box AI module.
What do?
As I'm writing this post I think my best bet may be making an addon for it à-la Overlord and its Gatling cannon?
Thanks!
EDIT
Got the turret part to work by copying the turret behavior from inferno cannon (as opposed to the one in the thread I linked), however the supply trucks are now no longer able to gather supplies.
Is there a way for them to keep the supply AI while also having the turret pitch behavior?
Bonus question: how hard would it be to make the rockets fire from the back of the truck? They are firing from the front right now. I've no idea how to add a weapon bone or even what files would need to be edited for this.
Posted by: Annihilationzh - Wednesday, December 9, 2020 7:35:04 PM
[quote]Got the turret part to work by copying the turret behavior from inferno cannon (as opposed to the one in the thread I linked), however the supply trucks are now no longer able to gather supplies.[/quote]
Like this?
[code=plain] Behavior = SupplyTruckAIUpdate ModuleTag_03
MaxBoxes = 4
SupplyCenterActionDelay = 400 ; ms for whole thing (one transaction)
SupplyWarehouseActionDelay = 1000 ; ms per box (many small transactions)
SupplyWarehouseScanDistance = 700 ;350 ; Max distance to look for a warehouse, or we go home. (Direct dock command on warehouse overrides, and no max on Center Scan)
SuppliesDepletedVoice = SupplyTruckVoiceSuppliesDepleted
Turret
TurretTurnRate = 100
TurretPitchRate = 100
AllowsPitch = Yes
FirePitch = 45
ControlledWeaponSlots = PRIMARY
End
AutoAcquireEnemiesWhenIdle = No NotWhileAttacking
End
Locomotor = SET_NORMAL SupplyTruckLocomotor[/code]
[quote]Bonus question: how hard would it be to make the rockets fire from the back of the truck? They are firing from the front right now. I've no idea how to add a weapon bone or even what files would need to be edited for this.[/quote]
It should be a simple matter of duplicating another bone and moving it.
Posted by: haggis - Monday, December 14, 2020 10:48:00 AM
Sorry I didn't see your reply earlier, thought I activated email notification. [blush]
[quote=Annihilationzh;150044]
Like this?
[/quote]
Works great thanks! I must have messed up the syntax when I tried it (I tried both adding turret behavior inside the supply block and adding a separate AI block for turret).
1. In general, can I put multiple AI behaviors in the same "block"? Is there a limit?
[quote=Annihilationzh;150044]
It should be a simple matter of duplicating another bone and moving it.[/quote]
2. Is this in INIZH.big? I can't find it (I'm a total scrub and only took 1 intro programming course in uni).
Also some more questions if you have time:
3. What makes Dragon Tanks and Flashbang Grenades clear civilian buildings? I tried adding "AllowAttackGarrisonedBldgs = Yes" to large caliber weapons (e.g. overlord gun) but it doesn't work. I also changed the dmg type to explosion so I think it's not a dmg vs human armor issue (tank guys have 100hp, overlord does 80 per shot).
4. Is there a way to effectively increase Dragon Tank weapon range? Simply changing the AttackRange and WeaponSpeed values seems not enough, maybe I need to change the projectile files?
5. How do I add custom music to units/events? E.g. it would be cool if I could play a custom song when I launch specific superweapons, if Chinese propaganda towers (both static and on units) played a tune, if Humvees played Fortunate Son and Apaches played Ride of the Valkyries etc.
I think I've located the sound file call for nuke launches (in SoundEffects.ini, AudioEvent NeutronMissileRelease
Sounds = bneutlau) but I can't find the "bneutlau" file in any of the BIG files.
6. Is there a way to implement choosing "random USA", "random China" and "random GLA" in the skirmish setup screen instead of having to choose a specific faction/general?
7. Is there a way to make the camera further from the battlefield, without installing 3rd party things like gentools?
Posted by: Annihilationzh - Monday, December 14, 2020 7:54:03 PM
[quote]In general, can I put multiple AI behaviors in the same "block"? Is there a limit?[/quote]
There are basics that you can include in any AI module. Turrets are one of those things. Supply, Dozer, Assault Transport, et al cannot be combined.
There's a Module List around somewhere on this forum. It tells you what can and can't be included in a module.
[quote]2. Is this in INIZH.big? I can't find it (I'm a total scrub and only took 1 intro programming course in uni).[/quote]
Nah you need modelling software for that. There should be a tutorial somewhere. Fair warning, setting it up and figuring out how to use it will take quite a while.
[quote]3. What makes Dragon Tanks and Flashbang Grenades clear civilian buildings? I tried adding "AllowAttackGarrisonedBldgs = Yes" to large caliber weapons (e.g. overlord gun) but it doesn't work. I also changed the dmg type to explosion so I think it's not a dmg vs human armor issue (tank guys have 100hp, overlord does 80 per shot).[/quote]
WeaponObjects.ini -> DragonTankFlameProjectile -> MissileAIUpdate -> GarrisonHitKillCount
[quote]4. Is there a way to effectively increase Dragon Tank weapon range? Simply changing the AttackRange and WeaponSpeed values seems not enough, maybe I need to change the projectile files?[/quote]
Yup you answered your own question. Weapon speed doesn't apply to projectile weapons.
[quote]5. How do I add custom music to units/events? E.g. it would be cool if I could play a custom song when I launch specific superweapons, if Chinese propaganda towers (both static and on units) played a tune, if Humvees played Fortunate Son and Apaches played Ride of the Valkyries etc.
I think I've located the sound file call for nuke launches (in SoundEffects.ini, AudioEvent NeutronMissileRelease
Sounds = bneutlau) but I can't find the "bneutlau" file in any of the BIG files.[/quote]
Sorry but I honestly can't remember. I think it's been more than a decade since I last messed with sounds.
[quote]6. Is there a way to implement choosing "random USA", "random China" and "random GLA" in the skirmish setup screen instead of having to choose a specific faction/general?[/quote]
Not that I know of.
[quote]7. Is there a way to make the camera further from the battlefield, without installing 3rd party things like gentools?[/quote]
GameData.ini. Change MaxCameraHeight. IIRC CameraHeight doesn't actually do anything.
Posted by: haggis - Monday, December 14, 2020 11:58:55 PM
[quote=Annihilationzh;150055]Yup you answered your own question. Weapon speed doesn't apply to projectile weapons.[/quote]
Still can't get it to work... Tried increasing FuelLifetime in DragonTankFlameProjectile, but still the flame seems to hit an invisible wall. I'd order the tank to attack from range, it would stop and fire, and not do any dmg due to the flames not actually reaching target.
Posted by: Annihilationzh - Tuesday, December 15, 2020 11:01:09 AM
Play around with it. There are plenty of missiles which work at long range that you can use as a base.
And DragonTankFlameProjectileUpgraded (black napalm) will also need changing.
Posted by: haggis - Wednesday, December 16, 2020 3:14:03 PM
Got it to work! The problem was not in DragonTankFlameProjectileUpgraded, but in FlamethrowerProjectileStreamUpgraded.
I changed the MaxSegments from 4 to 10 (kept DragonTankFlameProjectileUpgraded FuelLifeTime at the increased value), and it can now properly attack at range.
Now this weapon works properly on Dragon Tank, but the graphics (FX) is all off on an Overlord... the flames shoot diagonally down towards the ground right out of the turret and then travels towards the target at ground level. It's a minor thing but would you know where I should look at to fix this? I looked at the locomotor for the flames but it says "air".
Posted by: Annihilationzh - Wednesday, December 16, 2020 3:46:35 PM
AFAIK you'd need to modify the overlord's model. It's not designed for a flame thrower.
The Contra mod has a dragon overlord FYI. You could steal their model.
Posted by: haggis - Thursday, January 7, 2021 2:22:04 AM
[quote=haggis;150050]
I think I've located the sound file call for nuke launches (in SoundEffects.ini, AudioEvent NeutronMissileRelease
Sounds = bneutlau) but I can't find the "bneutlau" file in any of the BIG files.
[/quote]
In case anyone finds this through Google, the answer was that the file was in the Generals BIG files, not ZH ones. Looks like ZH can call assets from the Generals folder.