Modderecke > Coding

Upgrade für Kampfturm

<< < (2/5) > >>

Lugdusch aka RDJ:
Und davor die Commandbuttons. Sonst dürfte es auch nicht funktionieren.

RDJ

Reshef:
Funktioniert auch so nicht, da steht weiterhin: Einheit kann upgrade nicht benutzen.

Lugdusch aka RDJ:
Die Buttons werden aber immerhin richtig angezeigt, oder? Wäre schonmal ein Fortschritt. Könntest du vielleicht die aktuelle Version der map.ini noch hochladen, nur um auf dem aktuellsten Stand zu sein.
Bei der Upgradedefinition steht CONTROLBAR:IceBall, sonst sind die aber alle auf deutsch. Im Commandbutton hast du auch CONTROLBAR:Eisball stehen. Sind das zwei verschiedene Sachen, die auch zweimal definiert sind? Das hat zwar nichts mit dem Problem zu tun, ist mir aber halt aufgefallen.
Ansonsten hab ich keine Fehler gefunden. Bin grade überfragt. Das einzige, woran es liegen könnte, wäre die Reihenfolge. Kurze Frage: In den Behaviorn steht "WeaponSetUpgrade ModuleTag_Eispfeil;/Eisball". Braucht das WeaponSetUpgrade die einzelnen Weapons, weil bisher sind die drunter definiert. Wenn ja müsste die Reihenfolge so aussehen: Upgrades > Commandbuttons > Commandset > Weapons > Object.
Wenn nein, schadet die Reihenfolge trotzdem nicht und es liegt an was anderem.

RDJ

Reshef:
Du Buttons wurden erst angezeigt nachdem ich die Buttons so gemacht habe wie in diesen map.ini tutorial beschrieben (danke an mcm für den link ;) )
http://www.the3rdage.net/item-215?addview

Momentan sieht der teil so aus:

--- Code: ---Upgrade Upgrade_EispfeilTrigger
    Type            = OBJECT
    BuildCost        = 500
    BuildTime        = 5
    DisplayName    = CONTROLBAR:Eisschuss
End

Upgrade Upgrade_Eispfeil
    Type            = OBJECT
End

Upgrade Upgrade_EisballTrigger
    Type            = OBJECT
    BuildCost        = 2000
    BuildTime        = 5
    DisplayName    = CONTROLBAR:IceBall
End

Upgrade Upgrade_Eisball
    Type            = OBJECT
End


CommandButton Command_PurchaseUpgradeAngmarFortressIceMunitions
    Command           = OBJECT_UPGRADE
    Options           = CANCELABLE
    Upgrade           = Upgrade_EispfeilTrigger
    TextLabel         = CONTROLBAR:PurchaseTechnologyAngmarIceArrows
    ButtonImage       = KUTIceArrowUpgradeIcon
    ButtonBorderType  = UPGRADE
    DescriptLabel     = CONTROLBAR:ToolTipPurchaseTowerUpgradeAngmarIceArrows
    Radial            = Yes
    InPalantir        = Yes
End

CommandButton Command_PurchaseUpgradeAngmarFortressSanctum
    Command              = OBJECT_UPGRADE
    Options              = NEED_UPGRADE  CANCELABLE
    Upgrade              = Upgrade_EisballTrigger
    NeededUpgrade        = Upgrade_Eispfeil
    TextLabel            = CONTROLBAR:Eisball
    ButtonImage          = KUAngBannerCarrierUpgradeIcon
    ButtonBorderType     = UPGRADE
    DescriptLabel        = CONTROLBAR:ToolTipPurchaseUpgradeDwarvenTraining
    Radial               = Yes
    InPalantir           = Yes
    LacksPrerequisiteLabel = TOOLTIP:LackAngmarBasicTraining
End

Weapon AngmarEisball
  ProjectileCollidesWith = ENEMIES
  RadiusDamageAffects = ENEMIES NOT_SIMILAR

  DamageNugget                       
    Damage        = 600
    Radius        = 100.0    ; HitStoredTarget means we hurt the person we launched at.  And nobody else.  So a miss hurts nobody.
    DelayTime     = 0
    DamageType    = FROST
    DamageFXType  = EVIL_ARROW_PIERCE
    DeathType     = BURNED
    AcceptDamageAdd = No
    DamageScalar  = 25% NONE +STRUCTURE
     DamageScalar  = 0% NONE +MINE // Make sure we one shot kill mines, without risking wasting some poor hero with a torch
  End
End

Weapon AngmarEispfeil
  ProjectileCollidesWith = ENEMIES
  RadiusDamageAffects = ENEMIES NOT_SIMILAR

  DamageNugget                       
    Damage        = 200
    Radius        = 5.0    ; HitStoredTarget means we hurt the person we launched at.  And nobody else.  So a miss hurts nobody.
    DelayTime     = 0
    DamageType    = FROST
    DamageFXType  = EVIL_ARROW_PIERCE
    DeathType     = BURNED
    AcceptDamageAdd = No
    DamageScalar  = 25% NONE +STRUCTURE
     DamageScalar  = 0% NONE +MINE // Make sure we one shot kill mines, without risking wasting some poor hero with a torch
  End

  DamageNugget                       
    Damage        = 100       
    Radius        = 0.0    ; HitStoredTarget means we hurt the person we launched at.  And nobody else.  So a miss hurts nobody.
    DelayTime     = 0
    DamageType    = PIERCE
    DamageFXType  = EVIL_ARROW_PIERCE
    DeathType     = NORMAL
  End
End

Weapon AngmarPfeil
  ProjectileCollidesWith = ENEMIES
  RadiusDamageAffects = ENEMIES NOT_SIMILAR
  HitStoredTarget = Yes    ; Always hits initial target.
  DamageNugget                        ; A basic Nugget that just does damage
    Damage        = 100
    Radius        = 0.0    ; HitStoredTarget means we hurt the person we launched at.  And nobody else.  So a miss hurts nobody.
    DelayTime     = 0
    DamageType    = PIERCE
    DamageFXType  = EVIL_ARROW_PIERCE
    DeathType     = NORMAL
  End
End

Object AngmarSentryTower
CommandSet = Angmarkampfturm
AddModule
    Behavior = WeaponSetUpgrade ModuleTag_Eispfeil
        TriggeredBy = Upgrade_Eispfeil
    End
End
AddModule
    Behavior = WeaponSetUpgrade ModuleTag_Eisball
        TriggeredBy = Upgrade_Eisball
    End
End
End

Weapon Angmarkampfturm      ; BALANCE Archer Weapon
  AttackRange               = GONDOR_STRUCTURE_ARCHER_RANGE
  WeaponSpeed               = 321       ; dist/sec
  MinWeaponSpeed            = 241
  MaxWeaponSpeed            = 481        ; dist/sec Upper limit on scaling, when attacking past nominal "max" range
  FireFX                    = FX_RohanArcherBowWeapon
  ScaleWeaponSpeed          = Yes        ; Used for lob weapons, scales speed proportional to range
  HitPercentage             = 100        ;When this weapon is used it will hit exactly 50% of the time.
  ScatterRadius             = 16.0        ;When this weapon misses it can randomly miss by as much as this distance.
  DelayBetweenShots         = Min:GONDOR_STRUCTURE_ARCHER_BOW_DELAYBETWEENSHOTS_MIN Max:GONDOR_STRUCTURE_ARCHER_BOW_DELAYBETWEENSHOTS_MAX
  PreAttackDelay            = GONDOR_STRUCTURE_ARCHER_BOW_PREATTACKDELAY   ; 1467 is the prep time for archer.
  PreAttackType             = PER_SHOT    ; Do the delay each time we attack a new target
  FiringDuration            = GONDOR_STRUCTURE_ARCHER_BOW_DELAYBETWEENSHOTS_MAX    ; Duration of the archer firing shot is 500ms.
  IsAimingWeapon            = Yes
  AntiAirborneVehicle        = Yes
  AntiAirborneMonster        = Yes
  HitPassengerPercentage    = 20%
  AcceptableAimDelta        = 360.0    ; We want to be able to shoot all round, as we canit move.

  CanBeDodged                = Yes ; Will check for a DodgePercent on the target to have a second chance at failing HitPercent


  ProjectileNugget          ; Default arrow
    ProjectileTemplateName  = EvilFactionArrow
    WarheadTemplateName     = AngmarPfeil
    ForbiddenUpgradeNames   = Upgrade_Eispfeil
  End

  ProjectileNugget          ; Upgraded arrow
    ProjectileTemplateName  = EvilFactionIceArrow
    WarheadTemplateName     = AngmarEispfeil
    RequiredUpgradeNames    = Upgrade_Eispfeil
  End

  ProjectileNugget          ; Upgraded arrow
    ProjectileTemplateName  = AngmarSanctumProjectile
    WarheadTemplateName     = AngmarEisball
    RequiredUpgradeNames    = Upgrade_Eisball
  End
End

Weapon AngmarEisball
  ProjectileCollidesWith = ENEMIES
  RadiusDamageAffects = ENEMIES NOT_SIMILAR

  DamageNugget                       
    Damage        = 600
    Radius        = 100.0    ; HitStoredTarget means we hurt the person we launched at.  And nobody else.  So a miss hurts nobody.
    DelayTime     = 0
    DamageType    = FROST
    DamageFXType  = EVIL_ARROW_PIERCE
    DeathType     = BURNED
    AcceptDamageAdd = No
    DamageScalar  = 25% NONE +STRUCTURE
     DamageScalar  = 0% NONE +MINE // Make sure we one shot kill mines, without risking wasting some poor hero with a torch
  End
End

Weapon AngmarEispfeil
  ProjectileCollidesWith = ENEMIES
  RadiusDamageAffects = ENEMIES NOT_SIMILAR

  DamageNugget                       
    Damage        = 200
    Radius        = 5.0    ; HitStoredTarget means we hurt the person we launched at.  And nobody else.  So a miss hurts nobody.
    DelayTime     = 0
    DamageType    = FROST
    DamageFXType  = EVIL_ARROW_PIERCE
    DeathType     = BURNED
    AcceptDamageAdd = No
    DamageScalar  = 25% NONE +STRUCTURE
     DamageScalar  = 0% NONE +MINE // Make sure we one shot kill mines, without risking wasting some poor hero with a torch
  End

  DamageNugget                       
    Damage        = 100       
    Radius        = 0.0    ; HitStoredTarget means we hurt the person we launched at.  And nobody else.  So a miss hurts nobody.
    DelayTime     = 0
    DamageType    = PIERCE
    DamageFXType  = EVIL_ARROW_PIERCE
    DeathType     = NORMAL
  End
End

Weapon AngmarPfeil
  ProjectileCollidesWith = ENEMIES
  RadiusDamageAffects = ENEMIES NOT_SIMILAR
  HitStoredTarget = Yes    ; Always hits initial target.
  DamageNugget                        ; A basic Nugget that just does damage
    Damage        = 100
    Radius        = 0.0    ; HitStoredTarget means we hurt the person we launched at.  And nobody else.  So a miss hurts nobody.
    DelayTime     = 0
    DamageType    = PIERCE
    DamageFXType  = EVIL_ARROW_PIERCE
    DeathType     = NORMAL
  End
End

CommandSet Angmarkampfturm
1 = Command_PurchaseUpgradeAngmarFortressIceMunitions
2 = Command_PurchaseUpgradeAngmarFortressSanctum
    6 = Command_Sell
End
--- Ende Code ---

Reshef:
So, hab das ganze nun auf big umgestellt:
Ergebnis ich kann hoffentlih mehr machen und buttons sind sichtbar.
Allerings kann man immer noch nicht die Upgrades kaufen.
Hier die Codes:

map.ini:

--- Code: ---Object AngmarSentryTower
CommandSet = AngmarTurmTWCommandSet
  WeaponSet
    Conditions            = None
    Weapon                = PRIMARY AngmarTurmTW 
    AutoChooseSources    = PRIMARY FROM_PLAYER FROM_SCRIPT FROM_AI
  End
AddModule
    Behavior = HordeGarrisonContain ModuleTag_Weg
         ObjectStatusOfContained            = UNSELECTABLE ENCLOSED CAN_ATTACK
         ContainMax                      = 0
         DamagePercentToUnits            = 0%
         PassengerFilter                    = GENERIC_FACTION_GARRISONABLE
        AllowEnemiesInside                = No
        AllowAlliesInside                = No
        AllowNeutralInside                = No
        AllowOwnPlayerInsideOverride    = Yes
         NumberOfExitPaths               = 1        ; Defaults to 1.  Set 0 to not use ExitStart/ExitEnd, set higher than 1 to use ExitStart01-nn/ExitEnd01-nn
         PassengerBonePrefix             = PassengerBone:ARROW_ KindOf:INFANTRY
         EntryPosition                    = X:0.0 Y:0.0 Z:0.0
        EntryOffset                        = X:75.0 Y:-25.0 Z:0.0
        ExitOffset                        = X:75.0 Y:-25.0 Z:0.0
        EnterSound                        = RuinedTowerEnterSound
        KillPassengersOnDeath            = No
        ShowPips                        = No
    End
End
End
--- Ende Code ---

commandset.ini

--- Code: ---CommandSet AngmarTurmTWCommandSet
    InitialVisible = 2
    //Main Menu
    1    = Command_AngmarMoreRadiusTW   
    2    = Command_AngmarFasterShootingTW

    //Radius
    3    = Command_PurchaseUpgradeEispfeilTW
    4    = Command_PurchaseUpgradeEisgeschosseTW
    5    = Command_PurchaseUpgradeEisballTW
    6    = Command_RadialBack

    //Schneller
;    7    = Command_PurchaseUpgradeEisspeed1TW
;    8    = Command_PurchaseUpgradeEisspeed2TW
;    9    = Command_RadialBack
             
End
--- Ende Code ---

commandbutton

--- Code: ---CommandButton Command_AngmarMoreRadiusTW
Command = PUSH_VISIBLE_COMMAND_RANGE
TextLabel = Angmarmenu1
ButtonImage = KUBattleTowerIcon
ButtonBorderType = SYSTEM
DescriptLabel = Angmarmenu1desc
Radial = Yes
CommandRangeStart = 2
CommandRangeCount = 4
End

CommandButton Command_AngmarFasterShootingTW
Command = PUSH_VISIBLE_COMMAND_RANGE
TextLabel = Angmarmenu2
ButtonImage = KUBattleTowerIcon
ButtonBorderType = SYSTEM
DescriptLabel = Angmarmenu2desc
Radial = Yes
CommandRangeStart = 6
CommandRangeCount = 3
End

CommandButton Command_PurchaseUpgradeEispfeilTW
   Command           = OBJECT_UPGRADE
   Upgrade           = Upgrade_EispfeilTW
   Options           = CANCELABLE
   TextLabel         = Eispfeil
   ButtonImage       = KUTIceArrowUpgradeIcon
   ButtonBorderType  = UPGRADE
   DescriptLabel     = Eispfeildesc
   Radial            = Yes
   InPalantir        = No
End

CommandButton Command_PurchaseUpgradeEisgeschosseTW
    Command           = OBJECT_UPGRADE
    Options              = NEED_UPGRADE CANCELABLE
    Upgrade           = Upgrade_EisgeschossTW
    NeededUpgrade      = UpgradeEispfeilTW
    TextLabel         = Eisschuss
    ButtonImage       = KUIceShotIcon
    ButtonBorderType  = UPGRADE
    DescriptLabel     = Eisschussdesc
    Radial            = Yes
    InPalantir             = No
    LacksPrerequisiteLabel        = Eisschussvor
End

CommandButton Command_PurchaseUpgradeEisballTW
    Command           = OBJECT_UPGRADE
    Options              = NEED_UPGRADE CANCELABLE
    Upgrade           = Upgrade_EisballTW
    NeededUpgrade      = UpgradeEisgeschossTW
    TextLabel         = Eisball
    ButtonImage       = KUWinterWrathIcon
    ButtonBorderType  = UPGRADE
    DescriptLabel     = Eisballdesc
    Radial            = Yes
    InPalantir             = No
    LacksPrerequisiteLabel        = Eisballvor
End
--- Ende Code ---

upgrade.ini

--- Code: ---Upgrade Upgrade_EispfeilTW
    DisplayName = UPGRADE:Abgeschlossen
    Type            = OBJECT
    BuildCost        = 200
    BuildTime        = 5
End

Upgrade Upgrade_EisgeschossTW
    DisplayName = UPGRADE:Abgeschlossen
    Type            = OBJECT
    BuildCost        = 1000
    BuildTime        = 5
End

Upgrade Upgrade_EisballTW
    DisplayName = UPGRADE:Abgeschlossen
    Type            = OBJECT
    BuildCost        = 2500
    BuildTime        = 5
End

--- Ende Code ---

weapon.ini

--- Code: ---Weapon TWAngmarEispfeilWarhead
  ProjectileCollidesWith = ENEMIES
  RadiusDamageAffects = ENEMIES NOT_SIMILAR
  HitStoredTarget = Yes    ; Always hits initial target.
  DamageNugget                       
    Damage        = 200
    Radius        = 5.0    ; HitStoredTarget means we hurt the person we launched at.  And nobody else.  So a miss hurts nobody.
    DelayTime     = 0
    DamageType    = FROST
    DamageFXType  = EVIL_ARROW_PIERCE
    DeathType     = BURNED
    AcceptDamageAdd = No
    DamageScalar  = 25% NONE +STRUCTURE
     DamageScalar  = 0% NONE +MINE // Make sure we one shot kill mines, without risking wasting some poor hero with a torch
  End

  DamageNugget                       
    Damage        = 200       
    Radius        = 5.0    ; HitStoredTarget means we hurt the person we launched at.  And nobody else.  So a miss hurts nobody.
    DelayTime     = 0
    DamageType    = PIERCE
     DamageFXType  = EVIL_ARROW_PIERCE
    DeathType     = NORMAL
  End
End

Weapon TWAngmarEisgeschossWarhead
  ProjectileCollidesWith = ENEMIES
  RadiusDamageAffects = ENEMIES NOT_SIMILAR
  HitStoredTarget = Yes    ; Always hits initial target.
  DamageNugget                       
    Damage        = 200
    Radius        = 30.0    ; HitStoredTarget means we hurt the person we launched at.  And nobody else.  So a miss hurts nobody.
    DelayTime     = 0
    DamageType    = FROST
    DamageFXType  = EVIL_ARROW_PIERCE
    DeathType     = BURNED
    AcceptDamageAdd = No
    DamageScalar  = 25% NONE +STRUCTURE
     DamageScalar  = 0% NONE +MINE // Make sure we one shot kill mines, without risking wasting some poor hero with a torch
  End

  DamageNugget                       
    Damage        = 200       
    Radius        = 30.0    ; HitStoredTarget means we hurt the person we launched at.  And nobody else.  So a miss hurts nobody.
    DelayTime     = 0
    DamageType    = PIERCE
     DamageFXType  = EVIL_ARROW_PIERCE
    DeathType     = NORMAL
  End
End

Weapon TWAngmarEisballWarhead
  ProjectileCollidesWith = ENEMIES
  RadiusDamageAffects = ENEMIES NOT_SIMILAR
  HitStoredTarget = Yes    ; Always hits initial target.
  DamageNugget                       
    Damage        = 200
    Radius        = 100.0    ; HitStoredTarget means we hurt the person we launched at.  And nobody else.  So a miss hurts nobody.
    DelayTime     = 0
    DamageType    = FROST
    DamageFXType  = EVIL_ARROW_PIERCE
    DeathType     = BURNED
    AcceptDamageAdd = No
    DamageScalar  = 25% NONE +STRUCTURE
     DamageScalar  = 0% NONE +MINE // Make sure we one shot kill mines, without risking wasting some poor hero with a torch
  End

  DamageNugget                       
    Damage        = 200       
    Radius        = 100.0    ; HitStoredTarget means we hurt the person we launched at.  And nobody else.  So a miss hurts nobody.
    DelayTime     = 0
    DamageType    = PIERCE
     DamageFXType  = EVIL_ARROW_PIERCE
    DeathType     = NORMAL
  End
End
Weapon AngmarTurmTW       ; BALANCE Archer Weapon
  AttackRange               = GONDOR_STRUCTURE_ARCHER_RANGE
  WeaponSpeed               = 321       ; dist/sec
  MinWeaponSpeed            = 241
  MaxWeaponSpeed            = 481        ; dist/sec Upper limit on scaling, when attacking past nominal "max" range
  FireFX                    = FX_RohanArcherBowWeapon
  ScaleWeaponSpeed          = Yes        ; Used for lob weapons, scales speed proportional to range
  HitPercentage             = 100        ;When this weapon is used it will hit exactly 50% of the time.
  ScatterRadius             = 16.0        ;When this weapon misses it can randomly miss by as much as this distance.
  DelayBetweenShots         = Min:GONDOR_STRUCTURE_ARCHER_BOW_DELAYBETWEENSHOTS_MIN Max:GONDOR_STRUCTURE_ARCHER_BOW_DELAYBETWEENSHOTS_MAX
  PreAttackDelay            = GONDOR_STRUCTURE_ARCHER_BOW_PREATTACKDELAY   ; 1467 is the prep time for archer.
  PreAttackType             = PER_SHOT    ; Do the delay each time we attack a new target
  FiringDuration            = GONDOR_STRUCTURE_ARCHER_BOW_DELAYBETWEENSHOTS_MAX    ; Duration of the archer firing shot is 500ms.
  IsAimingWeapon            = Yes
  AntiAirborneVehicle        = Yes
  AntiAirborneMonster        = Yes
  HitPassengerPercentage    = 20%
  AcceptableAimDelta        = 360.0    ; We want to be able to shoot all round, as we canit move.

  CanBeDodged                = Yes ; Will check for a DodgePercent on the target to have a second chance at failing HitPercent


  ProjectileNugget          ; Default arrow
    ProjectileTemplateName  = EvilFactionArrow
    WarheadTemplateName     = AngmarArcherBowWarhead
    ForbiddenUpgradeNames   = Upgrade_EispfeilTW Upgrade_EisgeschossTW Upgrade_EisballTW
  End

  ProjectileNugget          ; Upgraded arrow
    ProjectileTemplateName  = EvilFactionIceArrow
    WarheadTemplateName     = TWAngmarEispfeilWarhead
    ForbiddenUpgradeNames   = Upgrade_EisgeschossTW Upgrade_EisballTW
    RequiredUpgradeNames    = Upgrade_EispfeilTW
  End

  ProjectileNugget          ; Upgraded arrow
    ProjectileTemplateName  = AngmarStoneThrowerIceProjectile
    WarheadTemplateName     = TWAngmarEisgeschossWarhead
    ForbiddenUpgradeNames   = Upgrade_EisballTW
    RequiredUpgradeNames    = Upgrade_EisgeschossTW
  End

  ProjectileNugget          ; Upgraded arrow
    ProjectileTemplateName  = AngmarSanctumProjectile
    WarheadTemplateName     = TWAngmarEisballWarhead
    RequiredUpgradeNames    = Upgrade_EisballTW
  End
End
--- Ende Code ---

Eingefügter teil beim Angmar turm:

--- Code: ---    Behavior = WeaponSetUpgrade ModuleTag_ForgedBlades1
        TriggeredBy = Upgrade_EispfeilTW
    End
   
    Behavior = WeaponSetUpgrade ModuleTag_ForgedBlades2
        TriggeredBy = Upgrade_EisgeschossTW
    End

    Behavior = WeaponSetUpgrade ModuleTag_ForgedBlades3
        TriggeredBy = Upgrade_EisballTW
    End
--- Ende Code ---
gelöscht wurden keine teile.

Navigation

[0] Themen-Index

[#] Nächste Seite

[*] Vorherige Sete

Zur normalen Ansicht wechseln