Difference between revisions of "NDMobileTemplates"
(Created page with "<p style="width:60%;margin: 0 auto">[Main] [Lua Examples]</p> <center><p style="width: 60%">A B C [...") |
|||
Line 1: | Line 1: | ||
− | <p style="width:60%;margin: 0 auto">[[NewDawnHome|[Main]]] [[ | + | <p style="width:60%;margin: 0 auto">[[NewDawnHome|[Main]]] [[NDServerIndexTemplateMain|[Templates]]]</p> |
+ | |||
− | |||
<p style="color: #DDDD88;font-size: 22px;width:60%;margin: 0 auto">Global Functions & Examples</p> | <p style="color: #DDDD88;font-size: 22px;width:60%;margin: 0 auto">Global Functions & Examples</p> | ||
<center> | <center> | ||
Line 11: | Line 11: | ||
<p style="width: 60%;margin: 0 auto">Example of adding a view to a object</p> | <p style="width: 60%;margin: 0 auto">Example of adding a view to a object</p> | ||
<div style="width:60%;margin: 0 auto"> | <div style="width:60%;margin: 0 auto"> | ||
− | + | <ObjectTemplate> | |
− | + | <ClientId>134</ClientId> | |
− | + | <Name>Grizzly Bear</Name> | |
+ | <ScaleModifier>1</ScaleModifier> | ||
+ | <SharedStateEntry name="BodyOffset" type="double" value="1.15"/> | ||
+ | <MobileComponent> | ||
+ | <BaseRunSpeed>0.9</BaseRunSpeed> | ||
+ | <MobileType>Animal</MobileType> | ||
+ | </MobileComponent> | ||
+ | <ObjectVariableComponent> | ||
+ | <DoubleVariable Name="BaseHealth">300</DoubleVariable> | ||
+ | <StringVariable Name="MobileTeamType">Bear</StringVariable> | ||
+ | <StringVariable Name="MobileKind">Animal</StringVariable> | ||
+ | <DoubleVariable Name="HostileLevel">7</DoubleVariable> | ||
+ | <BoolVariable Name="AI-Leash">False</BoolVariable> | ||
+ | <BoolVariable Name="AI-RandomizeScale">False</BoolVariable> | ||
+ | <BoolVariable Name="AI-CanUseCombatAbilities">false</BoolVariable> | ||
+ | <BoolVariable Name="AI-ScaleToAge">False</BoolVariable> | ||
+ | <BoolVariable Name="AI-CanFlee">True</BoolVariable> | ||
+ | <DoubleVariable Name="Armor">46</DoubleVariable> | ||
+ | <DoubleVariable Name="Attack">12</DoubleVariable> | ||
+ | <DoubleVariable Name="BardingDifficulty">100</DoubleVariable> | ||
+ | <BoolVariable Name="DoNotEquip">True</BoolVariable> | ||
+ | <DoubleVariable Name="TamingDifficulty">59.1</DoubleVariable> | ||
+ | <DoubleVariable Name="PetSlots">1</DoubleVariable> | ||
+ | </ObjectVariableComponent> | ||
+ | <ScriptEngineComponent> | ||
+ | <LuaModule Name="ai_default_animal"> | ||
+ | <Initializer> | ||
+ | { | ||
+ | Stats = { Str=40, Agi=30, Int=21, Wis=10, Wil=10 }, | ||
+ | MobTraits = | ||
+ | { | ||
+ | }, | ||
+ | Skills = | ||
+ | { | ||
+ | Brawling = 10, | ||
+ | }, | ||
+ | LootTables = | ||
+ | { | ||
+ | }, | ||
+ | } | ||
+ | </Initializer> | ||
+ | </LuaModule> | ||
+ | <LuaModule Name="animal_parts"> | ||
+ | <Initializer> | ||
+ | { | ||
+ | MeatCount = 4, | ||
+ | |||
+ | MeatType = "TenderMeat", | ||
+ | AnimalParts = | ||
+ | { | ||
+ | { ResourceType="LeatherHide", RarityPct=100, Count=2 }, | ||
+ | { ResourceType="CornSeed", RarityPct=5, Count=1 }, | ||
+ | { ResourceType="SquashSeed", RarityPct=5, Count=1 }, | ||
+ | { ResourceType="GreenLeafLettuceSeed", RarityPct=5, Count=1 }, | ||
+ | { ResourceType="RedLeafLettuceSeed", RarityPct=5, Count=1 }, | ||
+ | { ResourceType="ButtonMushroomSeed", RarityPct=5, Count=1 }, | ||
+ | { ResourceType="MelonSeed", RarityPct=5, Count=1 }, | ||
+ | }, | ||
+ | } | ||
+ | </Initializer> | ||
+ | </LuaModule> | ||
+ | </ScriptEngineComponent> | ||
+ | </ObjectTemplate> | ||
</div> | </div> |
Revision as of 01:58, 5 December 2019
Global Functions & Examples
AddView(eventid,searcher,frequency) eventid - Event identifier for eventssearcher - Object searcher that defines the view frequency - Update frequency check in seconds. |
The frequency argument may be omitted, the View will default to 0.25 seconds for the frequency. The minimum value of frequency is 0.1 seconds. |
Example of adding a view to a object
<ObjectTemplate> <ClientId>134</ClientId> <Name>Grizzly Bear</Name> <ScaleModifier>1</ScaleModifier> <SharedStateEntry name="BodyOffset" type="double" value="1.15"/> <MobileComponent> <BaseRunSpeed>0.9</BaseRunSpeed> <MobileType>Animal</MobileType> </MobileComponent> <ObjectVariableComponent> <DoubleVariable Name="BaseHealth">300</DoubleVariable> <StringVariable Name="MobileTeamType">Bear</StringVariable> <StringVariable Name="MobileKind">Animal</StringVariable> <DoubleVariable Name="HostileLevel">7</DoubleVariable> <BoolVariable Name="AI-Leash">False</BoolVariable> <BoolVariable Name="AI-RandomizeScale">False</BoolVariable> <BoolVariable Name="AI-CanUseCombatAbilities">false</BoolVariable> <BoolVariable Name="AI-ScaleToAge">False</BoolVariable> <BoolVariable Name="AI-CanFlee">True</BoolVariable> <DoubleVariable Name="Armor">46</DoubleVariable> <DoubleVariable Name="Attack">12</DoubleVariable> <DoubleVariable Name="BardingDifficulty">100</DoubleVariable> <BoolVariable Name="DoNotEquip">True</BoolVariable> <DoubleVariable Name="TamingDifficulty">59.1</DoubleVariable> <DoubleVariable Name="PetSlots">1</DoubleVariable> </ObjectVariableComponent> <ScriptEngineComponent> <LuaModule Name="ai_default_animal"> <Initializer> { Stats = { Str=40, Agi=30, Int=21, Wis=10, Wil=10 }, MobTraits = { }, Skills = { Brawling = 10, }, LootTables = { }, } </Initializer> </LuaModule> <LuaModule Name="animal_parts"> <Initializer> { MeatCount = 4, MeatType = "TenderMeat", AnimalParts = { { ResourceType="LeatherHide", RarityPct=100, Count=2 }, { ResourceType="CornSeed", RarityPct=5, Count=1 }, { ResourceType="SquashSeed", RarityPct=5, Count=1 }, { ResourceType="GreenLeafLettuceSeed", RarityPct=5, Count=1 }, { ResourceType="RedLeafLettuceSeed", RarityPct=5, Count=1 }, { ResourceType="ButtonMushroomSeed", RarityPct=5, Count=1 }, { ResourceType="MelonSeed", RarityPct=5, Count=1 }, }, } </Initializer> </LuaModule> </ScriptEngineComponent> </ObjectTemplate>