Posted: Mon Aug 08, 2016 3:28 pm Post subject:
Ammo and NoAmmoWeapon
Subject description: I don't understand...
Code:
[CHAMP]
UIName=Name:CHAMP
Name=Crusader Tank
Prerequisite=RADAR,GAWEAP
Primary=105AP
Secondary=105mm2
PipScale=Ammo
Ammo=2
ManualReload=yes
NoAmmoWeapon=1
NoAmmoAmount=2
Strength=555
Category=AFV
Armor=heavy
Turret=no
IsTilter=yes
Crusher=yes
TooBigToFitUnderBridge=true
TechLevel=7
Sight=8
Speed=5
CrateGoodie=yes
Owner=British,French,Germans,Americans,Alliance,Japan
AllowedToStartInMultiplayer=yes
Cost=1100
Soylent=550
Points=25
ROT=8
IsSelectableCombatant=yes
Explosion=TWLT070,S_BANG48,S_BRNL58,S_CLSN58,S_TUMU60
VoiceSelect=ChampSelect
VoiceMove=ChampMove
VoiceAttack=ChampAttackCommand
DieSound=GenVehicleDie
MoveSound=TankDestroyerMoveStart
CrushSound=TankCrush
MaxDebris=2
; origional - Locomotor={55D141B8-DB94-11d1-AC98-006008055BB5}
Locomotor={4A582741-9839-11d1-B709-00A024DDAFD1}
;MovementZone=Destroyer ;gs FLAW needs to be changed to this when The Flaw is fixed
MovementZone=Normal
ThreatPosed=15 ; This value MUST be 0 for all building addons
DamageParticleSystems=SparkSys,SmallGreySSys
VeteranAbilities=STRONGER,FIREPOWER,SIGHT,FASTER
EliteAbilities=SELF_HEAL,STRONGER,FIREPOWER,ROF
Accelerates=false
ImmuneToVeins=yes
Size=3
Weight=3.5
ElitePrimary=105AP
EliteSecondary=105mm2E
Sensors=yes
SensorsSight=5
Bunkerable=no
I want its primary weapon as the ammo part considered ammo weapon and its secondary as the non-ammo weapon. The problem is the unit isn't firing its ammo weapon/primary anymore and it keeps firing its secondary. If I make the NoAmmoAmount lower, it will keep firing it's supposedly ammo weapon/primary non-stop when it should be consuming ammo.
Can someone help me on this part as I'm getting confused to get this work. QUICK_EDIT
No ammo weapon needs to be set in the weapon section. I don't have access to my codes, but I can tell you that for both weapons to work you have to go to each of them and set at what ammo to fire. For example the secondary weapon needs to have ammo=0 as stated above. Then when the unit reaches ammo 0 it will start using the secondary weapon. _________________ "If it ain't broke, don't fix it."
"If you are loyal to everybody, can you truly be loyal to anybody?"
Ares Documentation: http://ares-developers.github.io/Ares-docs/
My YouTube Channel: https://www.youtube.com/channel/UCtxeQoEM_iVd-F-xUIwleyQ
PillBox20's Red Alert 2 Mod: http://www.moddb.com/mods/pillbox20s-red-alert-2/downloads/pillbox20s-red-alert-2-version-02 Last edited by PillBox20 on Tue Aug 09, 2016 12:26 pm; edited 2 times in total QUICK_EDIT
Anyway, regarding this, another question. Is this only works on units? I tried to do it on defenses but it seems I can't able to make it work. QUICK_EDIT
So, it's not really possible? I was under the impression that structures would work given that in Ares particularly on NoAmmoWeapon section:
"Units and structures usually always use the same weapon against the same target. If the weapon is not charged because ammo is depleted, the unit will wait for it to reload. It will not try the next available weapon that might not even need ammunition." QUICK_EDIT
It could be that a feature of the game interferes with it: Hospital=no and Armory=no buildings immediately reload their ammo when empty. _________________ QUICK_EDIT
So should I insert the Hospital=no and Armory=no tag or what?
Well, I tried to tweak those tags but still I can't get it to work. It still always fires its primary(The ammo weapon) weapon and never fires its secondary(The no-ammo weapon) weapon. QUICK_EDIT
chr0nicz420, I tested your most recently posted code (on the Pillbox instead of a tank - just to see if this setup worked on buildings, and it does in Ares 0.C) and noticed something odd:
This Pillbox only fires the VulcanDummy weapon, though. Setting it to 0 makes it work fine.
The Ares documentation on NoAmmoWeapon & NoAmmoAmount says (emphasis mine):
"If the current ammo is equal to or below this value, the NoAmmoWeapon will be used. Defaults to 0."
Because of this, the Primary never fires even with full Ammo. That might be part of your problem. Post your weapons' code too, just in case. QUICK_EDIT
Apparently, it suddenly worked which I don't know how as I didn't make any changes at all. Besides, I know about NoAmmoAmmount should be set to 0. Here's the code:
Gattling can perform this kind of switch as well
If the next stage weapon require more ammo than current ammo the unit has, it won't go to the next stage and stay at current stage.
This heli fires missile and machine gun alternately (looks simultaneously due to small ROF) when ammoed and fires only machine gun without ammo
Also, it can deploys to fire rocket QUICK_EDIT
For the record; what gameaddict11707 meant was that:
for you to have two weapons firing (alternatively or otherwise), NoAmmoAmount needs to be LESS THAN Ammo.
i.e.
Ammo = 1
NoAmmoAmount = 0
NoAmmoWeapon = 1
[SecWeapon]
Ammo=0
This way, the primary will fire when Ammo is full (Ammo is 1), and in doing so one ammo unit is lost (Ammo is 0). With ammo at 0, the secondary weapon fires continuously until the Ammo reloads (Ammo back at 1).
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum