Logo Platform
logo amplifiers simplified

QQ: What do the following TargetProperty entries modify?

Reply
Copied to clipboard!
0Send private message0Send private message
7 years ago
May 31, 2017, 12:47:27 PM

Yes, I noticed the ship design bug too. We are working on it.
For your error, I followed your steps 2 times but I had no errors ... I continue to investigate :)


0Send private message
7 years ago
May 31, 2017, 11:34:43 AM
Dagart wrote:

I tried to create another "Reskin mod" to test the ship's reskin and it seems to work during combats: 

I have just tried it and it seems to work but in an odd way, The New textures seem to be applied in a battle.

so the ships desgin shows the original textures at first then during at battle the new textures are applied then after the battle the ship design shows the new textures

(First Picture: Before Battle, Second: The Battle, Third: After Battle)


Also Exiting to main menu and making a new game with only this mod being enabled the whole time casues an error


NullReferenceException: Object reference not set to an instance of an object

Stack:

Amplitude.Diagnostics:UnityEngineLogCallback(System.Reflection.ParameterInfo, System.Reflection.ParameterInfo, System.Reflection.ParameterInfo) at Error while parsing stackframe: Generator.ConnectivityManager.FindMajorAxis (IEnumerable`1 nodes)(0) Amplitude.Diagnostics:UnityEngineLogCallback(System.Reflection.ParameterInfo, System.Reflection.ParameterInfo, System.Reflection.ParameterInfo) at Error while parsing stackframe: Generator.ConnectivityManager.CullExtraneousNodes ()(0) Amplitude.Diagnostics:UnityEngineLogCallback(System.Reflection.ParameterInfo, System.Reflection.ParameterInfo, System.Reflection.ParameterInfo) at Error while parsing stackframe: Generator.ConnectivityManager.Execute ()(0) Amplitude.Diagnostics:UnityEngineLogCallback(System.Reflection.ParameterInfo, System.Reflection.ParameterInfo, System.Reflection.ParameterInfo) at Error while parsing stackframe: Generator.GenerationManager+c__Iterator0.MoveNext ()(0) Amplitude.Diagnostics:UnityEngineLogCallback(System.Reflection.ParameterInfo, System.Reflection.ParameterInfo, System.Reflection.ParameterInfo) at Error while parsing stackframe: UnityEngine.SetupCoroutine.InvokeMoveNext (IEnumerator enumerator, IntPtr returnValueAddress)(0)
Updated 7 years ago.
0Send private message
0Send private message0Send private message
7 years ago
May 30, 2017, 8:42:01 AM

I believe activating any mod will break scan mode, even the example mods do it (could you also look into why the example reskin mod doesn't work, It doesn't reskin the ships)

Updated 7 years ago.
0Send private message
0Send private message0Send private message
7 years ago
May 27, 2017, 5:54:37 PM

I've been trying to affect damage at specific ranges. Looking through the various xml files, I've found the following:


<Modifier TargetProperty="DamageShort"              Operation="Percent" Value="$(DamageShort)"                  Path="ClassShip/ClassSection/ClassModuleWeapon" />
<Modifier TargetProperty="DamageMedium"          Operation="Percent" Value="$(DamageMedium)"             Path="ClassShip/ClassSection/ClassModuleWeapon" />
<Modifier TargetProperty="DamageLong"               Operation="Percent" Value="$(DamageLong)"                   Path="ClassShip/ClassSection/ClassModuleWeapon" />


I'm guessing these are for reporting only? I've been trying to use them like such:



<Modifier TargetProperty="DamageShort" Operation="Percent" Value="0.1" Path="ClassShip/ClassSection/ClassModuleWeapon,!ClassModuleWeaponFlack" />


...to give a weapon a bonus 10% damage at short range, but it doesn't seem to work. 


How can I mod the damage of weapons at the various ranges?






0Send private message
0Send private message
7 years ago
May 28, 2017, 3:49:43 AM

Eureka, I finally figured out how to do it! It was kind of a pain, especially when you misspell the property you're trying to attach :)


Anyhow, I figured out how to create a new property and can now mod weapon effects at any range increment discreetly (rather than just damage over all). My code is a mess at the moment, but I'll post a mod once I've got it cleaned up. 


At it's most basic, it's a combination of modding the BattleEffectDefinitions.xml and SimulationDescriptors[ModuleWeapon].xml files.


0Send private message
7 years ago
May 28, 2017, 12:49:16 AM

As it turns out, I found something that does the opposite effect:


DefenseBonusAtShortRange


It reduces damage by a percentage, in this case, 25%. So, the game can definitely tell when a weapon is striking within short range. I just haven't found the descriptor for it yet.

Updated 7 years ago.
0Send private message
7 years ago
May 27, 2017, 9:32:21 PM

I also found 

public enum WeaponRange
 {
     DeadZone,
     Short,
     Medium,
     Long
 }


So there is a 4th range type, they are numbered 0 - 3

Also found

public enum WeaponType
 {
     Undefined,
     Kinetic,
     Missile,
     Laser,
     Beam,
     Flack,
     Destruction
 }

Which are numbered 0 - 6, I don't remember seeing the destruction type but it might be the planet destroyer


In the Available range code there is a reference to another piece of code /Assembly-CSharp/EncounterTargetingRangeDefinition

Might also be of use

0Send private message
7 years ago
May 27, 2017, 9:04:35 PM

Thanks for posting the code. I believe that pertains to the highlighted portion of the XML below (providing the entire Weapon Module entry for completeness):


    <WeaponModule Name="ModuleWeaponBeam1" Type="Beam" Family="BeamBase" Level="1">
        <Cost ResourceName="SystemProduction">20</Cost>
        <!-- ** START AI DATA ** -->
        <!-- Weapons types -->
        <AIBattleSituations Situation="EnergyWeapon" Mode="Use" Value="1"/>
        <!-- Armor types -->
        <AIBattleSituations Situation="EnergyDefense" Mode="Against" Value="-1"/>
        <AIBattleSituations Situation="ProjectileDefense" Mode="Against" Value="1"/>
        <!-- Specific weapons -->
                <AIBattleSituations Situation="Beam" Mode="Use" Value="1"/>
                <AIBattleSituations Situation="Kinetic" Mode="Against" Value="1"/>
                <AIBattleSituations Situation="Missile" Mode="Against" Value="-1"/>
                <AIBattleSituations Situation="Laser" Mode="Against" Value="-0.5"/>
   
        <!-- Ranges -->
                <AIBattleSituations Situation="Short" Mode="Use" Value="1"/>
                <AIBattleSituations Situation="Medium" Mode="Use" Value="0.75"/>
                <AIBattleSituations Situation="Long" Mode="Use" Value="0.75"/>
                <AIBattleSituations Situation="Short" Mode="Against" Value="1"/>
                <AIBattleSituations Situation="Medium" Mode="Against" Value="0.75"/>
                <AIBattleSituations Situation="Long" Mode="Against" Value="0.25"/>
        <!-- ** END AI DATA ** -->
       
        <PathPrerequisite Flags="Edition" Inverted="true">ClassShip,CannotHaveWeapon</PathPrerequisite>
        <PathPrerequisite Flags="ShipHasDestructionModule,Edition,Disable" Inverted="true">ClassShip/ClassSection/ClassModuleDestruction</PathPrerequisite>
        <SimulationDescriptorReference Name="ClassModuleWeapon"/>
        <CategorizedSimulationDescriptors Category="CategoryBaseWeapon">
            <SimulationDescriptorReference Name="ModuleWeaponBeam1"/>
        </CategorizedSimulationDescriptors>
        <CategorizedSimulationDescriptors Category="CategoryModuleWeaponBeam">
            <SimulationDescriptorReference Name="ClassModuleWeaponBeam"/>
        </CategorizedSimulationDescriptors>
        <BattleActionReference Name="Weapon_Initialize"/>
        <BattleActionReference Name="Weapon_SalvoHitFlotillaShield"/>
        <BattleActionReference Name="Weapon_SalvoHitShipShield"/>
        <BattleActionReference Name="Weapon_SalvoApplyShieldDamage"/>
        <BattleActionReference Name="Weapon_SalvoLaunched"/>
        <BattleActionReference Name="Weapon_SalvoPrepareHitTarget"/>
        <BattleActionReference Name="Weapon_SalvoHitTarget"/>
        <BattleActionReference Name="Weapon_SalvoPostHitTarget"/>
        <BattleActionReference Name="Weapon_SalvoPostHitTarget_StatisticsRecording"/>
        <BattleActionReference Name="WeaponBeam_SalvoPostHitTarget_StatisticsRecording"/>
        <BattleActionReference Name="Weapon_UpdateAccuracyAfterMiss"/>
        <SalvoReference Name="SalvoBeam1"/>
        <AvailableRange RangeName="Short" PenaltyPropertyName="ShortRangePenalty"/><!--Standard Beam weapon range availability--> 
        <AvailableRange RangeName="Medium" PenaltyPropertyName="MediumRangePenalty"/><!--Added this so Beam weapon can fire at this range-->
        <AvailableRange RangeName="Long" PenaltyPropertyName="LongRangePenalty"/><!--Added this so Beam weapon can fire at this range-->
        <TargetSortingCriterion Name="Type">
            <ScoreModifier Name="Ship">1</ScoreModifier>
        </TargetSortingCriterion>
        <TargetSortingCriterion_PropertyMultiplier Name="PropertyMultiplier">
            <ScoreModifier Name="OffensiveMilitaryPowerIfWeakestTargeting">-1</ScoreModifier>
        </TargetSortingCriterion_PropertyMultiplier>
        <TargetSortingCriterion Name="Role" ScoreModifiersDefaultValue="1" IgnoredWhenCheckingTargetValidity="true"/>
        <TargetSortingCriterion_PropertyMultiplier Name="PropertyMultiplier">
            <ScoreModifier Name="TargetersCount">-1</ScoreModifier>
            <ScoreModifier Name="TargetingWeightBonus">1</ScoreModifier>
        </TargetSortingCriterion_PropertyMultiplier>
    </WeaponModule>

0Send private message
7 years ago
May 27, 2017, 8:02:23 PM

I been looking around the Assemblies and in Assembly-CSharp/WeaponModuleDefinition/AvailableRange looks like code that might have some answers (might not) 

https://pastebin.com/fBwWQpjE (Best if you know C#)

I haven't look through it in-depth so it might be useless to you, but I thought I would give it to you in case it might be.  

0Send private message
7 years ago
May 27, 2017, 7:13:27 PM

I've actually tried it as you're describing, IE as a ShipStatBonus, plus I've also tried adding the modifier directly to weapons like such:


<SimulationDescriptor Name="ModuleWeaponBeam1"  Type="ModuleWeapon">
  <Modifier TargetProperty="Damage" Operation="Addition"    Value="130"  TooltipHidden="true"/>

  <Modifier TargetProperty="DamageShort" Operation="Addition" Value="13" Path="ClassShip/ClassSection ClassModuleWeapon,!ClassModuleWeaponFlack"/>
</SimulationDescriptor>


Note: The DamageBeam TargetProperty doesn't seem to do anything either, which leads me to believe it also is for accounting purposes in the afterbattle report rather than for during combat.

Updated 7 years ago.
0Send private message
7 years ago
May 27, 2017, 6:17:05 PM

If its not working it may be due to how its being applied ? 

What SimulationDescriptor have you been placing these modifiers under ?




Edit: I would suggest (if you have not tried it already) 

Adding it as a ship role modifier and applying it to all ships so in Simulation/Battles/SimulationDescriptors[Ship].xml


<SimulationDescriptor Name="ShipStatRangeChange"  Type="ShipStatBonus2">

<Modifier TargetProperty="DamageShort" Operation="Percent" Value="0.1" Path="ClassShip/ClassSection/ClassModuleWeapon,!ClassModuleWeaponFlack" />

<[more modifiers if you want]/>
</SimulationDescriptor>


and then in Simulation/Battles/ShipRoleDefinitions.xml

add a 

<SimulationDescriptorReference Name="ShipStatRangeChange"/>

to all roles

Updated 7 years ago.
0Send private message
?

Click here to login

Reply
Comment