22. Nov 2017, 14:07 Hallo Gast.
Willkommen Gast. Bitte einloggen oder registrieren. Haben Sie Ihre Aktivierungs E-Mail übersehen?

Einloggen mit Benutzername, Passwort und Sitzungslänge


Select Boards:
 
Language:
 

News:



Autor Thema: Changing the damage on towers  (Gelesen 695 mal)

Offline Titan

  • Thain des Auenlandes
  • *
  • Beiträge: 29
  • "Fly you fools!"
Changing the damage on towers
« am: 2. Mai 2016, 18:20 »
Hey, I am fairly new to coding and I wanted to tweek/change the damage dealt by the 'AmonSulTower' and 'AmonSulTower2' buildings for my new map as I find their damage per shot to be too high.

Some detailed help on where to find it and how to implement it would be very much appreciated!  :)

Offline Prinz von Dol Amroth

  • Edain Team
  • Held von Helms Klamm
  • *****
  • Beiträge: 1.265
Re: Changing the damage on towers
« Antwort #1 am: 2. Mai 2016, 18:35 »
Open your object.ini and search its WeaponSet.
Open the data\ini\weapon.ini and search the Weapon (AmonSulArrowTowerBow).
If the Weapon has a ProjectileNugget, search its WarheadTemplateName.
The damage value is normally in a DamageNugget block.
DamageNugget                       
Damage        = KEEP_BOW_UPGRADED_DAMAGE
Radius        = 0.0 // HitStoredTarget means we hurt the person we launched at.  And nobody else.  So a miss hurts nobody.
DelayTime     = 0
DamageType    = FLAME
DamageFXType  = FLAME
DeathType     = BURNED
End
DamageNugget                        // A basic Nugget that just does damage
Damage        = KEEP_BOW_DAMAGE
;DamageScalar  = 0% NONE +EntMoot +ElvenEntMoot
Radius        = 0.0 // HitStoredTarget means we hurt the person we launched at.  And nobody else.  So a miss hurts nobody.
DelayTime     = 0
DamageType    = STRUCTURAL // Moving all structure-based weapons over to Structural Damage for balance reasons - GB
DamageFXType  = GOOD_ARROW_PIERCE
DeathType     = NORMAL
End
We have two DamageNugget blocks, so we have two Damage Values (A normal DamageType and a FLAME DamageType.)
You can write your desired Damage behind "Damage =" or you can change the Value of the MACRO_NAME, a variable, KEEP_BOW_UPGRADED_DAMAGE in the data\ini\gamedata.ini
#define KEEP_BOW_UPGRADED_DAMAGE 20
Edit:
If you only want to modify your map, with a map.ini, then you have to do following:
You can't modify Weapons with Projectiles in map.ini. So you add a Modifier to you Object, which decreases its damage.
ModifierList MyDamageBonus
Modifier = DAMAGE_MULT X% //100% change nothing. 0% is no Damage. 200% is double Damage
Duration = 0 //Always
End
Object XY
AddModule
Behavior = AttributeModifierUpgrade ModuleTag_PvDAiscool
TriggeredBy = Upgrade_Upgrade_AllFactionUpgrade //Always
AttributeModifier = MyDamageBonus
End
End
End
« Letzte Änderung: 2. Mai 2016, 18:48 von Prinz von Dol Amroth »
Ich bin der selbst ernannte Herrscher, oberster Befehlshaber und noch vieles anderes von Dol Amroth
oft in tunngle zu finden

Offline Titan

  • Thain des Auenlandes
  • *
  • Beiträge: 29
  • "Fly you fools!"
Re: Changing the damage on towers
« Antwort #2 am: 2. Mai 2016, 19:20 »
Thank you for your help!  xD

Can I create a map.ini file with just, the code you sent me in the edited version? Or do I need to include more?

Offline Prinz von Dol Amroth

  • Edain Team
  • Held von Helms Klamm
  • *****
  • Beiträge: 1.265
Re: Changing the damage on towers
« Antwort #3 am: 2. Mai 2016, 19:37 »
You only need my second Code. But you have to replace XY in "Object XY" to your Objectname and X in "X%"to an integer value. If you want to change both Objects, you have to add a second "Object XY ... End".
Ich bin der selbst ernannte Herrscher, oberster Befehlshaber und noch vieles anderes von Dol Amroth
oft in tunngle zu finden

Offline Titan

  • Thain des Auenlandes
  • *
  • Beiträge: 29
  • "Fly you fools!"
Re: Changing the damage on towers
« Antwort #4 am: 2. Mai 2016, 19:50 »
Hmm, when I tried replacing XY with 'AmonSulTower' or 'AmonSulTower2' which is the names of the objects in the world builder, I got a fatal error message when launching the game, stating that there was something wrong with the map.ini file.

