To make an item that starts a specific conversation:
__talk_with_me__.nss
// _combo_tag_base_
// __talk_with_me__
//first 16 letters = script to execute, beyond (17+) = subtag data
#include "x2_inc_switches"
void main()
{
if (GetUserDefinedItemEventNumber() != X2_ITEM_EVENT_ACTIVATE) return;
string sTag = GetTag(GetItemActivated());
string sSubTag = GetSubString(sTag, 16, GetStringLength(sTag)-16);
object oPC = GetItemActivator();
AssignCommand(oPC, ActionStartConversation(oPC, sSubTag,TRUE,FALSE));
}
For example, a dm tool might have the tag "__talk_with_me__DMTOOL" to start a conversation named "DMTOOL"
Thus a single script is capable of handling multiple instances of use, while being much more persistant than local vars,
and in addition it helps take the load off of server databases...
Modifié par Carcerian, 13 juin 2012 - 12:25 .