pablodalma
  • pablodalma
  • 50.25% (Neutral)
  • Private Topic Starter
4 years ago
As far as I seen, you can add primary, secondary and tertiary weapons to a vehicle. How about if you want to add another one? Can you modify some file somewhere so vehicles can have 4 weapons?
Sponsor
UTD^Force
4 years ago
Hello pablodalma, how are you doing?

I recommend you take a look into the Avenger tank's code, as it kind of carries the anti-air turret. Another example would be the overlord tank's gattling cannon.
Good luck.
A Muslim, ask me anything about Islam if you want
UTD^Force
Moderator and former map reviewer
Big fan of C&C Labs
pablodalma
  • pablodalma
  • 50.25% (Neutral)
  • Private Topic Starter
4 years ago
I'm not sure if I'm looking the same version of the game but the Avengers have 2 weapons defined? And not 4? So far adding 3 weapons it's easy. But 4 I dont know if there is a workaround to do it since the reserved word "quaternary" doesnt seem to be defined
AdrianeMapMaker
4 years ago
avenger's turret is entirely a new different object ... its has its own mind and weaponset
same as the gattling addon of the overlord


A part of ZH worldbuilders map making community
https://discord.gg/tJ6zyGb 

UserPostedImage




UTD^Force
4 years ago
You won't always get the code online, but I got some time so here it is.
This is the code from the avenger tank itself, the behaviour we are looking at is OverlordContain:

.
.
.
  Behavior = OverlordContain ModuleTag_OverlordContain
    Slots                 = 1
    DamagePercentToUnits  = 100%
    AllowInsideKindOf     = PORTABLE_STRUCTURE
    PassengersAllowedToFire = Yes
    PayloadTemplateName        = AmericaTankAvengerLaserTurret ;name of object with new weapons or whatever
    ExperienceSinkForRider = Yes ; I get the Exp for things my turret friend kills
  End
.
.
.
You can find Object AmericaTankAvengerLaserTurret in the same ini file just before the avenger's code.
Good luck.

A Muslim, ask me anything about Islam if you want
UTD^Force
Moderator and former map reviewer
Big fan of C&C Labs
pablodalma
  • pablodalma
  • 50.25% (Neutral)
  • Private Topic Starter
4 years ago
Ok, thanks. What you showed me helped me but indeed we are looking to different versions of the game, I found the Object Lazr_AmericaTankAvengerLaserTurret in other file, in the LaserGeneralMisc.ini file.

beng
  • beng
  • 66.5% (Friendly)
  • Captain
4 years ago

As far as I seen, you can add primary, secondary and tertiary weapons to a vehicle. How about if you want to add another one? Can you modify some file somewhere so vehicles can have 4 weapons?

Originally Posted by: pablodalma 



The normal 3 weapons are controlled by AIupdate modules.

Yes you can add more than 3 weapons in several different ways:

1. Point defence laser weapons are automatically fired by the module independent of AIupdate - see paladin tank. You can use this to fire any weapon, but best those that don't use projectiles as the weapon will fire from the object origin on the ground and projectiles will tend to blow up immediately when fired.

2. Fireweapon update module will keep firing a weapon - see ECM tank

3. OCLspecial power can be used to fire any weapon via an OCL, see how the scud storm building does this. You can add command buttons to fire as many weapons as you have slots for in your commandset, and using the Worker switching technique, even more (up to 26 weapons per object potentially).

4. Fireweapon collide will fire a weapon when the object touches another object. Useful for objects that damage others by touching them.

5. You can fire weapons via death behaviours, FireWeaponWhenDead or SlowDeathBehaviour (it can fire 3 different weapons) for example.

6. Via overlord or helix contain to add another object with its own weapons as discussed in other replies.