So which object am I going to refer to? The 'AmonSulArrowTowerBow'?

Offline Prinz von Dol Amroth

  • Edain Team
  • Held von Helms Klamm
  • *****
  • Beiträge: 1.265
Re: Changing the damage on towers
« Antwort #5 am: 2. Mai 2016, 20:41 »
Copy your map.ini and write the error message.
Ich bin der selbst ernannte Herrscher, oberster Befehlshaber und noch vieles anderes von Dol Amroth
oft in tunngle zu finden

Offline Titan

  • Thain des Auenlandes
  • *
  • Beiträge: 29
  • "Fly you fools!"
Re: Changing the damage on towers
« Antwort #6 am: 2. Mai 2016, 20:58 »
Here is the code I used in the .ini file:
ModifierList MyDamageBonus
Modifier = DAMAGE_MULT 50% //100% change nothing. 0% is no Damage. 200% is double Damage
Duration = 0 //Always
End
Object AmonSulTower
AddModule
Behavior = AttributeModifierUpgrade ModuleTag_PvDAiscool
TriggeredBy = Upgrade_Upgrade_AllFactionUpgrade //Always
AttributeModifier = MyDamageBonus
End
End
End
ModifierList MyDamageBonus
Modifier = DAMAGE_MULT 50% //100% change nothing. 0% is no Damage. 200% is double Damage
Duration = 0 //Always
End
Object AmonSulTower2
AddModule
Behavior = AttributeModifierUpgrade ModuleTag_PvDAiscool
TriggeredBy = Upgrade_Upgrade_AllFactionUpgrade //Always
AttributeModifier = MyDamageBonus
End
End
End
This is what the error message says:

Offline Prinz von Dol Amroth

  • Edain Team
  • Held von Helms Klamm
  • *****
  • Beiträge: 1.265
Re: Changing the damage on towers
« Antwort #7 am: 2. Mai 2016, 21:52 »
You need the ModifierList only once.
And replace, Upgrade_Upgrade_AllFacti onUpgrade witch Upgrade_AllFactionUpgrad e. Sry, this was my failure.
Ich bin der selbst ernannte Herrscher, oberster Befehlshaber und noch vieles anderes von Dol Amroth
oft in tunngle zu finden

Offline Titan

  • Thain des Auenlandes
  • *
  • Beiträge: 29
  • "Fly you fools!"
Re: Changing the damage on towers
« Antwort #8 am: 2. Mai 2016, 21:59 »
Now I get another error message, almost identical:

Unknown block 'Modifier'.

Error parsing INI block 'Modifier' in file 'c:\users\****\appdata\roaming\my the lord of the rings, the rise of the witch king files\maps\tarnost\map.ini'.
7 adresses:
(unknown)(0): game.dat+239838 Debug::PostStaticInit+3390
(unknown)(0): game.dat+2334561 StringBase<char>::~StringBase<char>+250781
(unknown)(0): game.dat+11454 operator<<<char>2072
(unknown)(0): game.dat+6541831 Xfer::operator==+119943
(unknown)(0): kernell32.dll+78730 BaseThreadInitThunk+18
(unknown)(0): ntdll.dll+235778 RtInitializeExceptionCha in+99
(unknown)(0): ntdll.dll+235733 RtInitializeExceptionCha in+54

Because of this severety the game will now exit.

EDIT: The updated map.ini file I made:

Offline Prinz von Dol Amroth

  • Edain Team
  • Held von Helms Klamm
  • *****
  • Beiträge: 1.265
Re: Changing the damage on towers
« Antwort #9 am: 2. Mai 2016, 22:07 »
ModifierList MyDamageBonus
Modifier = DAMAGE_MULT 50% //100% change nothing. 0% is no Damage. 200% is double Damage
Duration = 0 //Always
End
Object AmonSulTower
AddModule
Behavior = AttributeModifierUpgrade ModuleTag_PvDAiscool
TriggeredBy = Upgrade_AllFactionUpgrade //Always
AttributeModifier = MyDamageBonus
End
End
End
Object AmonSulTower2
AddModule
Behavior = AttributeModifierUpgrade ModuleTag_PvDAiscool
TriggeredBy = Upgrade_AllFactionUpgrade //Always
AttributeModifier = MyDamageBonus
End
End
End
Ich bin der selbst ernannte Herrscher, oberster Befehlshaber und noch vieles anderes von Dol Amroth
oft in tunngle zu finden

Offline Titan

  • Thain des Auenlandes
  • *
  • Beiträge: 29
  • "Fly you fools!"
Re: Changing the damage on towers
« Antwort #10 am: 2. Mai 2016, 22:27 »
Thanks a lot for your help!  xD

It works now and the towers are dealing a more reasonable amount of damage per shot than before.