Joined: 09 Mar 2008 Location: Osaka (JP)/Hong Kong/Germany
Posted: Fri Dec 21, 2012 11:47 am Post subject:
Infantry won't reload its ammo
Subject description: (Yes, this is with Ares)
I am trying to re-create the 'firestorm' effect from Generals in YR. For this, I have created an infantry unit which is created via MakeInfantry from the Mig's warhead. Enough yapping on my part, why won't the following infantry reload it's ammo? Did I forget anything or is it a genuine bug in Ares?
Code:
[FirestormDummy]
UIName=Name:DUMY
Name=Firestorm Dummy
Image=CIV2 ; temp
Category=Soldier
Primary=DummyDelete ; primary weapon which deletes the dummy via limboing, so the deathweapon is not triggered.
Prerequisite=BARRACKS
TiberiumProof=yes
Crushable=no
Warpable=no
Strength=1000
Pip=yellow
OccupyPip=PersonGreen ; choices are green yellow white red blue purple
Armor=special_6 ; this needs to be a newtype, vulnerable only to the Mig's WH
TechLevel=1 ; test
Sight=0
Speed=1
Owner=Americans,British,French,Russians,Confederation,Empire
AllowedToStartInMultiplayer=no
Cost=0
Soylent=0
Points=5
VoiceSelect=
VoiceMove=
VoiceAttack=
VoiceFeedback=
DieSound=
Locomotor={4A582744-9839-11d1-B709-00A024DDAFD1}
PhysicalSize=1
MovementZone=Infantry
ThreatPosed=5 ; This value MUST be 0 for all building addons
ImmuneToVeins=yes
ImmuneToRadiation=yes
ImmuneToPoison=yes
TypeImmune=yes
VeteranAbilities=STRONGER,FIREPOWER,SIGHT,FASTER
EliteAbilities=SELF_HEAL,STRONGER,SIGHT,FASTER,SCATTER
Size=1
InitialAmmo=0
Ammo=-2 ; needs to be negative, since InitialAmmo is really InitialAmmo-1, and setting -1 is a special value.
PipScale=Ammo ; test
Reload=1 ; reload length determines the interval in which additional missiles will cause the firestorm by killing the dummy - after this period, it will gain ammo, fire its primary and delete itself. Think of it like a MaxEC ~rvx
Explodes=yes
DeathWeapon=IvanBomber
;PixelSelectionBracketDelta=999
Perhaps anyone has an idea?
Also, if anyone manages to fix it, do consider it a Tutorial for Mig Firestorms in YR. QUICK_EDIT
Ammo=-2 doesn't exist
-1 means unlimited ammo, everything else needs to be a positive value for a limited amount of ammo
Infantry (just like in TS) reload only when they do the prone transition animation. The reload keys do not work on infantry. _________________ SHP Artist of Twisted Insurrection: Nod buildings
Joined: 09 Mar 2008 Location: Osaka (JP)/Hong Kong/Germany
Posted: Fri Dec 21, 2012 12:36 pm Post subject:
According to ModEnc, -2 (or any other negative number smaller than -1) causes a unit to start with 0 InitialAmmo (-1 simply means "same as Ammo"). Now I'm wondering if the way Ares made Reload work on infantry perhaps did not account for that feature and hence on infantry it does not work as it does on vehicles?
Also, as for Generals' firestorm, it is an effect which kicks in if several flame-based weapons attack the same location. Their damage adds up and if meeting a certain treshhold, a "firestorm" will break out at that location, which is basically a larger napalm flame which lasts for awhile, dealing damage over time to whatever happens to get caught in it.
I suppose if I can't get "zero initial ammo" to work, I could do some animation spawn/damage magic to cause the firestorm dummy to get warped away after some time instead of self-destructing. QUICK_EDIT
Joined: 22 Nov 2010 Location: Iszkaszentgyorgy, Hungary
Posted: Fri Dec 21, 2012 12:53 pm Post subject:
Well first.
If you set InitialAmmo=0 then the inf in question start without ammo. I don't know what the heck your comment wanna mean there, it's just utter stupidity.
Secondly, the Ares hook seems OK from here. I just checked the code. I am moreso thinking about that you got a signed-unsigned mismatch, and InitialAmmo=-2 ended up being 4 million or a complete overflow. QUICK_EDIT
Joined: 09 Mar 2008 Location: Osaka (JP)/Hong Kong/Germany
Posted: Fri Dec 21, 2012 1:03 pm Post subject:
InitialAmmo=0 makes the unit start with 1 Ammo, both according to ModEnc and my own research.
EDIT:
From ModEnc:
Quote:
This flag determines the ammunition supply of a unit, with Ammo set to a positive integer greater than 0, when it is created from the corresponding Factory. Values for InitialAmmo other than −1, which is a special case↓, result in a starting ammo supply of that number plus 1.
Although usable ammo points are only measured in positive integers, it is possible to have a unit's current ammo be a negative number when it is created. If InitialAmmo is set to a negative integer less than −1, the unit will be created with no usable ammunition, and have an inversely proportional delay before it reloads enough to have a positive ammo supply.
If InitialAmmo is set to a value greater than Ammo, then the unit will be created with its current ammo equal to InitialAmmo. However, if the unit has PipScale=ammo, the pip display will innacurately represent an amount equal to Ammo until the unit depletes enough rounds so that its current ammo is no more than Ammo.
Regardless, a unit can never reload its ammo by any means to an amount greater than Ammo, nor deplete its ammo to an amount less than 0.
...implying that someone's previous research turned up with negative values being functional. QUICK_EDIT
Joined: 09 Mar 2008 Location: Osaka (JP)/Hong Kong/Germany
Posted: Fri Dec 21, 2012 1:39 pm Post subject:
Will do.
Edit: Nevermind... issue solved. I made a mistake when transferring ModEnc's instructions - the -2 is supposed to go into the InitialAmmo of course, and I misplaced it into Ammo. *sigh*
Topic can be closed/deleted.
Edit:
The issue that remains though is that the unit will still start with 1 ammo, no matter what InitialAmmo value is set. I will post a bug report for that one. QUICK_EDIT
Joined: 22 Nov 2010 Location: Iszkaszentgyorgy, Hungary
Posted: Fri Dec 21, 2012 4:09 pm Post subject:
Well Cranium, there are times when I can overlook things but recently I've seen too many idiots around.
This is a case where I overlooked it, indeed. _________________ "If you didn't get angry and mad and frustrated, that means you don't care about the end result, and are doing something wrong." - Greg Kroah-Hartman
=======================
Past C&C projects: Attacque Supérior (2010-2019); Valiant Shades (2019-2021)
=======================
WeiDU mods: Random Graion Tweaks | Graion's Soundsets
Maintainance: Extra Expanded Enhanced Encounters! | BGEESpawn
Contributions: EE Fixpack | Enhanced Edition Trilogy | DSotSC (Trilogy) | UB_IWD | SotSC & a lot more... QUICK_EDIT
Joined: 09 Mar 2008 Location: Osaka (JP)/Hong Kong/Germany
Posted: Sun Dec 23, 2012 1:12 pm Post subject:
The idea is that the Mig's warhead places an invisible infantry via MakeInfantry. This infantry has a special armor type which is vulnerable only to the Mig's warhead. It also has a DeathWeapon which creates the firestorm effect.
If subsequent Migs attack the same spot, their attacks will kill the dummy, causing it to explode in a firestorm.
The dummy's HP can be adjusted to determine how many missiles it will take to create a firestorm.
However, to limit the length of time during which additional attacks will cause a firestorm, the dummy needs to be removed after some time (so, for example, you don't end up with a firestorm being created 20 minutes after a Mig attacked a spot, because the dummy is still there). Because Suicide=yes weapons would trigger the DeathWeapon, the dummy infantry instead would use a LimboLaunch weapon which simply makes it disappear. Finally, to determine the length of time the dummy stays placed, we need to impose a delay on it during which it can't fire after spawning. This is where I tried to implement the Ammo system, however it did not work as planned, as the dummy will always start with 1 Ammo now, instantly delete itself and hence is not available to create the firestorm.
An alternative route I'm currently exploring would be to have the animation which creates the dummy also spawn an additional animation which loops N times, then transitions to another animation which deals instantly-fatal damage with a chrono-type warhead, warping the dummy into nothingness without triggering his death weapon. _________________
Mao Zedong wrote:
Our mission, unfinished, may take a thousand years.
Joined: 09 Mar 2008 Location: Osaka (JP)/Hong Kong/Germany
Posted: Sun Dec 23, 2012 3:23 pm Post subject:
Curious, the infantry does actually spawn, that part is working flawlessly. Granted, it spawns NEXT to the building, rather than on top of the building (I assume Ares fixed something here, cause it used to cause an IE pre-Ares), but it does spawn and can be affected by further Mig attacks if the Mig's warhead has enough CellSpread. _________________
Mao Zedong wrote:
Our mission, unfinished, may take a thousand years.
InitialAmmo=0 means the object will start with 1 ammo, because the "reload" function kicks in immediately. In Ares, ammo reload works for infantry too, but InitialAmmo still has this problem. I think only units that need to be reloaded on a building don't suffer from it.
BTW, this was already reported when ammo reload logic in was being tested, but i don't remember what happened with it later.
kenosis wrote:
humm……I remember there used to be"ARES will delete the animations if they cannot spawn",oooh.
Ares indeed doesn't spawn infantry that would end up blocked by something, but apparently it applies only when the game tries to spawn stuff on units or infantry. The engine must be applying some checks for buildings that force spawned infantry into a different spot.
Millennium wrote:
An alternative route I'm currently exploring would be to have the animation which creates the dummy also spawn an additional animation which loops N times, then transitions to another animation which deals instantly-fatal damage with a chrono-type warhead, warping the dummy into nothingness without triggering his death weapon.
Temporal=yes doesn't work on animations. And i don't think there is any way an infantry could make itself vanish after some time without triggering the death weapon (not counting LimboLaunch, but i think that the units vanished that way will still stay in the memory...).
Btw, did you think about giving the weapon a cumulative Attached Effect that deals damage instead of using dummy infantry? Or you could use AE to kill the dummy infantry, if they didn't have a death weapon... QUICK_EDIT
Joined: 19 Aug 2009 Location: Moscow State University
Posted: Mon Dec 24, 2012 2:55 pm Post subject:
Give the infantry a dummy weapon, its firing anim loops several time and then Next to a killing animation to kill itself.
Missile warhead set InfDeathAnim to turn the dummy into a fire animation, and use trailer to do damage. Set warhead animation to do normal damage(Im not sure if infdeathanim can work on animation warhead)
Dummy has no death weapon. _________________ Tired of grabbing my random SHP conversions? Why not learn to create SHPs for yourself? QUICK_EDIT
Joined: 09 Mar 2008 Location: Osaka (JP)/Hong Kong/Germany
Posted: Mon Dec 24, 2012 5:15 pm Post subject:
AttachEffect? This isn't listed in the Ares documentation for 0.2, and I remember hearing something about the AE code being exclusive to MO. I don't have access to it, unless it's available publicly now?
Also very creative concept Ken, thanks much! The only limitation I can currently see from this is that it would turn _any_ infantry into a firestorm, or alternatively, would not be able to be used upon infantry at all. Of course, I can just give the mig two visually identical weapons, one for anti-infantry (with normal death anim), one for other targets (with flamey death). QUICK_EDIT
It's out for a while now. The exact promise of mine was that AE betas will be out after 0.2 got released, and I usually keep my words.
The doc is handled separately to not end up with modders who wouldn't read the "Included in version" footnote reporting their 0.2 doesn't have AE. QUICK_EDIT
Since we're so intent on using MakeInfantry for firestorms, why do you not just make each infantry a "Jumpjet" to spawn on buildings, giving it Armor=Special_1, a weapon that only hurts Special_1 with very small range, and that way, you would need at least 2 to spawn a firestorm.
Voila, no death weapon needed and you can make them just go away. _________________ "Don't beg for things; Do it yourself or you'll never get anything." QUICK_EDIT
If you shot 2 Burst=2, then yes, you could use 4 missiles. The point is, when more than 1 infantry is around, you're going to get a firestorm. Any more than 2 will just fuel it faster.
I suppose you could make the infantry need 3 mig shots to die (strength=600 or something and a firestorm would do 1000% damage to them), but then you couldn't make it jumpjet unless your migs are now anti-air as well.
Wouldn't spawning a building with BuildAnywhere=yes be more efficient? That way it would at least be in the damage radius of the projectile. _________________ "Don't beg for things; Do it yourself or you'll never get anything." QUICK_EDIT
Joined: 09 Mar 2008 Location: Osaka (JP)/Hong Kong/Germany
Posted: Wed Dec 26, 2012 1:55 pm Post subject:
Spawning buildings via warheads? You've lost me there, I guess I'm not up to date on what the latest Ares can do. Apart from that, 4Star's solution with the infantry with special weapons did work more or less, I did the minor modification of adding AttackFriendlies. Last edited by Millennium on Wed Dec 26, 2012 2:00 pm; edited 1 time in total QUICK_EDIT
Joined: 22 Nov 2010 Location: Iszkaszentgyorgy, Hungary
Posted: Wed Dec 26, 2012 1:59 pm Post subject:
Noone made such yet. O_o _________________ "If you didn't get angry and mad and frustrated, that means you don't care about the end result, and are doing something wrong." - Greg Kroah-Hartman
=======================
Past C&C projects: Attacque Supérior (2010-2019); Valiant Shades (2019-2021)
=======================
WeiDU mods: Random Graion Tweaks | Graion's Soundsets
Maintainance: Extra Expanded Enhanced Encounters! | BGEESpawn
Contributions: EE Fixpack | Enhanced Edition Trilogy | DSotSC (Trilogy) | UB_IWD | SotSC & a lot more... QUICK_EDIT
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