haggis
  • haggis
  • 50.25% (Neutral)
  • Private Topic Starter
5 years ago
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.

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.
Sponsor
Annihilationzh
5 years ago

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.



Like this?

  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

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.


It should be a simple matter of duplicating another bone and moving it.
If you need help, post in the forum. You'll get help a lot faster than if you send me a PM.

I reject all buddy requests. I don't think 'buddy' needs to be made official. It's not like you're marrying me.
haggis
  • haggis
  • 50.25% (Neutral)
  • Private Topic Starter
5 years ago
Sorry I didn't see your reply earlier, thought I activated email notification. 😊


Like this?

Originally Posted by: Annihilationzh 



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?


It should be a simple matter of duplicating another bone and moving it.

Originally Posted by: Annihilationzh 



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?
Annihilationzh
5 years ago

In general, can I put multiple AI behaviors in the same "block"? Is there a limit?


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.

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).


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.

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).


WeaponObjects.ini -> DragonTankFlameProjectile -> MissileAIUpdate -> GarrisonHitKillCount

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?


Yup you answered your own question. Weapon speed doesn't apply to projectile weapons.

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.


Sorry but I honestly can't remember. I think it's been more than a decade since I last messed with sounds.

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?


Not that I know of.

7. Is there a way to make the camera further from the battlefield, without installing 3rd party things like gentools?


GameData.ini. Change MaxCameraHeight. IIRC CameraHeight doesn't actually do anything.
If you need help, post in the forum. You'll get help a lot faster than if you send me a PM.

I reject all buddy requests. I don't think 'buddy' needs to be made official. It's not like you're marrying me.
haggis
  • haggis
  • 50.25% (Neutral)
  • Private Topic Starter
5 years ago

Yup you answered your own question. Weapon speed doesn't apply to projectile weapons.

Originally Posted by: Annihilationzh 



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.
Annihilationzh
5 years ago
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.
If you need help, post in the forum. You'll get help a lot faster than if you send me a PM.

I reject all buddy requests. I don't think 'buddy' needs to be made official. It's not like you're marrying me.
haggis
  • haggis
  • 50.25% (Neutral)
  • Private Topic Starter
5 years ago
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".
Annihilationzh
5 years ago
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.
If you need help, post in the forum. You'll get help a lot faster than if you send me a PM.

I reject all buddy requests. I don't think 'buddy' needs to be made official. It's not like you're marrying me.
haggis
  • haggis
  • 50.25% (Neutral)
  • Private Topic Starter
5 years ago


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.

Originally Posted by: haggis 



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.