28. Apr 2024, 09:51 Hallo Gast.
Willkommen Gast. Bitte einloggen oder registrieren. Haben Sie Ihre Aktivierungs E-Mail übersehen?

Einloggen mit Benutzername, Passwort und Sitzungslänge. Hierbei werden gemäß Datenschutzerklärung Benutzername und Passwort verschlüsselt für die gewählte Dauer in einem Cookie abgelegt.


Select Boards:
 
Language:
 


Autor Thema: Durins, VdZ Coding-Fragen  (Gelesen 7455 mal)

Durin, Vater der Zwerge

  • Heiler von Imladris
  • **
  • Beiträge: 241
Durins, VdZ Coding-Fragen
« am: 18. Dez 2010, 10:18 »
Hallo erstmal!

Habe einfach ein paar Anfänger-Fragen zu denen ich mithilfe der Sufu nichts gefunden habe.

1:Was bedeutet der Eintrag nach "Enum", also zum Beispiel:
 
SpecialPower SpellBookCalltheHorde
    Enum            = SPECIAL_SPELL_BOOK_CALL_THE_HORDE
    RequiredSciences        = SCIENCE_CalltheHorde
    ReloadTime        = SPELL_RECHARGE_TIME_TIER_2   ; in milliseconds
    InitiateSound        = SpellCallTheHordeStereo
    Flags            = RESPECT_RECHARGE_TIME_DISCOUNT
End

2:Wie erstelle ich einen Spell, der die Roshsoffprodunktion aller Gehöfte kurzzeitig um, sagen wir mal 20% erhöht?
Ich wollte eigentlich versuchen den "Call the Horde" und den "Dwarfen Riches" Spell zu vermischen, aber ich habe zu diesen Spells die Passagen in denen die Auswirkungen auftauchen nicht gefunden.

MfG
Durin, VdZ

Sanalf 2

  • Gast
Re:Durins, VdZ Coding-Fragen
« Antwort #1 am: 18. Dez 2010, 11:32 »
Hallo, Durin!

1) Der Eintrag nach ENUM spezifiziert noch einmal den genauen Typ eines Spells oder einer Fähigkeit. Er stellt sozusagen das Basisgerüst für einen Spell dar, wenn du also z.B. eine Fähigkeit erstellen möchtest, die globale Auswirkungen hat, solltest du auch ein ENUM einer Fähigkeit verwenden, die global wirkt. Genaueres weiß ich jetzt auch nicht. Aber du kannst jedenfalls KEINE neuen Enums erstellen, die sind fix!

2) Schau mal in die system.ini im Ordner "data\ini\object\system" und such dort nach einem der beiden Spells. Hier hast du deren Auswirkungen stehen.

mfg
sanalf 2

Elrond99

  • Galadhrim
  • **
  • Beiträge: 738
Re:Durins, VdZ Coding-Fragen
« Antwort #2 am: 18. Dez 2010, 13:27 »
Du nimmst den CallTheHorde Spell wobei er statt auf Orkgruben halt auf Rohstoffgebäude wirkt und einen anderen Attributemodifier verleiht

Aber ich weiß nicht ob alle Einträge von CallTheHorde in Sum2 sind, müsstest halt notfalls aus SuM1 kopieren

Durin, Vater der Zwerge

  • Heiler von Imladris
  • **
  • Beiträge: 241
Re:Durins, VdZ Coding-Fragen
« Antwort #3 am: 8. Jan 2011, 13:00 »
Danke erstmal für die Antworten!
Desweiteren wollte ich ein nach diesem Tutorial ein neues Volk erstellen.
http://www.the3rdage.net/item-144?cpage=0#comments
Ich hab alles so gemacht wie gesagt, allerdings kommt bei mir die folgende Fehlermeldung

http://www.imagebanana.com/view/b3zp04jw/Unbenannt.jpg

Der ChildObject Block sieht so aus
ChildObject MenPorterNoSelect MenPorter
    KindOf = PRELOAD CAN_CAST_REFLECTIONS INFANTRY PATH_THROUGH_EACH_OTHER DOZER SWARM_DOZER NOT_AUTOACQUIRABLE MOVE_FOR_NOONE
    ShockwaveResistance = SHOCKWAVE_RESISTANCE_IMMUNE
End


Sanalf 2

  • Gast
Re:Durins, VdZ Coding-Fragen
« Antwort #4 am: 8. Jan 2011, 13:05 »
Naja, die Fehlermeldung sagt, dass du das ChildObject falsch platziert hast. Is das auch wirklich in der ini vom Porter drin? Hast du es nach dem letzten "END" der Porter-Codes eingefügt? Da würd ich das Problem suchen.

mfg
sanalf 2

Durin, Vater der Zwerge

  • Heiler von Imladris
  • **
  • Beiträge: 241
Re:Durins, VdZ Coding-Fragen
« Antwort #5 am: 8. Jan 2011, 13:10 »
Am ´End´ liegts jedenfalls nicht. Hier sind noch einmal die gesamten Codes des Porters

;------------------------------------------------------------------------------
;
;    Men Porter.ini
;
;------------------------------------------------------------------------------

; aka Porter
Object FendlandPorter
    ; *** ART Parameters ***
    SelectPortrait = UPGondor_Porter
   
    ; ButtonImage for Porter
    ButtonImage = BGFortress_Porter
   
    Draw = W3DTruckDraw ModuleTag_01
     
        OkToChangeModelColor = Yes
     
        ;StaticModelLODMode = yes ; Will append M or L to the skin name depending on GameLOD
   
        DefaultModelConditionState
            Model                    = GUPorter_SKN
            Skeleton                = GUPorter_SKL
        End

        IdleAnimationState
            StateName                = STATE_Running
            Animation                = IDLA
                AnimationName        = GUPorter_IDLA
                AnimationMode        = ONCE
                AnimationPriority   = 20
            End
            Animation                = IDLB ; fidget. Search animation
                AnimationName        = GUPorter_IDLB
                AnimationMode        = ONCE
                AnimationPriority   = 1
            End
        End

        AnimationState                = DYING DEATH_1
            Animation                = DIEB
                AnimationName        = GUPorter_DIEA
                AnimationMode        = ONCE
            End
        End
   
        AnimationState          = DYING DEATH_2
            Animation
                AnimationName   = GUPorter_IDLA
                AnimationMode   = LOOP
            End
        End

        AnimationState                = DYING
            Animation                = DIEA
                AnimationName        = GUPorter_DIEA
                AnimationMode        = ONCE
            End
        End

        AnimationState                        = PARALYZED
            Animation
                AnimationName                = GUPorter_IDLA
                AnimationMode                = LOOP
            End
        End


        AnimationState                = MOVING WANDER
            StateName                = STATE_Running
            Animation                = WLKA
                AnimationName        = GUPorter_WLKA
                AnimationMode        = LOOP
            End
            Flags                    = RANDOMSTART
            ;ParticleSysBone            = None InfantryDustTrails
        End
   
        AnimationState                = MOVING
            StateName                = STATE_Running
            Animation                = RUNNING
                AnimationName        = GUPorter_RUNA
                AnimationMode        = LOOP
;                AnimationSpeedFactorRange = 3.8 3.8
            End
            Flags                    = RANDOMSTART
            ;ParticleSysBone            = None InfantryDustTrails
        End

        AnimationState        = UNPACKING PACKING_TYPE_1
            Animation
                AnimationName        = GUPorter_FIRA
                AnimationMode        = ONCE
            End
            BeginScript
                CurDrawablePlaySound("MenBuilderFireExtinguish")
            EndScript
            ParticleSysBone = BUCKET PorterFireWater FollowBone:YES
        End

        AnimationState        = ACTIVELY_CONSTRUCTING
            StateName           = STATE_Constructing
            Animation           = WRKA
                AnimationName     = GUPorter_WRKB
                AnimationMode     = ONCE
                AnimationPriority    =    30
                AnimationSpeedFactorRange = 0.9 1.1
            End
            Animation           = WRKA                        ; In twice so that we can play it twice in a row.
                AnimationName     = GUPorter_WRKB
                AnimationMode     = ONCE
                AnimationPriority    =    30
                AnimationSpeedFactorRange = 0.9 1.1
            End
            Animation           = WRKB
                AnimationName     = GUPorter_WRKC
                AnimationMode     = ONCE
                AnimationPriority    =    5
                AnimationSpeedFactorRange = 0.9 1.1
            End
            Animation           = WRKB
                AnimationName     = GUPorter_WRKC
                AnimationMode     = ONCE
                AnimationPriority    =    5
                AnimationSpeedFactorRange = 0.9 1.1
            End
            Flags                    =    RESTART_ANIM_WHEN_COMPLETE
            BeginScript
                Prev = CurDrawablePrevAnimationState()
                if Prev == "STATE_Running" then CurDrawableSetTransitionAnimState("TRANS_RunToWork") end
            EndScript
        End

;;--------------- TRANSITIONS ---------------------------------------------------------------------------

        TransitionState       = TRANS_RunToWork
            Animation           = ATNA
                AnimationName     = GUPorter_WRKA
                AnimationMode     = ONCE
            End
        End

;;-----------------------------------------------------------------------------------------------------------

        LeftFrontTireBone            = WHEEL_L01
        RightFrontTireBone            = WHEEL_R01
        ;LeftRearTireBone            = WHEEL_L01
        ;RightRearTireBone            = WHEEL_R01
        TireRotationMultiplier        = 0.2
    End

    #include "..\..\..\includes\StunDrawModuleMedium.inc"

    ; ***DESIGN parameters ***
    Side                    = Men
    EditorSorting            = UNIT
    ThingClass                = HORDE_UNIT
    CommandPoints            = 0
    TransportSlotCount        = TRANSPORTSLOTCOUNT_DOZER
   
    ArmorSet
        Conditions                    = None
        Armor                        = PorterArmor
        DamageFX                    = NormalDamageFX
    End
   
    BuildCost            = MEN_PORTER_BUILDCOST
    BuildTime            = MEN_PORTER_BUILDTIME     
    VisionRange            = MEN_PORTER_VISION_RANGE
    BountyValue            = MEN_PORTER_BOUNTY_VALUE
    ShroudClearingRange         = MEN_PORTER_SHROUD_RANGE
   
    DisplayName            = OBJECT:GondorPorter
    CrushableLevel        = 1  ;What am I?:        0 = for infantry, 1 = for trees, 2 = general vehicles
    ShockwaveResistance = SHOCKWAVE_RESISTANCE_IMMUNE
    IsTrainable            = No

    CommandSet = FendlandPorterCommandSet

    ; *** AUDIO Parameters ***;

    VoiceCreated                = MenBuilderVoiceSalute
    VoiceFullyCreated             = MenBuilderVoiceSalute
    VoiceMove                    = MenBuilderVoiceMove
    VoiceMoveToCamp                = MenBuilderVoiceMove
    VoicePriority                = 6
    VoiceRetreatToCastle        = MenBuilderVoiceMove
    VoiceSelect                    = MenBuilderVoiceSelectMS

    SoundImpact                    = ImpactHorse
    SoundMoveLoop                = MenBuilderMoveLoopMS
    SoundMoveStart                = MenBuilderMoveStart

    UnitSpecificSounds
        VoiceNoBuild                        = EVA:PorterCantBuild
        VoiceBuildResponse                    = MenBuilderVoiceBuild
        VoiceExtinguishFireAtLocation        = MenBuilderVoiceMove
        VoiceGarrison                        = MenBuilderVoiceGarrison
        VoiceSelectIdleWorker                = MenBuilderVoiceSelectMS
        VoiceEnterUnitElvenTransportShip    = MenBuilderVoiceMove
        VoiceInitiateCaptureBuilding        = MenBuilderVoiceMove
    End

    ClientBehavior = ModelConditionAudioLoopClientBehavior ModuleTag_foo
        ModelCondition = Required:EMOTION_CELEBRATING    Excluded:DYING ENGAGED    Sound:EmotionMenGoodCompilationVoxCheerSinglesLoop    ;MOVING ATTACKING
        ModelCondition = Required:EMOTION_TAUNTING        Excluded:DYING ENGAGED    Sound:EmotionMenGoodCompilationBFME1and2VoxTauntSinglesLoop    ;MOVING ATTACKING
    End

    #include "..\..\..\Includes\StandardUnitEvaEvents.inc"
    EvaEventDamagedOwner = PorterUnderAttack     ;Eva event to trigger when unit is damaged
    ; Moved to FX_PorterDie so that we avoid annoucing FADED deaths
    ;EvaEventDieOwner = PorterDie            ;Eva event to trigger on unit's death. NOTICE THAT this is only for permanent deaths


    ; *** ENGINEERING Parameters ***
    RadarPriority = UNIT
    KindOf = PRELOAD SELECTABLE DOZER CAN_CAST_REFLECTIONS INFANTRY PATH_THROUGH_EACH_OTHER SCORE THROWN_OBJECT PORTER IGNORES_SELECT_ALL NONCOM
    //SelectionPriority = SELECTION_PRIORITY_PORTER
   
    Body = ActiveBody ModuleTag_02
        MaxHealth         = MEN_PORTER_HEALTH
        MaxHealthDamaged  = MEN_PORTER_HEALTH_DAMAGED
        RecoveryTime      = MEN_PORTER_HEALTH_RECOVERY_TIME
    End
 
     Behavior = DozerAIUpdate ModuleTag_03
        AILuaEventsList                    = InfantryFunctions
         RepairHealthPercentPerSecond    = 2%    ; % of max health to repair each second
         BoredTime                        = 5000  ; in milliseconds
         BoredRange                        = 150   ; when bored, we look this far away to do something
         AutoAcquireEnemiesWhenIdle        = No    ; no mine-disarming in the design at the moment
        SpecialContactPoints            = Repair
     End
   
    LocomotorSet
        Locomotor = PorterLocomotor
        Condition = SET_NORMAL
        Speed     = NORMAL_INGAME_PORTER_SPEED           
    End

    LocomotorSet
        Locomotor = PorterLocomotor
        Condition = SET_WANDER
        Speed     = NORMAL_INGAME_PORTER_SPEED   
    End

    Behavior = PhysicsBehavior ModuleTag_04
        GravityMult = 1.0
    End
   
    Behavior = SlowDeathBehavior SlowDeathBehaviorModuleTag_1
        DeathTypes            = ALL -CRUSHED -EXPLODED -KNOCKBACK -DETONATED -SPLATTED -FADED -SLAUGHTERED
        SinkDelay            = 3000
        SinkRate            = 1.40     ; in Dist/Sec
        DestructionDelay    = 13000
        Sound                = INITIAL MenBuilderVoiceDie            ;PorterGenericVoiceDie
        FX                    = INITIAL FX_PorterDie
    End

    Behavior = SlowDeathBehavior SlowDeathBehaviorModuleTag_2
        DeathTypes            = NONE +CRUSHED +EXPLODED +KNOCKBACK +DETONATED +SPLATTED
        SinkDelay            = 3000
        SinkRate            = 1.40     ; in Dist/Sec
        DestructionDelay    = 13000
        DeathFlags            = DEATH_1
        FX                    = INITIAL FX_PorterDieExplosion
        Sound                = INITIAL MenBuilderVoiceDie            ;PorterGenericVoiceDie
    End
   
    Behavior = SlowDeathBehavior ModuleTag_ConstructionDeath
        DeathTypes            = NONE +FADED
        DeathFlags            = DEATH_2
        FadeDelay            = 500
        FadeTime            = 3500
        DestructionDelay    = 4000
    End

    ; Send porter back into fortress, don't announce or scream
    Behavior = SlowDeathBehavior SlowDeathBehaviorModuleTag_Decommissioned
        DeathTypes = NONE +SLAUGHTERED   
        SinkDelay = 1000
        SinkRate = 1.40     ; in Dist/Sec
        DestructionDelay = 5000
    End

    Behavior = SquishCollide ModuleTag_06
        ;nothing
    End
   
    Behavior = BezierProjectileBehavior ModuleTag_08 ; Module starts asleep, and wakes up when thrown.
        ;
        FirstHeight                    = 24  ; Height of Bezier control points above highest intervening terrain
        SecondHeight                = 24
        FirstPercentIndent            = 30% ; Percentage of shot distance control points are placed
        SecondPercentIndent            = 70%
        TumbleRandomly                = Yes

        CrushStyle                    = Yes ; I don't detonate, I just hit
        DieOnImpact                    = Yes
        BounceCount                    = 1   ; When I hit the ground, I'll arc again
        BounceDistance                = 40 ; this far
        BounceFirstHeight            = 16  ; Height of Bezier control points above highest intervening terrain
        BounceSecondHeight            = 16
        BounceFirstPercentIndent    = 20% ; Percentage of shot distance control points are placed
        BounceSecondPercentIndent    = 80%

        GroundHitFX                    = FX_ThrownRockGroundHit
        GroundBounceFX                = FX_ThrownRockBounceHit
    End   

    ;--------------------------------------------------------------------
    ; Emotion Tracker for the Terror state
    ;--------------------------------------------------------------------
    Behavior = EmotionTrackerUpdate    Module_EmotionTracker
        AfraidOf                    =    NONE +RohanTreeBerd +RohanEntFir +RohanEntAsh +RohanEntBirch +MordorBalrog +MordorCaveTroll +MordorMountainTroll +MordorDrummerTroll +MordorFellBeast +MordorMumakil;Must be SCARY kindof as well.
        AlwaysAfraidOf                =    NONE +MordorWitchKing +MordorWitchKingOnFellBeast +MordorBalrog +RohanOathbreaker

        FearScanDistance            =    250

        AddEmotion                    =    BraceForBeingCrushed_Base
        AddEmotion                    =    Terror_Base
    End       

    #include "..\..\..\Includes\PorterExtinguishFire.inc"

    ;--------------------------------------------------------------------
    ; Don't make it any bigger or try making it a box or this unit will not make it up onto walls to deliver it's goods.
    Geometry                = CYLINDER   
    GeometryMajorRadius        = 8.0
    GeometryMinorRadius        = 8.0
    GeometryHeight            = 16.0
    GeometryIsSmall            = Yes   
    Shadow                    = SHADOW_DECAL
    ShadowSizeX                = 27;
    ShadowSizeY                = 27;
    ShadowTexture            = ShadowI;
End
;--------------------------------------------------------------------
ChildObject MenPorterNoSelect MenPorter
    KindOf = PRELOAD CAN_CAST_REFLECTIONS INFANTRY PATH_THROUGH_EACH_OTHER DOZER SWARM_DOZER NOT_AUTOACQUIRABLE MOVE_FOR_NOONE
    ShockwaveResistance = SHOCKWAVE_RESISTANCE_IMMUNE
End

Sanalf 2

  • Gast
Re:Durins, VdZ Coding-Fragen
« Antwort #6 am: 8. Jan 2011, 13:12 »
Na, dann is alles klar. Du musst beim Namen des ChildObjects hinschreiben "ChildObject", dann den Namen des ChildObjects, also für dich "MenPorterNoSelect" und dann den Namen der Einheit, auf die sich das ChildObject bezieht. Du hast da "MenPorter" stehen, das Object heißt aber "FendlandPorter". Das musst du unten natürlich ausbessern.

mfg
sanalf 2

Durin, Vater der Zwerge

  • Heiler von Imladris
  • **
  • Beiträge: 241
Re:Durins, VdZ Coding-Fragen
« Antwort #7 am: 8. Jan 2011, 13:26 »
Danke!
Ich hatte so etwas Ähnliches schon versucht, allerdings habe ich da auch MenPorterNoSelct In FendlandPorterNoSelct umgeändert.

