„Chris.MultiNPC.lsl“ ändern
This commit is contained in:
parent
cce6b046fa
commit
40829f5094
|
@ -3,7 +3,7 @@ yoptions;
|
|||
|
||||
//===================
|
||||
//Version: 0.1.3
|
||||
//Datum: 30.01.2021
|
||||
//Datum: 29.01.2021
|
||||
//UpdateRAW: https://clatza.dev/Christopher/OpenSim.Script.Chris.MultiNPC/raw/branch/master/Chris.MultiNPC.lsl
|
||||
//Made by: Chris Resident @ inc.li:8002
|
||||
//Dependencies:
|
||||
|
@ -221,11 +221,16 @@ doNextScriptStep()
|
|||
string currentPath = getDataEntryFromDataList(m_npcdata, "npc." + currentNPCSlot + ".path");
|
||||
string currentState = getDataEntryFromDataList(m_npcdata, "npc." + currentNPCSlot + ".state");
|
||||
string currentncname = getDataEntryFromDataList(m_npcdata, "npc." + currentNPCSlot + ".ncname");
|
||||
vector lastKnownPos = (vector)getDataEntryFromDataList(m_npcdata, "npc." + currentNPCSlot + ".position");
|
||||
|
||||
list pathLineData = llParseString2List(currentPath, [";"], []);
|
||||
string currentCommand = llList2String(pathLineData, currentLine);
|
||||
list lineCommandData = llParseString2List(currentCommand, ["=", "|"], []);
|
||||
|
||||
list currentNPCDataList = llGetObjectDetails(currentNPCKey, [OBJECT_POS]);
|
||||
|
||||
vector currentNPCPosition = llList2Vector(currentNPCDataList, 0);
|
||||
|
||||
if(currentState == "wait")
|
||||
{
|
||||
integer waitTime = getDataEntryFromDataList(m_npcdata, "npc." + currentNPCSlot + ".waittime");
|
||||
|
@ -239,12 +244,13 @@ doNextScriptStep()
|
|||
if(currentState == "walk")
|
||||
{
|
||||
vector targetPosition = (vector)getDataEntryFromDataList(m_npcdata, "npc." + currentNPCSlot + ".targetPosition");
|
||||
list currentNPCDataList = llGetObjectDetails(currentNPCKey, [OBJECT_POS]);
|
||||
|
||||
|
||||
if(llGetListLength(currentNPCDataList) == 0)
|
||||
hardReset();
|
||||
|
||||
vector currentNPCPosition = llList2Vector(currentNPCDataList, 0);
|
||||
if(llVecDist(lastKnownPos, currentNPCPosition) <= 0.5)
|
||||
hardReset();
|
||||
|
||||
if(llVecDist(currentNPCPosition, targetPosition) >= 1)
|
||||
continue;
|
||||
|
||||
|
@ -258,6 +264,7 @@ doNextScriptStep()
|
|||
}
|
||||
|
||||
m_npcdata = setDataEntryInDataList(m_npcdata, "npc." + currentNPCSlot + ".line", currentLine);
|
||||
m_npcdata = setDataEntryInDataList(m_npcdata, "npc." + currentNPCSlot + ".position", currentNPCPosition);
|
||||
|
||||
switch(llList2String(lineCommandData, 0))
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue