Drakkhan
Illuria Project Lead
- Joined
- Oct 3, 2013
- Messages
- 141
- Reaction score
- 22
In my movements.xml I have lines like:
and lines like:
So I understand that these lines activate when certain events occur (i.e. event="StepIn" triggers script "swimming.lua' when someone steps on item "4620").. but:
What is the difference between script and function?
Can one of these lines have both a script and a function?
How do the events pass information to the corresponding .lua script (how does swimming.lua know to use function OnStepIn() instead of function OnStepOut())?
What kind of lua functions are there to react to these events in the called scripts?
If I want to add a script that triggers when a person equips an item AND when they de-equip an item, how do I change my movements.xml and what functions must I include in the .lua script to catch the events?
I know it's a lot of questions, but if they could be answered, then I don't have to beg for scripts .
Regards,
Drakkhan
Code:
<movevent event="StepIn" fromid="4620" toid="4625" script="swimming.lua"/>
<movevent event="StepOut" fromid="4620" toid="4625" script="swimming.lua"/>
and lines like:
Code:
<movevent event="Equip" itemid="2195" slot="feet" function="onEquipItem"/>
<movevent event="DeEquip" itemid="2195" slot="feet" function="onDeEquipItem"/>
So I understand that these lines activate when certain events occur (i.e. event="StepIn" triggers script "swimming.lua' when someone steps on item "4620").. but:
What is the difference between script and function?
Can one of these lines have both a script and a function?
How do the events pass information to the corresponding .lua script (how does swimming.lua know to use function OnStepIn() instead of function OnStepOut())?
What kind of lua functions are there to react to these events in the called scripts?
If I want to add a script that triggers when a person equips an item AND when they de-equip an item, how do I change my movements.xml and what functions must I include in the .lua script to catch the events?
I know it's a lot of questions, but if they could be answered, then I don't have to beg for scripts .
Regards,
Drakkhan