my freind i have finally solved this (i allow you to use it in your see mod, specify only that is my code in the credit and in the ini of your mod pls) :
Treebeard/EntInfantry.ini
WeaponSet
Conditions = None
Weapon = PRIMARY RohanTreeBeardRockChunkThrow
Weapon = SECONDARY RohanTreeBeardPunch
Weapon = TERTIARY RohanBuildingTeardown
PreferredAgainst = PRIMARY STRUCTURE BLOCKING_GATE ; Preferred is more powerful than Only, so if we have a rock we will chuck it, but otherwise we will choke a building
OnlyAgainst = TERTIARY STRUCTURE BLOCKING_GATE
End
Behavior = AutoPickUpUpdate AutoPickUpForRocks
ScanDelayTime = 0
ScanDistance = 300; default value is 300 units
PickUpFilter = NONE +ROCK_VENDOR ; Not Rock, because this module finds someone to hit with the GrabPassenger power, and in there is where vendor is handled
RunFromButton = Yes ; No natural scanning, wakes up to run exactly once when hit with a WakeAutoPickup button
RunFromButtonNumber = 1; In case of multiples, this lines up with the OPTION_(ONE) field in the waking button
End
;building chunk
Behavior = GrabPassengerSpecialPower ModuleTag_GrabBuildingChunk
SpecialPowerTemplate = SpecialAbilityGrabPassenger2
UpdateModuleStartsAttack = Yes
InitiateSound = TreebeardVoiceGrabBuildingChunk
; InitiateSound2 = TreebeardVoice
AllowTree = No
End
Behavior = SpecialAbilityUpdate ModuleTag_082
SpecialPowerTemplate = SpecialAbilityGrabPassenger2
StartAbilityRange = 10.0
UnpackTime = 1300 ; Nothing to touching it
PreparationTime = 0 ; touching it to grabbing it
PersistentPrepTime = 0 ; grabbing it to whacking it on the ground (if shrubbery)
PackTime = 1700 ; whacking it to holding it nice
ContactPointOverride = Grab ; If the victim building has a point named this, we'll go there instead of to the bounding circle.
; GrabChunkObject = EntThrownBuildingRock
; GrabChunkFX = FX_WallGrab
; GrabChunkDamage = 490
; GrabChunkOffset = X:16 Y:0
; PackSound =
; UnpackSound =
; TriggerSound =
; PrepSoundLoop =
AwardXPForTriggering = 0
RejectedConditions = WEAPON_TOGGLE ; Cannot pick things up when already holding a rock to throw
End
;pick up a rock and grab it (this is a bonnus: a bfme1 ability that make the ent of treebeard can grab a little rock on a rock pile like this: )
Behavior = GrabPassengerSpecialPower ModuleTag_GrabRock
SpecialPowerTemplate = SpecialAbilityGrabPassenger
UpdateModuleStartsAttack = Yes
GrabRadius = 200
AllowTree = No
InitiateSound = TreebeardVoiceGrabRock
; InitiateSound2 = TreebeardVoice
End
Behavior = SpecialAbilityUpdate ModuleTag_08
SpecialPowerTemplate = SpecialAbilityGrabPassenger
StartAbilityRange = 8.0
UnpackTime = 600 ; Nothing to touching it
PreparationTime = 0 ; touching it to grabbing it
PersistentPrepTime = 0 ; grabbing it to whacking it on the ground (if shrubbery)
PackTime = 1333 ; whacking it to holding it nice
;GrabChunkObject = EntThrownBuildingRock
;GrabChunkFX = FX_WallGrab
;GrabChunkDamage = 490
;GrabChunkOffset = X:16 Y:0
; PackSound =
; UnpackSound =
; TriggerSound =
; PrepSoundLoop =
AwardXPForTriggering = 0
RejectedConditions = WEAPON_TOGGLE ; Cannot pick things up when already holding a rock to throw
End
Behavior = TransportContain ModuleTag_09
ObjectStatusOfContained = UNSELECTABLE
PassengerFilter = ANY +ROCK
CanGrabStructure = Yes ; Overrides buildings' natural 0 in TransportSlotCount that makes them uncontainable
Slots = 1
ShowPips = No
AllowEnemiesInside = Yes
AllowNeutralInside = Yes
AllowAlliesInside = No
DamagePercentToUnits = 0%
TypeOneForWeaponState = ROCK
PassengerBonePrefix = PassengerBone:Firepoint KindOf:ROCK
End
in the generic ent anim.inc replace this:
;--------------------------------------------------
;
; HAND ATTACKS
;
;--------------------------------------------------
AnimationState = MOVING FIRING_OR_PREATTACK_A WEAPONSET_ENRAGED
Animation = RunAndFire
AnimationName = RUTreeberd_ATRB
AnimationMode = LOOP
End
End
AnimationState = MOVING FIRING_OR_PREATTACK_A
Animation = RunAndFire
AnimationName = RUTreeberd_ATRA
AnimationMode = LOOP
End
End
AnimationState = FIRING_OR_PREATTACK_A
Animation = Punch
AnimationName = RUTreeberd_ATKA
AnimationMode = ONCE
AnimationBlendTime = 5
UseWeaponTiming = Yes
End
Animation = Punt
AnimationName = RUTreeberd_ATKD
AnimationMode = ONCE
AnimationBlendTime = 5
UseWeaponTiming = Yes
End
Animation = FrontKick
AnimationName = RUTreeberd_ATKE
AnimationMode = ONCE
AnimationBlendTime = 5
UseWeaponTiming = Yes
End
Animation = KirkPunch
AnimationName = RUTreeberd_ATKF
AnimationMode = ONCE
AnimationBlendTime = 5
UseWeaponTiming = Yes
End
BeginScript
if CurDrawableIsCurrentTargetKindof("MONSTER") then
if GetClientRandomNumberReal(0,1) > 0.50 then
return ("FrontKick")
else
return ("KirkPunch")
end
else
if GetClientRandomNumberReal(0,1) > 0.50 then
return ("Punch")
else
return ("Punt")
end
end
EndScript
End
AnimationState = FIRING_OR_PREATTACK_B
Animation = FrontKickOnBuilding
AnimationName = RUTreeberd_ATKE
AnimationMode = ONCE
AnimationBlendTime = 5
UseWeaponTiming = Yes
End
Animation = KirkPunchOnBuilding
AnimationName = RUTreeberd_ATKF
AnimationMode = ONCE
AnimationBlendTime = 5
UseWeaponTiming = Yes
End
End
AnimationState = INITIAL_ENRAGED
StateName = Enraged
Animation = RUTreeBerd_MADA
AnimationName = RUTreeBerd_MADA
AnimationMode = ONCE
End
End
TO this:
;--------------------------------------------------
;
; HAND ATTACKS
;
;--------------------------------------------------
AnimationState = FIRING_OR_PREATTACK_A AIM_NEAR
Animation = CloseRock
AnimationName = RUTreeberd_THRC
AnimationMode = ONCE
UseWeaponTiming = Yes
AnimationBlendTime = 0
End
FrameForPristineBonePositions = 39
BeginScript
CurDrawableHideSubObjectPermanently("ROCK")
EndScript
End
AnimationState = FIRING_OR_PREATTACK_A
Animation = FarRock
AnimationName = RUTreeberd_THRB
AnimationMode = ONCE
UseWeaponTiming = Yes
AnimationBlendTime = 0
End
FrameForPristineBonePositions = 39
BeginScript
CurDrawableHideSubObjectPermanently("ROCK")
EndScript
End
AnimationState = MOVING FIRING_OR_PREATTACK_B WEAPONSET_ENRAGED
Animation = RunAndFire
AnimationName = RUTreeberd_ATRB
AnimationMode = LOOP
End
End
AnimationState = MOVING FIRING_OR_PREATTACK_B
Animation = RunAndFire
AnimationName = RUTreeberd_ATRA
AnimationMode = LOOP
End
End
AnimationState = FIRING_OR_PREATTACK_B
Animation = Punch
AnimationName = RUTreeberd_ATKA
AnimationMode = ONCE
AnimationBlendTime = 5
UseWeaponTiming = Yes
End
Animation = Punt
AnimationName = RUTreeberd_ATKD
AnimationMode = ONCE
AnimationBlendTime = 5
UseWeaponTiming = Yes
End
Animation = FrontKick
AnimationName = RUTreeberd_ATKE
AnimationMode = ONCE
AnimationBlendTime = 5
UseWeaponTiming = Yes
End
Animation = KirkPunch
AnimationName = RUTreeberd_ATKF
AnimationMode = ONCE
AnimationBlendTime = 5
UseWeaponTiming = Yes
End
BeginScript
if CurDrawableIsCurrentTargetKindof("MONSTER") then
if GetClientRandomNumberReal(0,1) > 0.50 then
return ("FrontKick")
else
return ("KirkPunch")
end
else
if GetClientRandomNumberReal(0,1) > 0.50 then
return ("Punch")
else
return ("Punt")
end
end
EndScript
End
AnimationState = FIRING_OR_PREATTACK_C
Animation = FrontKickOnBuilding
AnimationName = RUTreeberd_ATKE
AnimationMode = ONCE
AnimationBlendTime = 5
UseWeaponTiming = Yes
End
Animation = KirkPunchOnBuilding
AnimationName = RUTreeberd_ATKF
AnimationMode = ONCE
AnimationBlendTime = 5
UseWeaponTiming = Yes
End
End
AnimationState = INITIAL_ENRAGED
StateName = Enraged
Animation = RUTreeBerd_MADA
AnimationName = RUTreeBerd_MADA
AnimationMode = ONCE
End
End
SpecialPower.ini
add this:
SpecialPower SpecialAbilityGrabPassenger2
Enum = SPECIAL_GRAB_CHUNK
ReloadTime = 0 ; in milliseconds
PublicTimer = No
End
Weapon.ini
add this:
Weapon RohanTreeBeardRockChunkThrow ; BALANCE TreeBeard Weapon Rock
IdleAfterFiringDelay = 2000 ;Yes if I want to throw rock, then wait until the followthrough is complete, then go idle.
AttackRange = ROHAN_TREEBEARD_ROCK_RANGE
WeaponSpeed = 200.0 ; dist/sec (huge value == effectively instant)
ProjectileFilterInContainer = ANY +ROCK +INFANTRY; We don't make the projectile, it is in our Contain module.
FireFX = FX_EntThrowSmallRock
PreAttackDelay = 1400
PreAttackType = PER_SHOT ; Do the delay each time we attack a new target
HitPercentage = 0 ; never auto hits, always hits ground
ScatterRadius = 4.0 ;When this weapon misses it can randomly miss by as much as this distance.
FiringDuration = 2000
DelayBetweenShots = 4000
IsAimingWeapon = Yes ; Shooter will use his AimWeaponBehavior to get extra model condition flags
NoVictimNeeded = Yes ; Need no target
LeechRangeWeapon = Yes
ProjectileNugget ; A Nugget that creates an Object and sends it to the target with a Warhead
WarheadTemplateName = RohanTreeBeardRockThrowWarhead
End
End
CommandBoutton.ini
add this:
CommandButton Command_SpecialAbilityTreebeardGrabBuildingChunk ; grabs any Rock
Command = SPECIAL_POWER
SpecialPower = SpecialAbilityGrabPassenger2
Options = OK_FOR_MULTI_SELECT NEED_TARGET_ENEMY_OBJECT NEED_TARGET_NEUTRAL_OBJECT
TextLabel = CONTROLBAR:GrabBuildingChunk
CursorName = EnterFriendly
InvalidCursorName = EnterAggressive
ButtonImage = Ent_Building
ButtonBorderType = SYSTEM ; Identifier for the User as to what kind of button this is
DescriptLabel = CONTROLBAR:ToolTipSpecialAbilityGrabBuildingChunk
;Radial = Yes
;UnitSpecificSound =
InPalantir = Yes
End
resotre this: (remove the ; )
CommandButton Command_SpecialAbilityTreebeardFindRock (this is for the bonus of bfme1 grab little rock on rock pile)
Command = WAKE_AUTO_PICKUP
TextLabel = CONTROLBAR:EntFindRock
ButtonImage = UCEntRock
ButtonBorderType = SYSTEM
DescriptLabel = CONTROLBAR:ToolTipSpecialAbilityEntFindRock
Options = OK_FOR_MULTI_SELECT OPTION_ONE ; Option flag lines up with number in AutoPickup module to differentiate multiples
InPalantir = Yes
End
add this:
CommandButton Command_SpecialAbilityTreebeardHiddenRockGrabForMouse (this is for the bonus of bfme1 grab little rock on rock pile)
Command = SPECIAL_POWER
SpecialPower = SpecialAbilityGrabPassenger
Options = NEED_TARGET_ENEMY_OBJECT NEED_TARGET_NEUTRAL_OBJECT ALLOW_ROCK_TARGET
InPalantir = No
End
CommandSet
replace this:
CommandSet RohanTreeBeardCommandSet
1 = Command_ToggleStance
2 = Command_ToggleTreebeardRockThrow
3 = Command_SpecialAbilityTreebeardGrabBuildingChunk
4 = Command_CrewEvacuateTreebeard (my mod, hobbit evacuate)
5 = Command_TreeBeardFakeLeadershipButton
11 = Command_SpecialAbilityTreebeardHiddenRockGrabForMouse
12 = Command_SpecialAbilityTreebeardFindRock
13 = Command_AttackMove
14 = Command_Stop
16 = Command_SetStanceBattle
17 = Command_SetStanceAggressive
18 = Command_SetStanceHoldGround
End
CommandSet RohanTreeBeardRockCommandSet
1 = Command_ToggleStance
2 = Command_ToggleTreebeardRockThrow
3 = Command_SpecialAbilityTreebeardGrabBuildingChunk
4 = Command_CrewEvacuateTreebeard (my mod, hobbit evacuate)
5 = Command_TreeBeardFakeLeadershipButton
6 = Command_Bombard
13 = Command_AttackMove
14 = Command_Stop
16 = Command_SetStanceBattle
17 = Command_SetStanceAggressive
18 = Command_SetStanceHoldGround
End
CommandSet RohanTreeBeardRockCommandSetStopBombard
1 = Command_ToggleStance
2 = Command_ToggleTreebeardRockThrow
3 = Command_SpecialAbilityTreebeardGrabBuildingChunk
4 = Command_CrewEvacuateTreebeard (my mod, hobbit evacuate)
5 = Command_TreeBeardFakeLeadershipButton
6 = Command_StopBombard
13 = Command_AttackMove
14 = Command_Stop
16 = Command_SetStanceBattle
17 = Command_SetStanceAggressive
18 = Command_SetStanceHoldGround
End
CommandSet RohanEntCommandSet
1 = Command_ToggleStance
2 = Command_ToggleEntRockThrow
3 = Command_SpecialAbilityTreebeardGrabBuildingChunk
11 = Command_SpecialAbilityTreebeardHiddenRockGrabForMouse
12 = Command_SpecialAbilityTreebeardFindRock
13 = Command_AttackMove
14 = Command_Stop
16 = Command_SetStanceBattle
17 = Command_SetStanceAggressive
18 = Command_SetStanceHoldGround
End
CommandSet RohanEntRockCommandSet
1 = Command_ToggleStance
2 = Command_ToggleEntRockThrow
3 = Command_SpecialAbilityTreebeardGrabBuildingChunk
4 = Command_Bombard
13 = Command_AttackMove
14 = Command_Stop
16 = Command_SetStanceBattle
17 = Command_SetStanceAggressive
18 = Command_SetStanceHoldGround
End
CommandSet RohanEntRockCommandSetStopBombard
1 = Command_ToggleStance
2 = Command_ToggleEntRockThrow
3 = Command_SpecialAbilityTreebeardGrabBuildingChunk
4 = Command_StopBombard
13 = Command_AttackMove
14 = Command_Stop
16 = Command_SetStanceBattle
17 = Command_SetStanceAggressive
18 = Command_SetStanceHoldGround
End
NatureRocks.ini
find this: ObjectReskin EntThrownBuildingRock GenericThrowableRock
and add this:
Scale 1.5 (because the rock is verry verry small)
......................................................
in vanilla bfme1 & bfme2 lot of ruins structure are already grabbable like the ruined tower, osgiliath ruins ...
to make a new structure are grabbalbe add this in is ini
CHUNK_VENDOR (to the KindOf)
GrabObject = EntThrownBuildingRock (in the Body of the structure)
GrabFX = FX_WallGrab
GrabDamage = 490
GrabOffset = X:16 Y:0
;Grab point for rock-wielding ents (at the end of the normal geometry)
GeometryContactPoint X:26 Y:0 Z:0 Grab
GeometryContactPoint X:13 Y:-13 Z:80
GeometryContactPoint X:0 Y:-26 Z:0 Grab
GeometryContactPoint X:-13 Y:-13 Z:80
GeometryContactPoint X:-26 Y:0 Z:0 Grab
GeometryContactPoint X:-13 Y:13 Z:80
GeometryContactPoint X:0 Y:26 Z:0 Grab
Now the ent and treebeard (i don't know if that work on ent ash) can grab building chunk
(the buttonimmage of grab building chunk don't exist in bfme2 don't forget to put it in your bfme mod asset)
the only problem is that the hobbit can't mount on treebeard because he have two transport contain behaviour module
we must find how to put 2 behaviour contain module or try to fusion the tow module
Edited by Miraak5, 15 January 2016 - 09:26 PM.