Modderecke > Coding
Durins, VdZ Coding-Fragen
Durin, Vater der Zwerge:
Am ´End´ liegts jedenfalls nicht. Hier sind noch einmal die gesamten Codes des Porters
--- Code: ---;------------------------------------------------------------------------------
;
; 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
--- Ende Code ---
Sanalf 2:
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:
Danke!
Ich hatte so etwas Ähnliches schon versucht, allerdings habe ich da auch MenPorterNoSelct In FendlandPorterNoSelct umgeändert.
Sanalf 2:
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:
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:
--- Code: ---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
--- Ende Code ---
Die Labels sowie das Button-Image hab ich absichtlich nicht geändert.
In die Commandsets der Spellbooks hab ich sie auch eingetragen.
Navigation
[0] Themen-Index
[#] Nächste Seite
[*] Vorherige Sete
Zur normalen Ansicht wechseln