Sanalf 2

  • Gast
Re:Durins, VdZ Coding-Fragen
« Antwort #8 am: 8. Jan 2011, 14:05 »
Bitte sehr.
Ja, das is aber nicht notwendig. Wichtig is nur, dass der zweite Name da auch stimmt.

mfg
sanalf 2

Durin, Vater der Zwerge

  • Heiler von Imladris
  • **
  • Beiträge: 241
Re:Durins, VdZ Coding-Fragen
« Antwort #9 am: 8. Jan 2011, 15:26 »
Ich hab bei der Fähigkeit um die sich meine erste Frage dreht das Problem dass ich mir den Spell zwar kaufen, ihn aber nicht anwenden kann, sprich, er erscheint nicht am linken Bildschirmrand.
Die Codes der Buttons sehen so aus:
CommandButton Command_SpellBookBajulafest
    Command                = SPELL_BOOK
    SpecialPower        = SpellBookBajulafest
    ButtonImage            = SBEvil_Darkness
    TextLabel            = CONTROLBAR:Darkness
    DescriptLabel        = CONTROLBAR:TooltipDarkness
End

CommandButton Command_PurchaseSpellBajulafest
    Command                = PURCHASE_SCIENCE
    ButtonBorderType    = UPGRADE
    ButtonImage            = SBEvil_Darkness
    Science                = SCIENCE_Bajulafest
    TextLabel            = CONTROLBAR:Darkness
    DescriptLabel        = CONTROLBAR:TooltipDarkness
