Jump to content


Lauri

Member Since 02 Jul 2005
Offline Last Active Sep 15 2022 06:44 PM

Posts I've Made

In Topic: Hid subobject after toggling weapon

15 September 2022 - 06:44 PM

Yes, if the model allows it, but you'll need to use scripts. The model has to have a separate model for the bow and quiver, otherwise it won't work.

 

Here's a look at what I use in T4A for a hero that shows and hides a separate shield, depending on if he's using a sword or the bow:

In eoelm.ini (the hero's file)

	Behavior = AIUpdateInterface ModuleTag_03
		AutoAcquireEnemiesWhenIdle = Yes ATTACK_BUILDINGS
		MoodAttackCheckRate        = 500
		HoldGroundCloseRangeDistance = 41
		AILuaEventsList				= EoelmFunctions
	End

In scriptevents.xml

 

<ModelConditionEvent Name="UsingSword">
            <Conditions>+WEAPONSET_TOGGLE_1</Conditions>
</ModelConditionEvent>
<ModelConditionEvent Name="UsingBow">
            <Conditions>-WEAPONSET_TOGGLE_1</Conditions>
</ModelConditionEvent>


<EventList Name="MorgonFunctions" Inherit="BaseScriptFunctions">
<EventHandler EventName="OnCreated" ScriptFunctionName="OnMorgonCreated" DebugSingleStep="false"/>
<EventHandler EventName="UsingSword" ScriptFunctionName="OnMorgonSword" DebugSingleStep="false"/>
<EventHandler EventName="UsingBow" ScriptFunctionName="OnMorgonBow" DebugSingleStep="false"/>
</EventList>

 

In scripts.lua

function OnEoelmCreated(self)
	ObjectHideSubObjectPermanently( self, "SHIELD", true )
end 
function OnEoelmSword(self)
	ObjectHideSubObjectPermanently( self, "SHIELD", false )
	ObjectHideSubObjectPermanently( self, "SHIELD_BACK", true )
end 
function OnEoelmBow(self)
	ObjectHideSubObjectPermanently( self, "SHIELD", true )
	ObjectHideSubObjectPermanently( self, "SHIELD_BACK", false )
end

Change SHIELD to SWORD if you want to hide the sword when using the bow, and change SHIELD_BACK to BOW. You'll have to add the same line and change it to QUIVER as well, but again, the model has to have the subobjects on the model for it to work.

 

Sorry about the rush, I don't have time to explain it more in detail right now.


In Topic: [Both games] Call the Horde duration

15 September 2022 - 06:33 PM

Could it be seconds? 3 minutes?


In Topic: Siege weapons knock down trees

15 July 2022 - 03:33 PM

This is done by the CrushableLevel in the object's, I believe.

 

For instance, you'll find this in the GondorTrebuchet:

CrushableLevel = 2  ;What am I?:        0 = for infantry, 1 = for trees, 2 = general vehicles

I don't know what 1 does, really, but setting it on 0 should stop making them knock down trees. Remember that you'll have to change it manually for every siege machine you want (Gondor Trebuchet, Isengard Ballista, etc..)