rdfs:comment
| - This document will detail a few basic scripts you can add to modules, and what they do. It also details locations to find many of the function names and constants. When it comes to using the scripting interface, most function and constants are very simple to learn, and are detailed sufficiently. Most functions begin with "Get", "Add", "Set", "Create", "Delete", and "Assign" and you will get a list of every function. As you scroll through, each will be detailed in terms of what they do, and what needs to be passed into the function. I.E. an AddAbility function requires the tag of the ability you wish to add, followed by who it is being added to.
|
abstract
| - This document will detail a few basic scripts you can add to modules, and what they do. It also details locations to find many of the function names and constants. When it comes to using the scripting interface, most function and constants are very simple to learn, and are detailed sufficiently. Most functions begin with "Get", "Add", "Set", "Create", "Delete", and "Assign" and you will get a list of every function. As you scroll through, each will be detailed in terms of what they do, and what needs to be passed into the function. I.E. an AddAbility function requires the tag of the ability you wish to add, followed by who it is being added to. All tags can easily be found throughout Djinni. I.E. if you wish to find a tag for a sword, you can either open a pre-designed template and copy the tag, or create a new one and use a new tag. Now when it comes to #defines and constants, you will need to download the NWScriptDefn file at (or it can be found in C:\Program Files\The Witcher\System\Scripts) and open in a text editor. In this document will be listed every single constant used (such as equipment slots like INVENTORY_SLOT_STEELSWORD and INVENTORY_SLOT_SHORT1), and every function in The Witcher. It is a very useful reference guide when you are trying to script. Below is an example initialize script with comments to describe what they do. It can be used in "On Client Enter" in Module Properties: object oPC = GetFirstPC(); DestroyObject(GetItemPossessedBy(oPC, "it_witcharm_001")); DestroyObject(GetItemPossessedBy(oPC, "it_stlswd_001")); CreateItemOnObject("it_witcharm_004", oPC, 1); object steelsword = CreateItemOnObject("it_stlswd_012", oPC, 1); CreateItemOnObject("it_svswd_006", oPC, 1); AssignCommand(oPC, ActionEquipItem(steelsword, INVENTORY_SLOT_STEELSWORD)); SetCurrentToxinCapacity(100, oPC); AddAbility("HeroStartingAbility", oPC); AddAbility("AutoJump", oPC); AddAbility("AttackFromBehind", oPC); AddAbility("SkinningKnife", oPC); AddAbility("Aard1", oPC); AddAbility("Igni1", oPC); AddAbility("Yrden1", oPC); AddAbility("Axi1", oPC); AddAbility("Quen1", oPC); AddAbility("Dexterity1 Upgrade1", oPC); AddAbility("Intelligence1 Upgrade1", oPC); SetXP(oPC, 250000); AddTalents(40,40,40); }
|