TnZ Scripting Tricks FAQ
Here you can find some scripting FAQ. If you want to know how to do something - just request here. I'll try to answer asap and post solution in this little FAQ.1. How to change NPC/Player appearance by script?
Here you can find some scripting FAQ. If you want to know how to do something - just request here. I'll try to answer asap and post solution in this little FAQ.1. How to change NPC/Player appearance by script?
Note: creature will have only new appearance - not, for instance, new animation sets!2. Script that force Witcher to draw the sword:void main(){ object oTarget = GetObjectByTag("my_tag"); int iApearance = 1; SetCreatureAppearance(oTarger, iApearance);}
Note: Of coursce you can use INVENTORY_SLOT_SILVERSWORD instead of *STEELSWORD.3. How to script CameraShake effect?void main(){ object oPC = GetFirstPC(); object oItem = GetItemInSlot(INVENTORY_SLOT_STEELSWORD, oPC); AssignCommand(oPC, ActionEquipItem(oItem, INVENTORY_SLOT_RIGHTHAND));}
4. Is there possibility to force Witcher to move from point A to B?#include "inc_cameffects"void main(){ CameraShake(0.1, 0.07, 0.3);}
5. Is there any delay function? Like sleep() in C++.No but you can use DelayCommand to achieve something simillar. For ex:void main(){ object oTarget = GetObjectByTag("my_npc_tag"); object oGoTo = GetObjectByTag("tag_of_destination_object"); AssignCommand(oTarger, ActionMoveToObject(oGoTo));}
void My_delayed_function(){ // something here}void main(){ float fTime = 10.0; DelayCommand(fTime,My_delayed_function());}