End

Die Labels sowie das Button-Image hab ich absichtlich nicht geändert.
In die Commandsets der Spellbooks hab ich sie auch eingetragen.

Sanalf 2

  • Gast
Re:Durins, VdZ Coding-Fragen
« Antwort #10 am: 8. Jan 2011, 16:08 »
Könntest du vielleicht noch die Einträge aus CommandSet.ini, CommandButton.ini und SpecialPower.ini posten?
Und hast du auch in der "system.ini" deinen Spell eingefügt? Die findest du unter "data\ini\object\system". Da musst du natürlich einen entsprechenden Block für deinen Spell anlegen.

mfg
sanalf 2

Elrond99

  • Galadhrim
  • **
  • Beiträge: 738
Re:Durins, VdZ Coding-Fragen
« Antwort #11 am: 8. Jan 2011, 18:44 »
Ja, das is aber nicht notwendig. Wichtig is nur, dass der zweite Name da auch stimmt.

Falsch
denn dann hätte er zweimal MenPorterNoSelect, entweder umbennen oder löschen

@Durin VdZ

Es gibt zwei Commandsets für Spells, eines für Spellbook und eines zum Einsetzen, du musst beide ändern

Sanalf 2

  • Gast
Re:Durins, VdZ Coding-Fragen
« Antwort #12 am: 9. Jan 2011, 10:32 »
Zitat
Falsch
denn dann hätte er zweimal MenPorterNoSelect, entweder umbennen oder löschen

Versteh ich jetzt nicht ganz: Beim ChildObject kann man das ChildObject selbst benennen wie man will, oder nicht? Und das Hauptobjekt muss natürlich richtig dahinterstehen, so hab ich das aber auch gesagt.

Und das mit den zwei CommandSets hat er glaub ich schon gewusst, er hat ja beide Buttons erstellt und ich geh davon aus, dass er sie eingefügt hat.

mfg
sanalf 2

Elrond99

  • Galadhrim
  • **
  • Beiträge: 738
Re:Durins, VdZ Coding-Fragen
« Antwort #13 am: 9. Jan 2011, 10:53 »
Ja aber er darf nicht MenPorterNoSelect stehen lassen, denn dann hätte er das zweimal
Einmal als ChildObject des MenPorters und einmal als ChildObject seines neuen Porters

Es stimmt, dass man es nennen darf wie man will, nur wenn es zweimal vorkommt gibts einen Crash

Bei ihm war die Reihenfolge:
FendlandPorter
MenPorterNoSelect (als ChildObject von MenPorter)
MenPorter
MenPorterNoSelect (als ChildObject von MenPorter)

Deswegen der obige Crash (das Child vor dem Original)
Hätte er:
FendlandPorter
MenPorterNoSelect (als ChildObject von FendlandPorter)
MenPorter
MenPorterNoSelect (als ChildObject von MenPorter)
oder
FendlandPorter
MenPorter
MenPorterNoSelect (als ChildObject von MenPorter)
MenPorterNoSelect (als ChildObject von MenPorter)

würde das Spiel wegen zweimaligem Vorhandensein von MenPorterNoSelect crashen

Falls dir nicht klar ist, wie ich zu der Reihenfolge komme, die inis werden alphabetisch und von oben nach unten gelesen, also
data\ini\object\goodfaction\structures\fendland
wäre vor
data\ini\object\goodfaction\structures\men

Sanalf 2

  • Gast
Re:Durins, VdZ Coding-Fragen
« Antwort #14 am: 9. Jan 2011, 11:00 »
Doch, doch, das ganze is mir schon klar. Ich hab eben angenommen, dass er die INI vom menporter gleich verändert hat und nicht zuerst kopiert hat. Dann könnte er es so machen, wie ich gesagt habe.

Aber ich würde sagen: Back to topic

mfg
sanalf 2