<NME> config.ini
<BEF> ;Path Options
;Point these to the folder containing the original game executable.
;If using GOG.com version extract the "game.gog" to a new folder and point to that instead. See readme.
;Make sure these paths end with the trailing slash \
Path_UW0=c:\games\uwdemo\
Path_UW1=c:\games\uw1
Path_UW2=c:\games\uw2\
Path_Shock=C:\Games\SystemShock\
Path_TNova=C:\Games\Terra Nova\CD\Terra_Nova\

;MouseLookOptions.
;Change the following to control mouse sensitivity
;Setting values to negative will also invert axis.
MOUSEX=15
MOUSEY=15

;Special key bindings
;Setup standard movement controls in options window at game launch.
flyup=r
flydown=v
togglemouselook=e
togglefullscreen=f
interactionoptions=f1
interactiontalk=f2
interactionpickup=f3
interactionlook=f4
interactionattack=f5
interactionuse=f6
castspell=q
trackskill=t

;Graphics
;Light level. Controls the default light level around the player
DefaultLightLevel=16
;Field of view
FOV=75

;Cheats
;1 to enable.
;0 to disable
InfiniteMana=0
GodMode=0
;0 to disable
InfiniteMana=0
GodMode=0

;Gameplay
;Use the new context sensitive action controls. Set to zero to revert to vanilla controls.
ContextUIEnabled=1

;Set to 1 to allow the automatic using of door keys on locked doors if the correct key is available
AutoKeyUse=1

;Set to 1 to allow automatically eating of food hunger level drops below 10
AutoEat=1

;Developer
;Create an object report as each level is loaded
GenReport=1
;Only show in use objects in reports
ShowInUse=1


<MSG> Rework of AI to use Unity's AI Navmeshes
<DFF> @@ -31,12 +31,29 @@ trackskill=t
 
 ;Graphics
 ;Light level. Controls the default light level around the player
-DefaultLightLevel=16
+DefaultLightLevel=8
 ;Field of view
 FOV=75
 
+;Music
+;Replace the path with the folder containing the .ogg files 
+;The currently release soundpack zip contains the following packs
+;UW1_PSX -- The orchestral soundtrack from the PSX release
+;UW1_SB16 -- A soundblaster style soundtrack
+;UW1_SB16 -- A soundblaster style soundtrack
+;UW1_MIDI -- A midi (adblib??) style soundtrack
+;Custom tracks can be added by creating a new folder and putting your own .ogg files into a new folder and 
+;putting it's path here.
+;Names are in the format ##.ogg  (e.g. 01.ogg, 04.ogg, 15.ogg)
+UW1_Soundbank=C:\Games\UWSoundPack\UW1_PSX\
+UW2_Soundbank=C:\Games\UWSoundPack\UW1_PSX\
+
 ;Cheats
 ;1 to enable.
 ;0 to disable
 InfiniteMana=0
-GodMode=0
\ No newline at end of file
+GodMode=0
+
+;Gameplay
+;Use the new context sensitive action controls. Set to zero to revert to vanilla controls.
+ContextUIEnabled=1
\ No newline at end of file

{'commit': 'diff --git a/UnityScripts/scripts/Actions/Action_Moving_Platform.cs b/UnityScripts/scripts/Actions/Action_Moving_Platform.cs\nindex 468ec0ec..fbe74c32 100644\n--- a/UnityScripts/scripts/Actions/Action_Moving_Platform.cs\n+++ b/UnityScripts/scripts/Actions/Action_Moving_Platform.cs\n@@ -73,7 +73,7 @@ public class Action_Moving_Platform : MonoBehaviour {\n \tpublic GameObject FindTile(int x, int y, int surface)\n \t{\n \t\tstring tileName = GetTileName (x,y,surface);\n-\t\treturn level.transform.FindChild (tileName).gameObject;\n+\t\treturn level.transform.Find (tileName).gameObject;\n \t}\n \n \ndiff --git a/UnityScripts/scripts/Conversations/ConversationVM.cs b/UnityScripts/scripts/Conversations/ConversationVM.cs\nindex 712c4b2a..360c362a 100644\n--- a/UnityScripts/scripts/Conversations/ConversationVM.cs\n+++ b/UnityScripts/scripts/Conversations/ConversationVM.cs\n@@ -1376,7 +1376,7 @@ public class ConversationVM : UWEBase {\n \t\t\t\t\t\t\t\tcase "play_hunger":\n \t\t\t\t\t\t\t\t\t\tstack.Set(address,UWCharacter.Instance.FoodLevel);break;\n \t\t\t\t\t\t\t\tdefault:\n-\t\t\t\t\t\t\t\t\t\tDebug.Log("unimplemented memory import " + conv[currConv].functions[i].functionName);\n+\t\t\t\t\t\t\t\t\t\t//Debug.Log("unimplemented memory import " + conv[currConv].functions[i].functionName);\n \t\t\t\t\t\t\t\t\t\tbreak;\n \n \t\t\t\t\t\t\t\t}\ndiff --git a/UnityScripts/scripts/Cutscenes/Cutscene_EndGame.cs b/UnityScripts/scripts/Cutscenes/Cutscene_EndGame.cs\nindex c1996ae0..1db65d4e 100644\n--- a/UnityScripts/scripts/Cutscenes/Cutscene_EndGame.cs\n+++ b/UnityScripts/scripts/Cutscenes/Cutscene_EndGame.cs\n@@ -60,13 +60,13 @@ public class Cutscene_EndGame : Cuts {\n \t\t\tImageTimes[12]=74.8f;\n \t\t\tImageLoops[12]=-1;\n \n-\t\t\tImageFrames[13] = "VictorySplash";\n-\t\t\tImageTimes[13] = 90.6f;\n-\t\t\tImageLoops[13]=-1;\n+\t\t\t//ImageFrames[13] = "VictorySplash";\n+\t\t\t//ImageTimes[13] = 90.6f;\n+\t\t\t//ImageLoops[13]=-1;\n \n-\t\t\tImageFrames[14]="Anim_Base";//To finish.\n-\t\t\tImageTimes[14] = 100.0f;\n-\t\t\tImageLoops[14] = -1;\n+\t\t\tImageFrames[13]="Anim_Base";//To finish.\n+\t\t\tImageTimes[13] = 90.6f;//100.0f;\n+\t\t\tImageLoops[13] = -1;\n \n \t\t\tStringBlockNo=3073;\n \t\t\tnoOfSubs=20;\ndiff --git a/UnityScripts/scripts/NPC/NPC.cs b/UnityScripts/scripts/NPC/NPC.cs\nindex 18b50e63..5f2ad4ee 100644\n--- a/UnityScripts/scripts/NPC/NPC.cs\n+++ b/UnityScripts/scripts/NPC/NPC.cs\n@@ -1,8 +1,13 @@\n \ufeffusing UnityEngine;\n using System.Collections;\n+using System.Collections.Generic;\n using RAIN.BehaviorTrees;\n using RAIN.Core;\n using RAIN.Minds;\n+using UnityEngine.AI;\n+\n+\n+\n /// <summary>\n /// NPC Properties and AI\n /// </summary>\n@@ -29,7 +34,7 @@ public class NPC : MobileObject {\n \n \n \n-\t\tpublic int DebugRace;\n+\t\t//public int DebugRace;\n \n \t\t//TODO: these need to match the UW npc_goals\n \t\t//The behaviour trees need to be updated too.\n@@ -84,25 +89,11 @@ public class NPC : MobileObject {\n \n \t\tpublic int CurrentAttack;//What attack the NPC is currently executing.\n \n-\t\t//public int CalcFacingForDebug;\n-\n-\t\t/// Object ID for the NPC\n-\t\t//private string NPC_ID;\n \t\tpublic int NPC_IDi;\n \n-\t\t/// The animation that is currently set\n-\t\t//private string CurrentAnim="";\n-\n-\t\t/// The animator that the NPC is using for it\'s animations\n-\t\t//private Animator anim;\n \n \t\tpublic NPC_Animation newAnim;\n \n-\t\t/// For tracking the state of the NPC\n-\t\t//\tpublic int currentState=-1;\n-\n-\t\t/// Thinks this has to do with changing the NPC on the fly\n-\t\t//private string oldNPC_ID;\n \n \t\t/// The animation index the NPC is facing\n \t\tprivate short facingIndex;\n@@ -120,7 +111,6 @@ public class NPC : MobileObject {\n \t\t/// The angle to the character from the player.\n \t\tprivate float angle;\n \n-\n \t\t///flags the NPC as dead so we can kill them off in the next frame\n \t\tpublic bool NPC_DEAD;\n \n@@ -146,7 +136,9 @@ public class NPC : MobileObject {\n \t\t///To flag initiation of the player into the AI modules\n \t\t//private static bool playerUWReady;\n \t\t///AI module for the character.\n-\t\tprivate AIRig ai;\t\n+\t\t//private AIRig ai;\t\n+\n+\t\tpublic NavMeshAgent Agent;\n \n \t\t///Can the NPC fire off magic attacks.\n \t\t//public bool MagicAttack;\t\n@@ -164,11 +156,24 @@ public class NPC : MobileObject {\n \n \t\tprivate short StartingHP;\n \n-\t\t/*\n-\tvoid Awake () {\n-\t\tanim=GetComponentInChildren<Animator>();\n-\t}*/\n+\t\tpublic int DestTileX;\n+\t\tpublic int DestTileY;\n+\t\t//public bool ArrivedAtDestination;\n+\t\t//public bool TravellingToDestination;\n \n+\t\tpublic float WaitTimer=0f;\n+\n+\n+\t\t/*public struct PathCoord\n+\t\t{\n+\t\t\tpublic int tileX;\n+\t\t\tpublic int tileY;\n+\t\t\tpublic int Counter;\n+\t\t\tpublic bool tested;\n+\t\t};*/\n+\n+\t\t//public List<PathCoord> PathSteps;\n+\t\t//public List<PathCoord> PathStepsFinal;\n \n \t\t/// <summary>\n \t\t/// Initialise some basic info for the NPC ai.\n@@ -177,12 +182,6 @@ public class NPC : MobileObject {\n \t\t\t\tbase.Start();\n \t\t\t\tNPC_IDi=objInt().item_id;\n \t\t\t\tStartingHP=npc_hp;\n-\t\t\t\t//poisondamage = GameWorldController.instance.objDat.critterStats[NPC_IDi-64].Poison;\n-\t\t\t\t//AttackPower = GameWorldController.instance.objDat.critterStats[NPC_IDi-64].AttackPower;\n-\t\t\t\t//AvgHit = GameWorldController.instance.objDat.critterStats[NPC_IDi-64].AvgHit;\n-\t\t\t\t//height=GameWorldController.instance.commonObject.properties[NPC_IDi].height;\n-\t\t\t\t//radius=GameWorldController.instance.commonObject.properties[NPC_IDi].radius;\n-\n \t\t\t\tnewAnim=this.gameObject.AddComponent<NPC_Animation>();\n \t\t\t\tif (GameWorldController.instance.critsLoader[NPC_IDi-64]==null)\n \t\t\t\t{\n@@ -190,15 +189,20 @@ public class NPC : MobileObject {\n \t\t\t\t}\n \t\t\t\tnewAnim.critAnim= GameWorldController.instance.critsLoader[NPC_IDi-64].critter.AnimInfo;\n \t\t\t\tnewAnim.output=this.GetComponentInChildren<SpriteRenderer>();\n-\t\t\t\tDebugRace=GetRace();\n \t\t}\n \n \t\tvoid AI_INIT ()\n \t\t{\n-\t\t\t\tif (ai == null) {\n-\t\t\t\t\t\tGameObject myInstance = Resources.Load ("AI_PREFABS/AI_LAND") as GameObject;\n+\t\t\t\t//if (ai == null) {\n+\t\t\t\t\t\tif (Agent == null)\n+\t\t\t\t\t\t{\n+\t\t\t\t\t\t\t\tAgent = this.gameObject.AddComponent<NavMeshAgent>();\n+\t\t\t\t\t\t\t\tAgent.speed = 1.5f * (((float)GameWorldController.instance.objDat.critterStats[objInt().item_id-64].Speed / 12.0f));\n+\t\t\t\t\t\t}\n+\n+\t\t\t\t\t/*\tGameObject myInstance = Resources.Load ("AI_PREFABS/AI_LAND") as GameObject;\n \t\t\t\t\t\tGameObject newObj = (GameObject)GameObject.Instantiate (myInstance);\n-\t\t\t\t\t\t//NPC_ID=objInt().item_id.ToString();\n+\n \t\t\t\t\t\tnewObj.name = this.gameObject.name + "_AI";\n \t\t\t\t\t\tnewObj.transform.position = Vector3.zero;\n \t\t\t\t\t\tnewObj.transform.parent = this.gameObject.transform;\n@@ -215,7 +219,7 @@ public class NPC : MobileObject {\n \t\t\t\t\t\t{\n \t\t\t\t\t\t\t\tDestroy(this.GetComponent<Animation>()) ;\n \t\t\t\t\t\t}\n-\t\t\t\t}\n+\t\t\t\t}*/\n \t\t}\n \n \t\t/// <summary>\n@@ -248,6 +252,7 @@ public class NPC : MobileObject {\n \t\t\t\tobjInt().objectloaderinfo.InUseFlag=0;\n \t\t\t\tobjInt().objectloaderinfo.npc_hp=0;\n \t\t\t\tNPC_DEAD=true;//Tells the update to execute the NPC death animation\n+\t\t\t\tPerformDeathAnim();\n \t\t\t\t//Dump npc inventory on the floor.\n \t\t\t\tContainer cnt = this.GetComponent<Container>();\n \t\t\t\tif (cnt!=null)\n@@ -293,7 +298,7 @@ public class NPC : MobileObject {\n \t\t/// </summary>\n \t\tpublic void SetupNPCInventory ()\n \t\t{\n-\t\t\t\tif (_RES==GAME_UW1)\n+\t\t\t\tif (_RES!=GAME_UW2)\n \t\t\t\t{\n \t\t\t\t\t\tif (objInt().item_id==64)\n \t\t\t\t\t\t{//Special case for rotworms.\n@@ -334,12 +339,12 @@ public class NPC : MobileObject {\n \t\t\t\t{\n \t\t\t\tcase GAME_UW1:\n \t\t\t\t\t\t{\n-\t\t\t\t\t\t\t\tif (objInt().item_id==64)\n+\t\t\t\t\t\t\t\t/*if (objInt().item_id==64)\n \t\t\t\t\t\t\t\t{//Drop a rotworm corpse\n \t\t\t\t\t\t\t\t\t\tObjectLoaderInfo newobjt= ObjectLoader.newObject(217,0,0,0,256);\n \t\t\t\t\t\t\t\t\t\tObjectInteraction.CreateNewObject(GameWorldController.instance.currentTileMap(),newobjt, GameWorldController.instance.LevelMarker().gameObject,this.transform.position);\n \t\t\t\t\t\t\t\t\t\treturn false;\t\n-\t\t\t\t\t\t\t\t}\n+\t\t\t\t\t\t\t\t}*/\n \t\t\t\t\t\t\t\tswitch (npc_whoami)\n \t\t\t\t\t\t\t\t{\n \t\t\t\t\t\t\t\tcase 22: //The golem on level 6\n@@ -440,13 +445,10 @@ public class NPC : MobileObject {\n \t\t\t\t\t\t\t\t\t\t}\n \t\t\t\t\t\t\t\t\t\treturn false;\t\t\t\t\t\t\t\t\t\t\t\t\n \t\t\t\t\t\t\t\t\t}\n-\n \t\t\t\t\t\t\t}\n \t\t\t\t\t\t\tbreak;\n \t\t\t\t\t\t}\n \t\t\t\t}\n-\n-\n \t\t\t\treturn false;\n \t\t}\n \n@@ -457,11 +459,19 @@ public class NPC : MobileObject {\n \t\t/// AI is only active when the player is close.\n \t\tprotected virtual void  Update () {\n \t\t\t\tif (EditorMode==true){return;}\n+\t\t\t\tif (WaitTimer>0)\n+\t\t\t\t{\n+\t\t\t\t\t\tWaitTimer = WaitTimer -Time.deltaTime;\n+\t\t\t\t\t\tif (WaitTimer<0)\n+\t\t\t\t\t\t{\n+\t\t\t\t\t\t\t\tWaitTimer=0;\n+\t\t\t\t\t\t}\t\t\n+\t\t\t\t}\n+\n \t\t\t\tif (Frozen)\n \t\t\t\t{//NPC will not move until timer is complete.\n \t\t\t\t\t\tif (FrozenUpdate==0)\n \t\t\t\t\t\t{\n-\t\t\t\t\t\t\t\t//anim.enabled=false;\n \t\t\t\t\t\t\t\tnewAnim.enabled=false;\n \t\t\t\t\t\t}\n \t\t\t\t\t\telse\n@@ -470,309 +480,294 @@ public class NPC : MobileObject {\n \t\t\t\t\t\t}\n \t\t\t\t}\n \n-\n \t\t\t\tif (NPC_DEAD==true)\n \t\t\t\t{//Set the AI death state\n \t\t\t\t\t\t//Update the appearance of the NPC\n \t\t\t\t\t\tUpdateSprite();\n \t\t\t\t\t\tAI_INIT();\n-\t\t\t\t\t\tai.AI.WorkingMemory.SetItem<int>("state",AI_STATE_DYING);//Set to death state.\n-\t\t\t\t\t\treturn;\n-\t\t\t\t}\n-\t\t\t\t//if (anim==null)\n-\t\t\t\t//{\n-\t\t\t\t//\tanim=GetComponentInChildren<Animator>();\n-\t\t\t\t//}\n-\n-\t\t\t\t//The AI is only active when the player is within a certain distance to the player camera.\n-\t\t\t\tif (Vector3.Distance(this.transform.position, UWCharacter.Instance.CameraPos)<=8)\n-\t\t\t\t{\n-\t\t\t\t\t\tif (objInt()!=null)\n-\t\t\t\t\t\t{\n-\t\t\t\t\t\t\t\tAI_INIT ();\n-\t\t\t\t\t\t\t\tai.AI.IsActive= Vector3.Distance(this.transform.position, UWCharacter.Instance.CameraPos)<=8;\n-\t\t\t\t\t\t\t\t//anim.enabled=true;\t\t\n-\t\t\t\t\t\t\t\t//anim.enabled=false;\t\t\n-\t\t\t\t\t\t\t\tnewAnim.enabled=true;\n-\t\t\t\t\t\t}\t\t\t\t\t\t\t\n-\t\t\t\t}\n-\t\t\t\telse\n-\t\t\t\t{\n-\t\t\t\t\t\tif (ai!=null)\n+\t\t\t\t\t\t//ai.AI.WorkingMemory.SetItem<int>("state",AI_STATE_DYING);//Set to death state.\n+\t\t\t\t\t\tif (WaitTimer<=0)\n \t\t\t\t\t\t{\n-\t\t\t\t\t\t\t\tai.AI.IsActive=false;\n+\t\t\t\t\t\t\t\tDumpRemains();\n \t\t\t\t\t\t}\n-\t\t\t\t\t\t//if (anim!=null)\n-\t\t\t\t\t\t//{\n-\t\t\t\t\t\t//\tanim.enabled=false;\t\t\n-\n-\t\t\t\t\t\t//}\n-\t\t\t\t\t\tnewAnim.enabled=false;\n \t\t\t\t\t\treturn;\n \t\t\t\t}\n \n-\t\t\t\t//Decide what attack modes to use\n-\t\t\t\tswitch (_RES)\n-\t\t\t\t{\n-\t\t\t\tcase GAME_UW2:\n-\t\t\t\t\t\t{\n-\t\t\t\t\t\t\t\tai.AI.WorkingMemory.SetItem<int>("attackMode",0);\t//Melee attack\n-\t\t\t\t\t\t\t\tbreak;\t\n-\t\t\t\t\t\t}\n-\t\t\t\tdefault:\n-\t\t\t\t\t\t{\n-\t\t\t\t\t\t\t\tswitch (_objInt.item_id)\n-\t\t\t\t\t\t\t\t{\n-\t\t\t\t\t\t\t\t//Uses ranged weapons\n-\t\t\t\t\t\t\t\tcase 70:\n-\t\t\t\t\t\t\t\tcase 76:\n-\t\t\t\t\t\t\t\tcase 77:\n-\t\t\t\t\t\t\t\tcase 78:\n-\t\t\t\t\t\t\t\t\t\tif (\n-\t\t\t\t\t\t\t\t\t\t\t\t(Vector3.Distance(this.transform.position, UWCharacter.Instance.transform.position)>=2) \n-\t\t\t\t\t\t\t\t\t\t\t\t&&\n-\t\t\t\t\t\t\t\t\t\t\t\t(Vector3.Distance(this.transform.position, UWCharacter.Instance.transform.position)<=8) \n-\t\t\t\t\t\t\t\t\t\t\t\t&&\n-\t\t\t\t\t\t\t\t\t\t\t\t(Ammo>0)\n-\t\t\t\t\t\t\t\t\t\t)\n-\t\t\t\t\t\t\t\t\t\t{//Ranged attack if far away( but not too far away)\n-\t\t\t\t\t\t\t\t\t\t\t\tai.AI.WorkingMemory.SetItem<int>("attackMode",1);\t\n-\t\t\t\t\t\t\t\t\t\t}\n-\t\t\t\t\t\t\t\t\t\telse\n-\t\t\t\t\t\t\t\t\t\t{\n-\t\t\t\t\t\t\t\t\t\t\t\tai.AI.WorkingMemory.SetItem<int>("attackMode",0);\t\t\n-\t\t\t\t\t\t\t\t\t\t}\n-\t\t\t\t\t\t\t\t\t\tbreak;\n-\t\t\t\t\t\t\t\t\t\t//Uses magic attacks when not very near\n-\t\t\t\t\t\t\t\tcase 75:\n-\t\t\t\t\t\t\t\tcase 81:\n-\t\t\t\t\t\t\t\tcase 106:\n-\t\t\t\t\t\t\t\tcase 107:\n-\t\t\t\t\t\t\t\tcase 108:\n-\t\t\t\t\t\t\t\tcase 109:\n-\t\t\t\t\t\t\t\tcase 115:\n-\t\t\t\t\t\t\t\tcase 120://fire elemental\n-\t\t\t\t\t\t\t\tcase 122:\n-\t\t\t\t\t\t\t\tcase 123:\t//tybal\t\t\t\t\t\n-\t\t\t\t\t\t\t\t\t\tif (\n-\t\t\t\t\t\t\t\t\t\t\t\t(Vector3.Distance(this.transform.position, UWCharacter.Instance.transform.position)>=2) \n-\t\t\t\t\t\t\t\t\t\t\t\t&&\n-\t\t\t\t\t\t\t\t\t\t\t\t(Vector3.Distance(this.transform.position, UWCharacter.Instance.transform.position)<=8) \n-\t\t\t\t\t\t\t\t\t\t)\n-\t\t\t\t\t\t\t\t\t\t{//Ranged attack if far away (but not too far)\n-\t\t\t\t\t\t\t\t\t\t\t\tai.AI.WorkingMemory.SetItem<int>("attackMode",2);\t\n-\t\t\t\t\t\t\t\t\t\t\t\t//SpellIndex= SpellEffect.UW1_Spell_Effect_MagicArrow_alt01;//Magic arrow for the moment..\n-\t\t\t\t\t\t\t\t\t\t}\n-\t\t\t\t\t\t\t\t\t\telse\n-\t\t\t\t\t\t\t\t\t\t{\n-\t\t\t\t\t\t\t\t\t\t\t\tai.AI.WorkingMemory.SetItem<int>("attackMode",0);\t\t\n-\t\t\t\t\t\t\t\t\t\t}\n-\t\t\t\t\t\t\t\t\t\tbreak;\n-\t\t\t\t\t\t\t\tdefault:\n-\t\t\t\t\t\t\t\t\t\tai.AI.WorkingMemory.SetItem<int>("attackMode",0);\t//Melee attack\n-\t\t\t\t\t\t\t\t\t\tbreak;\n-\t\t\t\t\t\t\t\t}\n-\t\t\t\t\t\t\t\tbreak;\n-\t\t\t\t\t\t}\n-\t\t\t\t}\n+\n+\t\t\t\tUpdateNPCAWake ();\n \n \n \t\t\t\t//Update the appearance of the NPC\n \t\t\t\tUpdateSprite();\n \n-\t\t\t\t//Update GTarg\n-\t\t\t\tif (npc_gtarg<=1)//PC\n-\t\t\t\t{\n-\t\t\t\t\t\tgtargName="_Gronk";\n-\t\t\t\t\t\tif (gtarg==null)\n-\t\t\t\t\t\t{\n-\t\t\t\t\t\t\t\tgtarg=UWCharacter.Instance.transform.gameObject;\t\t\t\t\n-\t\t\t\t\t\t}\n-\t\t\t\t\t\telse\n-\t\t\t\t\t\t{\n-\t\t\t\t\t\t\t\tif (gtarg.name!="_Gronk")\n-\t\t\t\t\t\t\t\t{\n-\t\t\t\t\t\t\t\t\t\tgtarg=UWCharacter.Instance.transform.gameObject;\t\n-\t\t\t\t\t\t\t\t}\n-\t\t\t\t\t\t}\n+\t\t\t\t//Update the Goal Target of the NPC\n+\t\t\t\tUpdateGTarg ();\n+\n+\t\t\t\t//if (ai!=null)\n+\t\t\t\t//{\n+\t\t\t\t//\t\tif (ai.AI.Navigator.CurrentPath!=null)\n+\t\t\t\t//\t\t{//Turns the AI around on their route.\n+\t\t\t\t//\t\t\t\tVector3 NextPosition = ai.AI.Navigator.CurrentPath.GetWaypointPosition(ai.AI.Navigator.NextWaypoint);\n+\t\t\t\t//\t\t\t\tNextPosition.y= this.transform.position.y;//AI is kept level.\n+\t\t\t\t//\t\t\t\tai.AI.WorkingMemory.SetItem<Vector3>("RotateTowards",NextPosition);\n+\t\t\t\t//\t\t}\n+\t\t\t\t//}\n+\t\t\t\tif ((npc_hp<=0))\n+\t\t\t\t{//Begin death handling.\n+\t\t\t\t\t\tOnDeath();\n \t\t\t\t}\n \t\t\t\telse\n \t\t\t\t{\n-\t\t\t\t\t\t//Inbuilt NPC Gtargs not supported.\n+\t\t\t\t\t\tUpdateGoals ();\n+\t\t\t\t}\t\n+\n+\t\t}\n+\n+\tvoid UpdateNPCAWake ()\n+\t{\n+\t\t//The AI is only active when the player is within a certain distance to the player camera.\n+\t\tif (Vector3.Distance (this.transform.position, UWCharacter.Instance.CameraPos) <= 8) {\n+\t\t\tif (objInt () != null) {\n+\t\t\t\tAI_INIT ();\n+\t\t\t\t//ai.AI.IsActive = Vector3.Distance (this.transform.position, UWCharacter.Instance.CameraPos) <= 8;\n+\t\t\t\tnewAnim.enabled = true;\n+\t\t\t}\n+\t\t}\n+\t\telse {\n+\t\t\t//if (ai != null) {\n+\t\t\t//\tai.AI.IsActive = false;\n+\t\t\t//}\n+\t\t\tnewAnim.enabled = false;\n+\t\t\treturn;\n+\t\t}\n+\t}\n \n-\t\t\t\t\t\tif (gtarg==null)\n+\tvoid UpdateGoals ()\n+\t{\n+\t\tif (Agent==null){return;}\n+\t\t//If the player comes close and I\'m hostile. Make sure I go to combat mode.\n+\t\tif ((npc_attitude == 0) && (Vector3.Distance (this.transform.position, UWCharacter.Instance.transform.position) <= UWCharacter.Instance.DetectionRange)) {\n+\t\t\tnpc_goal = (short)npc_goals.npc_goal_attack_5;\n+\t\t\t//Attack player\n+\t\t\tnpc_gtarg = 1;\n+\t\t}\n+\t\tswitch (npc_goal) \n+\t\t\t\t{\n+\t\t\t\tcase (short)npc_goals.npc_goal_want_to_talk:\n+\t\t\t\t\t{\n+\t\t\t\t\t\t//I just want to talk to you\n+\t\t\t\t\t\t//ai.AI.WorkingMemory.SetItem<int> ("state", AI_STATE_STANDING);\n+\t\t\t\t\t\tAnimRange= NPC.AI_RANGE_IDLE;\n+\t\t\t\t\t\tif ((UWCharacter.Instance.isRoaming == false) && (ConversationVM.InConversation == false)) \n \t\t\t\t\t\t{\n-\t\t\t\t\t\t\t\tif (gtargName!="")\n+\t\t\t\t\t\t\t\tif (Vector3.Distance (this.transform.position, UWCharacter.Instance.CameraPos) <= 1.5) \n \t\t\t\t\t\t\t\t{\n-\t\t\t\t\t\t\t\t\t\tgtarg=GameObject.Find(gtargName);\n-\t\t\t\t\t\t\t\t}\t\t\t\t\t\t\t\t\n+\t\t\t\t\t\t\t\t\t\tTalkTo ();\n+\t\t\t\t\t\t\t\t}\n+\t\t\t\t\t\t}\t\n+\t\t\t\t\t\tbreak;\n+\t\t\t\t\t}\n+\n+\t\t\t\n+\t\tcase (short)npc_goals.npc_goal_stand_still_0:\n+\t\t//Standing still\n+\t\tcase (short)npc_goals.npc_goal_stand_still_7:\n+\t\tcase (short)npc_goals.npc_goal_stand_still_11:\n+\t\tcase (short)npc_goals.npc_goal_stand_still_12:\n+\t\t\t\t\t\t{\n+\t\t\t\t\t\t\t\tAnimRange= NPC.AI_RANGE_IDLE;\n+\t\t\t\t\t\t\t\tbreak;\n \t\t\t\t\t\t}\n-\t\t\t\t\t\telse\n+\t\t\t//ai.AI.WorkingMemory.SetItem<int> ("state", AI_STATE_STANDING);\n+\t\t\t//break;\n+\t\tcase (short)npc_goals.npc_goal_wander_1://Wander randomly\t\t\n+\t\tcase (short)npc_goals.npc_goal_wander_2:\n+\t\tcase (short)npc_goals.npc_goal_wander_4:\n+\t\tcase (short)npc_goals.npc_goal_wander_8:\n+\t\t\t//ai.AI.WorkingMemory.SetItem<int> ("state", AI_STATE_IDLERANDOM);\n \t\t\t\t\t\t{\n-\t\t\t\t\t\t\t\tif (gtarg.name!=gtargName)\n+\t\t\t\t\t\t\t\tint tileX = (int)(transform.position.x/1.2f);\n+\t\t\t\t\t\t\t\tint tileY = (int)(transform.position.z/1.2f);\n+\t\t\t\t\t\t\t\tif (WaitTimer <=0)\n \t\t\t\t\t\t\t\t{\n-\t\t\t\t\t\t\t\t\t\tgtarg=GameObject.Find(gtargName);\t\n+\t\t\t\t\t\t\t\t\tSetRandomDestination();\n \t\t\t\t\t\t\t\t}\n-\t\t\t\t\t\t}\n-\t\t\t\t\t\tif(gtarg==null)\n-\t\t\t\t\t\t{//I no longer have a goal. Check what I was doing and revert to a different state.\n-\t\t\t\t\t\t\t\t//Cases\n-\n-\t\t\t\t\t\t\t\tif ((npc_attitude>0) && (gtargName!="") && ((npc_goal==(short)npc_goals.npc_goal_attack_5) || (npc_goal==(short)npc_goals.npc_goal_attack_9)))\n-\t\t\t\t\t\t\t\t{//NPC Follower who has killed their target->Follow player.\n-\t\t\t\t\t\t\t\t\t\tnpc_goal=(short)npc_goals.npc_goal_follow;\n-\t\t\t\t\t\t\t\t\t\tnpc_gtarg=1;\n-\t\t\t\t\t\t\t\t\t\tgtarg=UWCharacter.Instance.transform.gameObject;\n+\t\t\t\t\t\t\t\tif ((DestTileX!=tileX) && (DestTileY != tileY))\n+\t\t\t\t\t\t\t\t{//I need to move to this tile.\n+\t\t\t\t\t\t\t\t\t\tAnimRange= NPC.AI_RANGE_MOVE;\n+\t\t\t\t\t\t\t\t\t\tAgent.destination= GameWorldController.instance.currentTileMap().getTileVector(DestTileX, DestTileY);\n+\t\t\t\t\t\t\t\t\t\tAgent.isStopped=false;\n \t\t\t\t\t\t\t\t}\n-\n-\t\t\t\t\t\t\t\tif ((npc_attitude==0) && (gtargName!="") && ((npc_goal==(short)npc_goals.npc_goal_attack_5) || (npc_goal==(short)npc_goals.npc_goal_attack_9)))\n-\t\t\t\t\t\t\t\t{//NPC Enemy who has defeated their attacker->Focus on player.\n-\t\t\t\t\t\t\t\t\t\tnpc_goal=(short)npc_goals.npc_goal_attack_5;\n-\t\t\t\t\t\t\t\t\t\tnpc_gtarg=1;\t\n-\t\t\t\t\t\t\t\t\t\tgtarg=UWCharacter.Instance.transform.gameObject;\n+\t\t\t\t\t\t\t\telse\n+\t\t\t\t\t\t\t\t{//I am at this tile. Stand idle for a random period of time\n+\t\t\t\t\t\t\t\t\tAnimRange= NPC.AI_RANGE_IDLE;\t\n+\t\t\t\t\t\t\t\t\tif (WaitTimer==0)\n+\t\t\t\t\t\t\t\t\t{\n+\t\t\t\t\t\t\t\t\t\t\tWaitTimer = Random.Range(1f,10f);\t\t\t\n+\t\t\t\t\t\t\t\t\t}\n+\t\t\t\t\t\t\t\t\t\n \t\t\t\t\t\t\t\t}\n+\t\t\t\t\t\t\t\tbreak;\n \t\t\t\t\t\t}\n-\n-\t\t\t\t}\n-\n-\t\t\t\tif (ai.AI.Navigator.CurrentPath!=null)\n-\t\t\t\t{//Turns the AI around on their route.\n-\t\t\t\t\t\tVector3 NextPosition = ai.AI.Navigator.CurrentPath.GetWaypointPosition(ai.AI.Navigator.NextWaypoint);\n-\t\t\t\t\t\tNextPosition.y= this.transform.position.y;//AI is kept level.\n-\t\t\t\t\t\tai.AI.WorkingMemory.SetItem<Vector3>("RotateTowards",NextPosition);\n-\t\t\t\t}\n-\t\t\t\tif ((npc_hp<=0))\n-\t\t\t\t{//Begin death handling.\n-\t\t\t\t\t\tOnDeath();\n-\t\t\t\t}\n-\t\t\t\telse\n-\t\t\t\t{\n-\t\t\t\t\t\t//If the player comes close and I\'m hostile. Make sure I go to combat mode.\n-\t\t\t\t\t\tif ((npc_attitude==0) && (Vector3.Distance(this.transform.position, UWCharacter.Instance.transform.position)<=UWCharacter.Instance.DetectionRange))\t\t\n-\t\t\t\t\t\t{\n-\t\t\t\t\t\t\t\tnpc_goal=(short)npc_goals.npc_goal_attack_5;\t//Attack player\n-\t\t\t\t\t\t\t\tnpc_gtarg=1;\n-\t\t\t\t\t\t}\n-\t\t\t\t\t\tswitch (npc_goal)\n+\t\t\t\n+\t\tcase (short)npc_goals.npc_goal_attack_5://Attack target\t\t\n+\t\tcase (short)npc_goals.npc_goal_attack_9:\n \t\t\t\t\t\t{\n-\t\t\t\t\t\tcase (short)npc_goals.npc_goal_want_to_talk://I just want to talk to you\n-\t\t\t\t\t\t\t\tai.AI.WorkingMemory.SetItem<int>("state",AI_STATE_STANDING);\n-\t\t\t\t\t\t\t\tif ((UWCharacter.Instance.isRoaming==false) \n-\t\t\t\t\t\t\t\t\t\t&& (ConversationVM.InConversation==false))\n+\t\t\t\t\t\t\t//ai.AI.WorkingMemory.SetItem<int> ("state", AI_STATE_COMBAT);\n+\t\t\t\t\t\t\t\n+\t\t\t\t\t\t\t//Set to combat state.\n+\t\t\t\t\t\t\tif (Room () == UWCharacter.Instance.room) \n \t\t\t\t\t\t\t\t{\n-\t\t\t\t\t\t\t\t\t\tif (Vector3.Distance(this.transform.position, UWCharacter.Instance.CameraPos)<=1.5)\t\n-\t\t\t\t\t\t\t\t\t\t{\n-\t\t\t\t\t\t\t\t\t\t\t\tTalkTo();\n-\t\t\t\t\t\t\t\t\t\t}\t\n-\t\t\t\t\t\t\t\t}\n-\t\t\t\t\t\t\t\tbreak;\n-\t\t\t\t\t\tcase  (short)npc_goals.npc_goal_stand_still_0://Standing still\n-\t\t\t\t\t\tcase  (short)npc_goals.npc_goal_stand_still_7:\n-\t\t\t\t\t\tcase  (short)npc_goals.npc_goal_stand_still_11:\n-\t\t\t\t\t\tcase  (short)npc_goals.npc_goal_stand_still_12:\n-\t\t\t\t\t\t\t\tai.AI.WorkingMemory.SetItem<int>("state",AI_STATE_STANDING);\n-\t\t\t\t\t\t\t\tbreak;\n+\t\t\t\t\t\t\t\t\tVector3 AB = this.transform.position - gtarg.transform.position;\n+\t\t\t\t\t\t\t\t\tif (AB.magnitude > 1f) \n+\t\t\t\t\t\t\t\t\t\t{//AI needs to move into combat range\n+\t\t\t\t\t\t\t\t\t\t\t//Vector3 Movepos = gtarg.transform.position;\n+\t\t\t\t\t\t\t\t\t\t\t\t//if (AB.magnitude >3f)\n+\t\t\t\t\t\t\t\t\t\t\t\t//{\n+\t\t\t\t\t\t\t\t\t\t\t\t\t\tAnimRange=NPC.AI_RANGE_MOVE;\n \n-\t\t\t\t\t\tcase (short)npc_goals.npc_goal_wander_1://Wander randomly\n-\t\t\t\t\t\tcase (short)npc_goals.npc_goal_wander_2:\n-\t\t\t\t\t\tcase (short)npc_goals.npc_goal_wander_4:\n-\t\t\t\t\t\tcase (short)npc_goals.npc_goal_wander_8:\n-\t\t\t\t\t\t\t\tai.AI.WorkingMemory.SetItem<int>("state",AI_STATE_IDLERANDOM);\t\t\t\t\t\t\n-\t\t\t\t\t\t\t\tbreak;\n+\t\t\t\t\t\t\t\t\t\t\t\t//}\n+\t\t\t\t\t\t\t\t\t\t\t\t//else\n+\t\t\t\t\t\t\t\t\t\t\t\t//{\n+\t\t\t\t\t\t\t\t\t\t\t\t//\t\tAnimRange=NPC.AI_ANIM_COMBAT_IDLE;\t\t\t\n+\t\t\t\t\t\t\t\t\t\t\t\t//}\n \n-\t\t\t\t\t\tcase (short)npc_goals.npc_goal_attack_5://Attack target\n-\t\t\t\t\t\tcase (short)npc_goals.npc_goal_attack_9:\n-\t\t\t\t\t\t\t\tai.AI.WorkingMemory.SetItem<int>("state",AI_STATE_COMBAT);//Set to combat state.\n-\t\t\t\t\t\t\t\tif (Room()==UWCharacter.Instance.room)\n-\t\t\t\t\t\t\t\t{\n-\t\t\t\t\t\t\t\t\t\tVector3 AB = this.transform.position - gtarg.transform.position;\n-\t\t\t\t\t\t\t\t\t\tif(AB.magnitude>1f)\n-\t\t\t\t\t\t\t\t\t\t{\n-\t\t\t\t\t\t\t\t\t\t\t\tVector3 Movepos = gtarg.transform.position; //;+ (AB.normalized) ;\n-\t\t\t\t\t\t\t\t\t\t\t\tai.AI.WorkingMemory.SetItem<Vector3>("MoveTarget",Movepos);\t\t\n+\t\t\t\t\t\t\t\t\t\t\t\n+\t\t\t\t\t\t\t\t\t\t\t//;+ (AB.normalized) ;\n+\t\t\t\t\t\t\t\t\t\t\t//ai.AI.WorkingMemory.SetItem<Vector3> ("MoveTarget", Movepos);\n+\t\t\t\t\t\t\t\t\t\t\t\tAgent.destination=gtarg.transform.position;\n+\t\t\t\t\t\t\t\t\t\t\t\tAgent.isStopped=false;\n \t\t\t\t\t\t\t\t\t\t}\n-\t\t\t\t\t\t\t\t\t\telse\n-\t\t\t\t\t\t\t\t\t\t{\n-\t\t\t\t\t\t\t\t\t\t\t\tai.AI.WorkingMemory.SetItem<Vector3>("MoveTarget",this.transform.position);\t\n+\t\t\t\t\t\t\t\t\telse \n+\t\t\t\t\t\t\t\t\t\t{//AI is in range. Check if they are ready to execute an attack\n+\t\t\t\t\t\t\t\t\t\t\t//ai.AI.WorkingMemory.SetItem<Vector3> ("MoveTarget", this.transform.position);\n+\t\t\t\t\t\t\t\t\t\t\t\tAgent.destination=this.transform.position;\n+\t\t\t\t\t\t\t\t\t\t\t\tAgent.isStopped=true;\n+\t\t\t\t\t\t\t\t\t\t\t\t//transform.LookAt(gtarg.transform.position);\n+\t\t\t\t\t\t\t\t\t\t\t\ttransform.rotation = Quaternion.LookRotation(UWCharacter.Instance.dirForNPC);\n+\t\t\t\t\t\t\t\t\t\t\t\tif (WaitTimer <= 0f)\n+\t\t\t\t\t\t\t\t\t\t\t\t{//Init the attack anim\n+\t\t\t\t\t\t\t\t\t\t\t\t\t\tSetRandomAttack();\t\n+\t\t\t\t\t\t\t\t\t\t\t\t\t\tWaitTimer = 4f;\n+\t\t\t\t\t\t\t\t\t\t\t\t}\n+\t\t\t\t\t\t\t\t\t\t\t\telse if ((WaitTimer<=3.6) && (WaitTimer>3))\n+\t\t\t\t\t\t\t\t\t\t\t\t{\n+\t\t\t\t\t\t\t\t\t\t\t\t\t\tExecuteAttack();\n+\t\t\t\t\t\t\t\t\t\t\t\t\t\tWaitTimer =2f;\n+\t\t\t\t\t\t\t\t\t\t\t\t}\n+\t\t\t\t\t\t\t\t\t\t\t\telse if (WaitTimer <=1.6f)\n+\t\t\t\t\t\t\t\t\t\t\t\t{\n+\t\t\t\t\t\t\t\t\t\t\t\t\tAnimRange=NPC.AI_ANIM_COMBAT_IDLE;\n+\t\t\t\t\t\t\t\t\t\t\t\t\t//Wait out till the next attack\t\n+\t\t\t\t\t\t\t\t\t\t\t\t}\n \t\t\t\t\t\t\t\t\t\t}\n-\n-\t\t\t\t\t\t\t\t\t\t//Vector3 Movepos = gtarg.transform.position + (0.10f * AB.normalized) ;\n-\n+\t\t\t\t\t\t\t}\n+\t\t\t\t\t\t\telse \n+\t\t\t\t\t\t\t\t{\n+\t\t\t\t\t\t\t\t\t//AI won\'t move to player position if they are in a different "room"\n+\t\t\t\t\t\t\t\t\t//ai.AI.WorkingMemory.SetItem<Vector3> ("MoveTarget", this.transform.position);\n+\t\t\t\t\t\t\t\t\t\tAgent.destination=this.transform.position;\n+\t\t\t\t\t\t\t\t\t\tAgent.isStopped=true;\n \t\t\t\t\t\t\t\t}\n-\t\t\t\t\t\t\t\telse\n-\t\t\t\t\t\t\t\t{\t\t//AI won\'t move to player position if they are in a different "room"\n-\t\t\t\t\t\t\t\t\t\tai.AI.WorkingMemory.SetItem<Vector3>("MoveTarget",this.transform.position);\t\n-\t\t\t\t\t\t\t\t}\t\n-\t\t\t\t\t\t\t\tbreak;\n+\t\t\t\t\t\t\tbreak;\n \n-\t\t\t\t\t\tcase (short)npc_goals.npc_goal_flee://Run away (morale failure)\n-\t\t\t\t\t\t\t\tai.AI.WorkingMemory.SetItem<int>("state",AI_STATE_FLEE);//Set to idle\n-\t\t\t\t\t\t\t\tbreak;\n+\t\t\t\t\t\t}\n \n-\t\t\t\t\t\tcase (short)npc_goals.npc_goal_follow://Follow target\n+\t\tcase (short)npc_goals.npc_goal_flee:\n+\t\t\t\t\t\t{\n+\t\t\t\t\t\t\t\t//Run away (morale failure)\n+\t\t\t\t\t\t\t\t//ai.AI.WorkingMemory.SetItem<int> ("state", AI_STATE_FLEE);\n+\t\t\t\t\t\t\t\t//TODO:get destination\n+\t\t\t\t\t\t\t\t//Set to idle\n+\t\t\t\t\t\t\t\tbreak;\t\n+\t\t\t\t\t\t}\n \n-\t\t\t\t\t\t\t\tif (gtarg!=null)\n-\t\t\t\t\t\t\t\t{\n-\t\t\t\t\t\t\t\t\t\tVector3 ABf =this.transform.position - gtarg.transform.position;\n-\t\t\t\t\t\t\t\t\t\tVector3 MoveposF = gtarg.transform.position + (0.9f * ABf.normalized) ;\n-\t\t\t\t\t\t\t\t\t\tai.AI.WorkingMemory.SetItem<Vector3>("MoveTarget",MoveposF);\n-\t\t\t\t\t\t\t\t\t\tai.AI.WorkingMemory.SetItem<int>("state",AI_STATE_FOLLOW);//Set to idle\t\t\t\t\t\t\t\t\t\t\n-\n-\t\t\t\t\t\t\t\t\t\tif (gtarg.name=="_Gronk")\n-\t\t\t\t\t\t\t\t\t\t{//Help out the player dynamically\n-\t\t\t\t\t\t\t\t\t\t\t\tif (UWCharacter.Instance.HelpMeMyFriends==true)\n-\t\t\t\t\t\t\t\t\t\t\t\t{\n-\t\t\t\t\t\t\t\t\t\t\t\t\t\tUWCharacter.Instance.HelpMeMyFriends=false;\n+\t\tcase (short)npc_goals.npc_goal_follow:\n+\t\t\t\t\t\t{\n+\t\t\t\t\t\t\t\t//Follow target\n+\t\t\t\t\t\t\t\tif (gtarg != null) {\n+\t\t\t\t\t\t\t\t\t\tVector3 ABf = this.transform.position - gtarg.transform.position;\n+\t\t\t\t\t\t\t\t\t\tVector3 Movepos = gtarg.transform.position + (0.9f * ABf.normalized);\n+\t\t\t\t\t\t\t\t\t\tAgent.destination=Movepos;\n+\t\t\t\t\t\t\t\t\t\tAgent.isStopped=false;\n+\t\t\t\t\t\t\t\t\t\t//ai.AI.WorkingMemory.SetItem<Vector3> ("MoveTarget", MoveposF);\n+\t\t\t\t\t\t\t\t\t\t//ai.AI.WorkingMemory.SetItem<int> ("state", AI_STATE_FOLLOW);\n+\t\t\t\t\t\t\t\t\t\t//Set to idle\t\t\t\t\t\t\t\t\t\t\n+\t\t\t\t\t\t\t\t\t\tif (gtarg.name == "_Gronk") {\n+\t\t\t\t\t\t\t\t\t\t\t\t//Help out the player dynamically\n+\t\t\t\t\t\t\t\t\t\t\t\tif (UWCharacter.Instance.HelpMeMyFriends == true) {\n+\t\t\t\t\t\t\t\t\t\t\t\t\t\tUWCharacter.Instance.HelpMeMyFriends = false;\n \t\t\t\t\t\t\t\t\t\t\t\t\t\t//If I\'m not already busy with another NPC\n-\t\t\t\t\t\t\t\t\t\t\t\t\t\tif(UWCharacter.Instance.LastEnemyToHitMe!=null)\n+\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (UWCharacter.Instance.LastEnemyToHitMe != null) \n \t\t\t\t\t\t\t\t\t\t\t\t\t\t{\n-\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tgtarg=UWCharacter.Instance.LastEnemyToHitMe;\n-\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tnpc_goal=(short)npc_goals.npc_goal_attack_5;\n-\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tnpc_gtarg=(short)UWCharacter.Instance.LastEnemyToHitMe.GetComponent<ObjectInteraction>().objectloaderinfo.index;\n-\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tgtargName=UWCharacter.Instance.LastEnemyToHitMe.name;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n+\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tgtarg = UWCharacter.Instance.LastEnemyToHitMe;\n+\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tnpc_goal = (short)npc_goals.npc_goal_attack_5;\n+\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tnpc_gtarg = (short)UWCharacter.Instance.LastEnemyToHitMe.GetComponent<ObjectInteraction> ().objectloaderinfo.index;\n+\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tgtargName = UWCharacter.Instance.LastEnemyToHitMe.name;\n \t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n \t\t\t\t\t\t\t\t\t\t\t\t}\n-\t\t\t\t\t\t\t\t\t\t\t\tif ((_RES==GAME_UW1) && (GameWorldController.instance.LevelNo==8))\n-\t\t\t\t\t\t\t\t\t\t\t\t{//slasher of veils in the void needs to get rowdy.\n-\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (objInt().item_id==124)\n-\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\n-\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tnpc_goal=(short)npc_goals.npc_goal_attack_5;\n-\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tgtarg=UWCharacter.Instance.gameObject;\n+\t\t\t\t\t\t\t\t\t\t\t\tif ((_RES == GAME_UW1) && (GameWorldController.instance.LevelNo == 8)) \n+\t\t\t\t\t\t\t\t\t\t\t\t{\n+\t\t\t\t\t\t\t\t\t\t\t\t\t\t//slasher of veils in the void needs to get rowdy.\n+\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (objInt ().item_id == 124) {\n+\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tnpc_goal = (short)npc_goals.npc_goal_attack_5;\n+\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tgtarg = UWCharacter.Instance.gameObject;\n \t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n \t\t\t\t\t\t\t\t\t\t\t\t}\n-\n \t\t\t\t\t\t\t\t\t\t}\n \t\t\t\t\t\t\t\t}\n \t\t\t\t\t\t\t\tbreak;\n \n \t\t\t\t\t\t}\n-\t\t\t\t}\n+\n \t\t}\n+\t}\n \n-\t\t/*\n-\t\tpublic void LateUpdate()\n-\t\t{\n-\t\t\t\treturn;\n-\t\t\t\tif (GameWorldController.instance.critsLoader[NPC_IDi-64]==null)\n-\t\t\t{\n-\t\t\t\t\treturn;\n+\tvoid UpdateGTarg ()\n+\t{\n+\t\t//Update GTarg\n+\t\tif (npc_gtarg <= 1)//PC\n+\t\t {\n+\t\t\tgtargName = "_Gronk";\n+\t\t\tif (gtarg == null) {\n+\t\t\t\tgtarg = UWCharacter.Instance.transform.gameObject;\n \t\t\t}\n-\t\t\tif (sprt==null)\n-\t\t\t{\n-\t\t\t\tsprt=this.GetComponentInChildren<SpriteRenderer>();\t\n+\t\t\telse {\n+\t\t\t\tif (gtarg.name != "_Gronk") {\n+\t\t\t\t\tgtarg = UWCharacter.Instance.transform.gameObject;\n+\t\t\t\t}\n \t\t\t}\n-\t\t\t\tif (sprt.sprite==null)\n-\t\t\t\t{\n-\t\t\t\t\t\treturn;\n+\t\t}\n+\t\telse {\n+\t\t\t//Inbuilt NPC Gtargs not supported.\n+\t\t\tif (gtarg == null) {\n+\t\t\t\tif (gtargName != "") {\n+\t\t\t\t\tgtarg = GameObject.Find (gtargName);\n+\t\t\t\t}\n+\t\t\t}\n+\t\t\telse {\n+\t\t\t\tif (gtarg.name != gtargName) {\n+\t\t\t\t\tgtarg = GameObject.Find (gtargName);\n+\t\t\t\t}\n+\t\t\t}\n+\t\t\tif (gtarg == null) {\n+\t\t\t\t//I no longer have a goal. Check what I was doing and revert to a different state.\n+\t\t\t\t//Cases\n+\t\t\t\tif ((npc_attitude > 0) && (gtargName != "") && ((npc_goal == (short)npc_goals.npc_goal_attack_5) || (npc_goal == (short)npc_goals.npc_goal_attack_9))) {\n+\t\t\t\t\t//NPC Follower who has killed their target->Follow player.\n+\t\t\t\t\tnpc_goal = (short)npc_goals.npc_goal_follow;\n+\t\t\t\t\tnpc_gtarg = 1;\n+\t\t\t\t\tgtarg = UWCharacter.Instance.transform.gameObject;\n+\t\t\t\t}\n+\t\t\t\tif ((npc_attitude == 0) && (gtargName != "") && ((npc_goal == (short)npc_goals.npc_goal_attack_5) || (npc_goal == (short)npc_goals.npc_goal_attack_9))) {\n+\t\t\t\t\t//NPC Enemy who has defeated their attacker->Focus on player.\n+\t\t\t\t\tnpc_goal = (short)npc_goals.npc_goal_attack_5;\n+\t\t\t\t\tnpc_gtarg = 1;\n+\t\t\t\t\tgtarg = UWCharacter.Instance.transform.gameObject;\n \t\t\t\t}\n-\t\t\tif(CurrentSpriteName != sprt.sprite.name)\n-\t\t\t{\n-\t\t\t\tCurrentSpriteName= sprt.sprite.name;\n-\t\t\t\tcurrentSpriteLoaded= GameWorldController.instance.critsLoader[NPC_IDi-64].RetrieveSpriteByName(CurrentSpriteName, CritterInfo.TranslateAnimToIndex(CritterInfo.TranslateAnimRangeToAnim(curranim)));\n \t\t\t}\n-\t\t\tsprt.sprite=currentSpriteLoaded;\n \t\t}\n-\t*/\n+\t}\n \n \t\t/// <summary>\n \t\t/// Applies the attack to the NPC\n@@ -824,11 +819,6 @@ public class NPC : MobileObject {\n \t\t\t\t\t\t\t\t\t\tif (Col.gameObject.GetComponent<NPC>()!=null)\n \t\t\t\t\t\t\t\t\t\t{\n \t\t\t\t\t\t\t\t\t\t\t\tif (AreNPCSAllied(this,Col.gameObject.GetComponent<NPC>()))\n-\t\t\t\t\t\t\t\t\t\t\t\t\t\t//if (\n-\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\t(AreNPCSAllied(this,Col.gameObject.GetComponent<NPC>()))\t\n-\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\t||\n-\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\t(AreNPCSAllied(Col.gameObject.GetComponent<NPC>(),this))\t\n-\t\t\t\t\t\t\t\t\t\t\t\t\t\t//)\n \t\t\t\t\t\t\t\t\t\t\t\t{\n \t\t\t\t\t\t\t\t\t\t\t\t\t\tCol.gameObject.GetComponent<NPC>().npc_attitude=0;//Make the npc angry with the player.\n \t\t\t\t\t\t\t\t\t\t\t\t\t\tCol.gameObject.GetComponent<NPC>().npc_gtarg=1;\n@@ -1050,50 +1040,50 @@ public class NPC : MobileObject {\n \t\t\t\t\t\t}\n \t\t\t\tcase AI_ANIM_WALKING_FRONT:\n \t\t\t\t\t\t{\t\n-\t\t\t\t\t\t\t\tplayAnimation(22,true);\t\t\t\t\t\t\t\t\n+\t\t\t\t\t\t\t\tplayAnimation(22,false);\t\t\t\t\t\t\t\t\n \t\t\t\t\t\t\t\t//playAnimation(NPC_ID +"_walking_front",CalcedFacing);\n \t\t\t\t\t\t\t\tbreak;\n \t\t\t\t\t\t}\n \t\t\t\tcase AI_ANIM_WALKING_FRONT_RIGHT:\n \t\t\t\t\t\t{\t\n-\t\t\t\t\t\t\t\tplayAnimation(21,true);\n+\t\t\t\t\t\t\t\tplayAnimation(21,false);\n \t\t\t\t\t\t\t\t//\t\t\tplayAnimation(NPC_ID + "_walking_front_right",CalcedFacing);\n \t\t\t\t\t\t\t\tbreak;\n \t\t\t\t\t\t}\n \t\t\t\tcase AI_ANIM_WALKING_RIGHT:\n \t\t\t\t\t\t{\t\n \n-\t\t\t\t\t\t\t\tplayAnimation(20,true);\n+\t\t\t\t\t\t\t\tplayAnimation(20,false);\n \t\t\t\t\t\t\t\t//playAnimation(NPC_ID + "_walking_right",CalcedFacing);\n \t\t\t\t\t\t\t\tbreak;\n \t\t\t\t\t\t}\n \t\t\t\tcase AI_ANIM_WALKING_REAR_RIGHT:\n \t\t\t\t\t\t{\t\n-\t\t\t\t\t\t\t\tplayAnimation(19,true);\t\t\t\t\t\t\t\t\n+\t\t\t\t\t\t\t\tplayAnimation(19,false);\t\t\t\t\t\t\t\t\n \t\t\t\t\t\t\t\t//playAnimation(NPC_ID +"_walking_rear_right",CalcedFacing);\n \t\t\t\t\t\t\t\tbreak;\n \t\t\t\t\t\t}\n \t\t\t\tcase AI_ANIM_WALKING_REAR:\n \t\t\t\t\t\t{\t\n-\t\t\t\t\t\t\t\tplayAnimation(18,true);\t\t\t\t\t\t\t\t\n+\t\t\t\t\t\t\t\tplayAnimation(18,false);\t\t\t\t\t\t\t\t\n \t\t\t\t\t\t\t\t//playAnimation(NPC_ID +"_walking_rear",CalcedFacing);\n \t\t\t\t\t\t\t\tbreak;\n \t\t\t\t\t\t}\n \t\t\t\tcase  AI_ANIM_WALKING_REAR_LEFT:\n \t\t\t\t\t\t{\t\n-\t\t\t\t\t\t\t\tplayAnimation(25,true);\t\t\t\t\t\t\t\t\n+\t\t\t\t\t\t\t\tplayAnimation(25,false);\t\t\t\t\t\t\t\t\n \t\t\t\t\t\t\t\t//playAnimation(NPC_ID +"_walking_rear_left",CalcedFacing);\n \t\t\t\t\t\t\t\tbreak;\n \t\t\t\t\t\t}\n \t\t\t\tcase  AI_ANIM_WALKING_LEFT:\n \t\t\t\t\t\t{\t\n-\t\t\t\t\t\t\t\tplayAnimation(24,true);\t\t\t\t\t\t\t\t\n+\t\t\t\t\t\t\t\tplayAnimation(24,false);\t\t\t\t\t\t\t\t\n \t\t\t\t\t\t\t\t//playAnimation(NPC_ID + "_walking_left",CalcedFacing);\n \t\t\t\t\t\t\t\tbreak;\n \t\t\t\t\t\t}\n \t\t\t\tcase AI_ANIM_WALKING_FRONT_LEFT:\n \t\t\t\t\t\t{\t\n-\t\t\t\t\t\t\t\tplayAnimation(23,true);\t\t\t\t\t\t\t\t\n+\t\t\t\t\t\t\t\tplayAnimation(23,false);\t\t\t\t\t\t\t\t\n \t\t\t\t\t\t\t\t//playAnimation(NPC_ID + "_walking_front_left",CalcedFacing);\n \t\t\t\t\t\t\t\tbreak;\n \t\t\t\t\t\t}\n@@ -1197,29 +1187,6 @@ public class NPC : MobileObject {\n \t\t\t\tnewAnim.Play(index,isConstantAnim);\n \t\t}\n \n-\t\t/// <summary>\n-\t\t/// Checks if a new animation is needed and if so run it.\n-\t\t/// </summary>\n-\t\t/// <param name="pAnim">P animation.</param>\n-\t\t/// <param name="newState">New state.</param>\n-\t\t/// Obsolete. Used by the legacy animator\n-\t\t/*\tvoid playAnimation(string pAnim, int newState)\n-\t{\n-\t\t\t\treturn;\n-\t\t\t\tcurranim=newState;\n-\t\tif (Frozen)\n-\t\t{\n-\t\t\t//anim.enabled=true;\n-\t\t\tFrozenUpdate=2;\n-\t\t}\n-\t\t\tif (GameWorldController.instance.critsLoader[NPC_IDi-64]==null)\n-\t\t\t{\n-\t\t\t\tGameWorldController.instance.critsLoader[NPC_IDi-64]= new CritLoader(NPC_IDi-64);\n-\t\t\t}\n-\t\t//currentState=newState;\n-\t\t//CurrentAnim=pAnim;\n-\t\t//anim.Play(pAnim);\n-\t\t}*/\n \n \t\t/// <summary>\n \t\t/// NPC tries to hit the player.\n@@ -1234,8 +1201,6 @@ public class NPC : MobileObject {\n \t\t\t\t}\n \t\t\t\tfloat weaponRange=1.5f;\n \n-\n-\n \t\t\t\t//NPC tries to raycast at the player or object\n \t\t\t\tVector3 TargetingPoint;\n \t\t\t\tif (gtarg.name=="_Gronk")\n@@ -1277,11 +1242,6 @@ public class NPC : MobileObject {\n \t\t\t\t\t\t\t\t\t\telse\n \t\t\t\t\t\t\t\t\t\t{\n \t\t\t\t\t\t\t\t\t\t\t\tImpact.SpawnHitImpact(Impact.ImpactDamage(), GetImpactPoint(),46,50);\n-\t\t\t\t\t\t\t\t\t\t\t\t//if (ObjectInteraction.PlaySoundEffects)\n-\t\t\t\t\t\t\t\t\t\t\t\t//{\n-\t\t\t\t\t\t\t\t\t\t\t\t//\t\tobjInt().aud.clip=GameWorldController.instance.getMus().SoundEffects[MusicController.SOUND_EFFECT_MELEE_MISS_2];\n-\t\t\t\t\t\t\t\t\t\t\t\t//\t\tobjInt().aud.Play();\n-\t\t\t\t\t\t\t\t\t\t\t\t//}\n \t\t\t\t\t\t\t\t\t\t}\n \t\t\t\t\t\t\t\t}\n \t\t\t\t\t\t}\n@@ -1452,4 +1412,345 @@ public class NPC : MobileObject {\n \t\t\t\t}\n \n \t\t}\n+\n+\t\t/*\n+\t\tpublic void CreateNPCPath(int EndTileX, int EndTileY, int StartTileX, int StartTileY)\n+\t\t{\n+\t\t\t\tTileMap tm = GameWorldController.instance.currentTileMap();\n+\t\t\t\t//PathSteps.Clear();\n+\t\t\t\tPathSteps= new List<PathCoord>();\n+\t\t\t\tPathStepsFinal= new List<PathCoord>();\n+\t\t\t\tAddStep(ref PathSteps, EndTileX, EndTileY,0);\n+\t\t\t\tbool PathFound=false;\n+\t\t\t\tint GiveUp=0;\n+\n+\t\t\t\twhile ((!PathFound) && (GiveUp <=64))\n+\t\t\t\t{\t\t\t\t\t\t\n+\t\t\t\t\t\tfor (int i =0; i<PathSteps.Count;i++)\n+\t\t\t\t\t\t{\n+\t\t\t\t\t\t\t\tif (!PathSteps[i].tested)\n+\t\t\t\t\t\t\t\t{\n+\t\t\t\t\t\t\t\t\t\tList<PathCoord> NeighbourSteps=AddNeighbourSteps(tm, PathSteps[i].tileX, PathSteps[i].tileY, GiveUp, StartTileX, StartTileY);\n+\t\t\t\t\t\t\t\t\t\tPathSteps[i].tested=true;\n+\t\t\t\t\t\t\t\t\t\tDeduplicateSteps(ref NeighbourSteps);\t\t\n+\t\t\t\t\t\t\t\t}\n+\t\t\t\t\t\t}\n+\t\t\t\t\t\t//Check for path found.\n+\t\t\t\t\t\tPathFound=CheckPathFound(StartTileX, StartTileY);\n+\t\t\t\t\t\tGiveUp++;\n+\t\t\t\t}\n+\n+\t\t\t\tif (PathFound==true)\n+\t\t\t\t{\n+\t\t\t\t\t\tPathStepsFinal.Add(PathSteps[PathSteps.Count-1]);\n+\t\t\t\t\t\tTracePathBack(PathSteps[PathSteps.Count-1]);\n+\t\t\t\t}\n+\t\t\t\telse\n+\t\t\t\t{\n+\t\t\t\t\t\tPathStepsFinal.Add (PathSteps[0]);//Just put in the first step\n+\t\t\t\t}\n+\t\t}\n+\n+\t\n+\tList <PathCoord> AddNeighbourSteps (TileMap tm,int tileX, int tileY, int counter, int DestTileX, int DestTileY)\n+\t{\n+\t\tList<PathCoord> NeighbourSteps = new List<PathCoord>();\n+\t\tfor (int x = -1; x <= 1; x++) \t\t\t\t\n+\t\t\t{\n+\t\t\tfor (int y = -1; y <= 1; y++) \n+\t\t\t\t{\n+\t\t\t\t\t\t\t\tif (\n+\t\t\t\t\t\t\t\t\t\t( (x==0) && ((y==1) || (y==-1) ) )\n+\t\t\t\t\t\t\t\t\t\t||\n+\t\t\t\t\t\t\t\t\t\t( (y==0) && ((x==1) || (x==-1) ) )\n+\t\t\t\t\t\t\t\t)\n+\t\t\t\t{\n+\t\t\t\t\tif (TileMap.ValidTile(x+tileX, y+tileY))\n+\t\t\t\t\t{\n+\t\t\t\t\t\tif (TileMap.isTileOpen(tm.Tiles[x+tileX, y+tileY].tileType))\t\t\t\t\t\t\t\n+\t\t\t\t\t\t{\n+\t\t\t\t\t\t\tif (CanMoveBetweenTiles(tm, tileX,tileY, x+tileX, y+tileY))\n+\t\t\t\t\t\t\t{\n+\t\t\t\t\t\t\t\t\tAddStep(ref NeighbourSteps, x+tileX, x+tileY, counter );\t\n+\t\t\t\t\t\t\t\t\tif \t\t(\n+\t\t\t\t\t\t\t\t\t\t\t(x+tileX==DestTileX)\n+\t\t\t\t\t\t\t\t\t\t\t&&\n+\t\t\t\t\t\t\t\t\t\t\t(x+tileX==DestTileX)\n+\t\t\t\t\t\t\t\t\t\t\t)\n+\t\t\t\t\t\t\t\t\t\t\t\t{\n+\t\t\t\t\t\t\t\t\t\t\t\t\treturn NeighbourSteps;//Found a valid path.\n+\t\t\t\t\t\t\t\t\t\t\t\t}\n+\n+\t\t\t\t\t\t\t}\n+\t\t\t\t\t\t}\n+\t\t\t\t\t}\n+\t\t\t\t}\n+\t\t\t}\n+\t\t}\n+\t\treturn NeighbourSteps;\n+\t}\n+\n+\tpublic void AddStep(ref List<PathCoord> ListToAdd, int tileX, int tileY, int counter)\n+\t{\n+\t\t\tPathCoord PathCoordToAdd = new PathCoord();\n+\t\t\tPathCoordToAdd.tileX = tileX;\n+\t\t\tPathCoordToAdd.tileY = tileY;\n+\t\t\tPathCoordToAdd.Counter = counter;\n+\t\t\tListToAdd.Add (PathCoordToAdd);\n+\t}\n+\n+\n+\tbool CanMoveBetweenTiles (TileMap tm, int srcTileX, int srcTileY, int dstTileX, int dstTileY)\n+\t{\n+\t\t\tshort srcTileType = tm.Tiles[srcTileX,srcTileY].tileType;\n+\t\t\tshort dstTileType = tm.Tiles[dstTileX,dstTileY].tileType;\n+\n+\t\t\treturn true;\n+\t}\n+\n+\tvoid DeduplicateSteps(ref List<PathCoord> neighbours)\n+\t{\n+\t\t\tfor (int i=neighbours.Count-1; i >= 0; i--)\t\n+\t\t\t{\n+\t\t\t\t\tfor (int j = 0; j<PathSteps.Count; j++)\n+\t\t\t\t\t{\n+\t\t\t\t\t\t\tif (\n+\t\t\t\t\t\t\t\t\t(neighbours[i].tileX == PathSteps[j].tileX)\n+\t\t\t\t\t\t\t\t\t&&\n+\t\t\t\t\t\t\t\t\t(neighbours[i].tileY == PathSteps[j].tileY)\n+\t\t\t\t\t\t\t)\n+\t\t\t\t\t\t\t{\n+\t\t\t\t\t\t\t\t\tif (neighbours[i].Counter <= PathSteps[j].Counter)\n+\t\t\t\t\t\t\t\t\t{\n+\t\t\t\t\t\t\t\t\t\t\tneighbours.RemoveAt(i);\n+\t\t\t\t\t\t\t\t\t}\n+\t\t\t\t\t\t\t}\n+\t\t\t\t\t}\n+\t\t\t}\n+\t}\n+\n+\tvoid AddStepsToPath(ref List<PathCoord> neighbours)\n+\t{\n+\t\tfor (int i=0; i < neighbours.Count; i++)\t\n+\t\t{\n+\t\t\t\tPathSteps.Add(neighbours[i]);\n+\t\t}\n+\t}\n+\n+\tbool CheckPathFound (int destX, int destY)\n+\t{\n+\t\t\tfor (int i=PathSteps.Count-1; i >= 0; i--)\t\n+\t\t\t{\n+\t\t\t\t\tif (\n+\t\t\t\t\t\t\t(PathSteps[i].tileX == destX)\n+\t\t\t\t\t\t\t&&\n+\t\t\t\t\t\t\t(PathSteps[i].tileY == destY)\n+\t\t\t\t\t)\n+\t\t\t\t\t{\n+\t\t\t\t\t\t\treturn true;\n+\t\t\t\t\t}\n+\n+\t\t\t}\n+\t\t\treturn false;\n+\t}\n+\n+\t\tvoid TracePathBack (PathCoord step)\n+\t\t{\n+\t\t\t\t//PathCoord step = PathSteps[PathSteps.Count-1];\n+\t\t\t\tint Counter=step.Counter;\n+\t\t\t\tfor (int x=-1; x<=1;x++)\n+\t\t\t\t{\n+\t\t\t\t\t\tfor (int y=-1; y<=1;y++)\n+\t\t\t\t\t\t{\n+\n+\t\t\t\t\t\t\t\tint stepFoundIndex = FindCoordInList(ref PathSteps, step.tileX, step.tileY);\n+\n+\t\t\t\t\t\t\t\tif (stepFoundIndex!=-1)\n+\t\t\t\t\t\t\t\t{\n+\t\t\t\t\t\t\t\t\t\tif(PathSteps[stepFoundIndex].Counter < Counter)\n+\t\t\t\t\t\t\t\t\t\t{\n+\t\t\t\t\t\t\t\t\t\t\tPathStepsFinal.Add(PathSteps[stepFoundIndex]);\n+\t\t\t\t\t\t\t\t\t\t\tTracePathBack(PathSteps[stepFoundIndex]);\t\n+\t\t\t\t\t\t\t\t\t\t}\n+\t\t\t\t\t\t\t\t}\n+\t\t\t\t\t\t}\n+\t\t\t\t}\n+\n+\t\t}\n+\n+\n+\t\tint FindCoordInList (ref List<PathCoord> ListToSearch, int tileX, int tileY)\n+\t\t{\n+\t\t\t\tfor (int i=0; i<ListToSearch.Count-1;i++)\n+\t\t\t\t{\n+\t\t\t\t\t\tif \n+\t\t\t\t\t\t\t\t(\n+\t\t\t\t\t\t\t\t(ListToSearch[i].tileX==tileX)\n+\t\t\t\t\t\t\t\t\t\t&&\n+\t\t\t\t\t\t\t\t(ListToSearch[i].tileY==tileY)\n+\t\t\t\t\t\t\t\t)\n+\t\t\t\t\t\t{\n+\t\t\t\t\t\t\t\t//return ListToSearch[i];\n+\t\t\t\t\t\t\t\treturn i;\n+\t\t\t\t\t\t}\n+\t\t\t\t}\n+\t\t\t\treturn -1;\n+\t\t}\n+\n+\n+\t\tpublic Vector3 getPathDestinationVector()\n+\t\t{\n+\t\t\treturn GameWorldController.instance.currentTileMap().getTileVector( PathStepsFinal[PathStepsFinal.Count-1].tileX , PathStepsFinal[PathStepsFinal.Count-1].tileY );\n+\t\t}\n+\t\t*/\n+\n+\n+\n+\t\tvoid SetRandomAttack()\n+\t\t{\n+\t\t\t\tint AttackProb = Random.Range(1,100);\n+\t\t\t\t//NPC npc = ai.Body.GetComponent<NPC>();\n+\t\t\t\tint AccumulatedProb=0;\n+\t\t\t\tint AnimSelected=0;\n+\t\t\t\tfor ( AnimSelected=0;AnimSelected<=GameWorldController.instance.objDat.critterStats[NPC_IDi-64].AttackProbability.GetUpperBound(0);AnimSelected++)\n+\t\t\t\t{\t\t\n+\t\t\t\t\t\tAccumulatedProb+=GameWorldController.instance.objDat.critterStats[NPC_IDi-64].AttackProbability[AnimSelected];\n+\t\t\t\t\t\tif (AttackProb<=AccumulatedProb)\n+\t\t\t\t\t\t{\n+\t\t\t\t\t\t\t\tCurrentAttack=AnimSelected;\n+\t\t\t\t\t\t\t\tbreak;\n+\t\t\t\t\t\t}\n+\t\t\t\t}\n+\n+\t\t\t\tswitch (AnimSelected)\n+\t\t\t\t{\n+\t\t\t\tcase 1:\n+\t\t\t\t\t\tAnimRange=NPC.AI_ANIM_ATTACK_SLASH;break;\n+\t\t\t\tcase 2:\t\t\t\t\t\n+\t\t\t\t\t\tAnimRange=NPC.AI_ANIM_ATTACK_THRUST;break;\n+\t\t\t\tcase 0:\n+\t\t\t\tdefault:\n+\t\t\t\t\t\tAnimRange=NPC.AI_ANIM_ATTACK_BASH;break;\n+\t\t\t\t}\n+\n+\n+\t\t}\n+\n+\n+\n+\t\tvoid SetRandomDestination()\n+\t\t{\n+\t\t\t\tint distanceMultipler=1;//For frightened NPCs\n+\n+\t\t\t\tif (npc_gtarg==6)\n+\t\t\t\t{\n+\t\t\t\t\t\tdistanceMultipler=3;//Runs further away from it\'s current location.\n+\t\t\t\t}\n+\t\t\t\t//Get a random spot.\n+\t\t\t\tbool DestFound=false;\n+\t\t\t\tVector3 curPos = transform.position;\n+\t\t\t\tVector3 dest =curPos;\n+\t\t\t\tint tileX = (int)(curPos.x/1.2f);\n+\t\t\t\tint tileY = (int)(curPos.z/1.2f);\n+\t\t\t\tDestTileX =tileX;\n+\t\t\t\tDestTileY=tileY;\n+\t\t\t\t//int ValidRoom = npc.Room();\n+\t\t\t\tfor (int i=0; i<5;i++)\n+\t\t\t\t{\n+\t\t\t\t\t\tDestTileX = tileX + Random.Range(-2*distanceMultipler,3*distanceMultipler);\n+\t\t\t\t\t\tDestTileY = tileY + Random.Range(-2*distanceMultipler,3*distanceMultipler);\n+\t\t\t\t\t\t//if (GameWorldController.instance.currentTileMap().GetTileType(newTileX,newTileY) != TileMap.TILE_SOLID)\n+\t\t\t\t\t\tif (Room()== GameWorldController.instance.currentTileMap().GetRoom(DestTileX,DestTileY))\n+\t\t\t\t\t\t{\n+\t\t\t\t\t\t\t\tDestFound=true;\n+\t\t\t\t\t\t\t\tbreak;\n+\t\t\t\t\t\t}\t\n+\t\t\t\t\t\tif (DestFound==false)\n+\t\t\t\t\t\t{\n+\t\t\t\t\t\t\t\tDestTileX=tileX;\n+\t\t\t\t\t\t\t\tDestTileY=tileY;\n+\t\t\t\t\t\t}\n+\t\t\t\t}\n+\n+\t\t\t\t//Move back home if too far away\n+\t\t\t\tfloat xDist2=Mathf.Pow(DestTileX-npc_xhome,2f);\n+\t\t\t\tfloat yDist2=Mathf.Pow(DestTileY-npc_yhome,2f);\n+\t\t\t\tif (yDist2+xDist2>=10)\n+\t\t\t\t{\n+\t\t\t\t\tDestTileX=npc_xhome;\n+\t\t\t\t\tDestTileY=npc_yhome;\t\t\t\t\t\t\t\n+\t\t\t\t}\n+\n+\t\t}\n+\n+\n+\t\tvoid PerformDeathAnim()\n+\t\t{\n+\t\t\tAnimRange= NPC.AI_ANIM_DEATH;\n+\t\t\tMusicController.LastAttackCounter=0.0f;//Stops combat music unil the next time the player is hit\n+\t\t\tGameWorldController.instance.getMus().PlaySpecialClip(GameWorldController.instance.getMus().VictoryTracks); //plays the fanfare\n+\t\t\tWaitTimer =0.8f;\n+\t\t}\n+\n+\n+\t\tvoid DumpRemains()\n+\t\t{\n+\t\t\t\t//Spawn a bloodstain at this spot.\n+\t\t\t\tint bloodstain=-1;\n+\t\t\t\t//Nothing = 0x00, \n+\t\t\t\t//RotwormCorpse = 0x20, //A??????\n+\t\t\t\t//Rubble = 0x40, \n+\t\t\t\t//WoodChips = 0x60, \n+\t\t\t\t//Bones = 0x80, \n+\t\t\t\t//GreenBloodPool = 0xA0, \n+\t\t\t\t//RedBloodPool = 0xC0, \n+\t\t\t\t//RedBloodPoolGiantSpider = 0xE0. \n+\n+\t\t\t\t//switch (GameWorldController.instance.critterData.Remains[objInt.item_id-64])\n+\t\t\t\tswitch (GameWorldController.instance.objDat.critterStats[objInt().item_id-64].Remains)\n+\t\t\t\t{\n+\t\t\t\tcase 0x2://Rotworm corpse\n+\t\t\t\t\t\tbloodstain=217;\n+\t\t\t\t\t\tbreak;\n+\t\t\t\tcase 0x4://Rubble\n+\t\t\t\t\t\tbloodstain=218;\n+\t\t\t\t\t\tbreak;\n+\t\t\t\tcase 0x6://Woodchips\n+\t\t\t\t\t\tbloodstain=219;\n+\t\t\t\t\t\tbreak;\n+\t\t\t\tcase 0x8://Bones\n+\t\t\t\t\t\tbloodstain=220;\n+\t\t\t\t\t\tbreak;\n+\t\t\t\tcase 0xA://Greenblood\n+\t\t\t\t\t\tbloodstain=221;\n+\t\t\t\t\t\tbreak;\n+\t\t\t\tcase 0xC://Redblood\n+\t\t\t\t\t\tbloodstain=222;\n+\t\t\t\t\t\tbreak;\n+\t\t\t\tcase 0xE://RedBloodPoolGiantSpider\n+\t\t\t\t\t\tbloodstain=223;\n+\t\t\t\t\t\tbreak;\n+\t\t\t\tcase 0://Nothing\n+\t\t\t\t\t\tbloodstain=-1;\n+\t\t\t\t\t\tbreak;\n+\t\t\t\tdefault:\n+\t\t\t\t\t\tDebug.Log(this.name + " should drop " + GameWorldController.instance.objDat.critterStats[objInt().item_id-64].Remains);\n+\t\t\t\t\t\tbloodstain=-1;\n+\t\t\t\t\t\tbreak;\n+\t\t\t\t}\n+\n+\t\t\t\tif(bloodstain!=-1)\n+\t\t\t\t{\n+\t\t\t\t\t\tObjectLoaderInfo newobjt= ObjectLoader.newObject(bloodstain,0,0,0,256);\n+\t\t\t\t\t\tObjectInteraction.CreateNewObject(GameWorldController.instance.currentTileMap(),newobjt, GameWorldController.instance.LevelMarker().gameObject,this.transform.position);\n+\t\t\t\t\t\t//ObjectInteraction remains = ObjectInteraction.CreateNewObject(bloodstain);\t\t\t\t\t\t\n+\t\t\t\t\t\t//remains.gameObject.transform.parent=GameWorldController.instance.LevelMarker();\n+\t\t\t\t\t\t//GameWorldController.MoveToWorld(remains.gameObject);\n+\t\t\t\t\t\t//remains.transform.position=ai.Body.transform.position;\n+\t\t\t\t}\n+\n+\t\t\t\tDestroy(this.gameObject);\n+\n+\t\t}\n+\n }\ndiff --git a/UnityScripts/scripts/NPC/NPC_Animation.cs b/UnityScripts/scripts/NPC/NPC_Animation.cs\nindex b6733d22..d0a266e4 100644\n--- a/UnityScripts/scripts/NPC/NPC_Animation.cs\n+++ b/UnityScripts/scripts/NPC/NPC_Animation.cs\n@@ -11,7 +11,7 @@ public class NPC_Animation : MonoBehaviour {\n \t\tpublic CritterAnimInfo critAnim;\n \t\tpublic SpriteRenderer output;\n \t\t//public int prevIndex;\n-\t\tbool ConstantAnim; //Is this anim continuouse or periodic. (ie hold on final frame.\n+\t\tpublic bool ConstantAnim; //Is this anim continuouse or periodic. (ie hold on final frame.\n \n \t// Update is called once per frame\n \tvoid Update () {\n@@ -23,13 +23,18 @@ public class NPC_Animation : MonoBehaviour {\n \t\t\t{\n \t\t\t\tif (critAnim.animIndices[AnimationIndex,AnimationPos]!=-1)\n \t\t\t\t{\n-\n-\t\t\t\t\toutput.sprite= critAnim.animSprites[critAnim.animIndices[AnimationIndex,AnimationPos]];\t\n-\t\t\t\t\t\n+\t\t\t\t\toutput.sprite= critAnim.animSprites[critAnim.animIndices[AnimationIndex,AnimationPos]];\t\t\t\t\t\t\n+\t\t\t\t}\n+\t\t\t\telse\n+\t\t\t\t{\n+\t\t\t\t\tif (ConstantAnim==false)\n+\t\t\t\t\t{\n+\t\t\t\t\t\t\tAnimationPos=0;\n+\t\t\t\t\t}\t\t\t\t\t\n \t\t\t\t}\n \t\t\t}\n \t\t\tAnimationPos++;\n-\t\t\tif ((AnimationPos>critAnim.animIndices.GetUpperBound(1)) && (ConstantAnim==false))\n+\t\t\tif ((AnimationPos>=critAnim.animIndices.GetUpperBound(1)) && (ConstantAnim==false))\n \t\t\t{\n \t\t\t\tAnimationPos=0;\n \t\t\t}\ndiff --git a/UnityScripts/scripts/Objects/DoorControl.cs b/UnityScripts/scripts/Objects/DoorControl.cs\nindex 1b4b6b00..f07762e0 100644\n--- a/UnityScripts/scripts/Objects/DoorControl.cs\n+++ b/UnityScripts/scripts/Objects/DoorControl.cs\n@@ -1,5 +1,6 @@\n \ufeffusing UnityEngine;\n using System.Collections;\n+using UnityEngine.AI;\n /// <summary>\n /// Door controller for manipulating doors\n /// </summary>\n@@ -814,7 +815,9 @@ public class DoorControl : object_base {\n \t\t\t\tint textureIndex=0;\n \t\t\t\t//string DoorTexturePath="";\n \t\t\t//Try and match up the door item id with a texture.\n-\n+\t\t\t\tNavMeshObstacle navobs= myObj.AddComponent<NavMeshObstacle>();\n+\t\t\t\tnavobs.center= new Vector3(-.4f, 0f, 0.5f);\n+\t\t\t\tnavobs.size= new Vector3(0.8f, 0.1f, 1.1f);\n \n \t\t\tswitch  (GameWorldController.instance.objectMaster.type[objInt.item_id])\n \t\t\t\t{\ndiff --git a/UnityScripts/scripts/Player Character/Character.cs b/UnityScripts/scripts/Player Character/Character.cs\nindex 5869f052..7f7ac9ac 100644\n--- a/UnityScripts/scripts/Player Character/Character.cs\t\n+++ b/UnityScripts/scripts/Player Character/Character.cs\t\n@@ -150,6 +150,12 @@ public class Character : UWEBase {\n \t\tdirForNPC.y=0.0f;\n \t\t\t\t//dir.y = 0.0f;\n \t\tCameraPos=Camera.main.transform.position;\n+\n+\n+\t\t\t\tif (transform.position.y <-10f)\n+\t\t\t\t{\n+\t\t\t\t\tthis.transform.position = GameWorldController.instance.currentTileMap().getTileVector(TileMap.visitedTileX,TileMap.visitedTileY);\n+\t\t\t\t}\n \t}\n \n \tpublic void UseMode()\ndiff --git a/UnityScripts/scripts/Player Character/ShockCharacter.cs b/UnityScripts/scripts/Player Character/ShockCharacter.cs\nindex cf7c553d..5d11c369 100644\n--- a/UnityScripts/scripts/Player Character/ShockCharacter.cs\t\n+++ b/UnityScripts/scripts/Player Character/ShockCharacter.cs\t\n@@ -70,7 +70,7 @@ public class ShockCharacter : MonoBehaviour {\n \t\t//WindowDetect.playerUW=this.GetComponent<UWCharacter>();\n \t\t\n \t\tXAxis = GetComponent<MouseLook>();\n-\t\tYAxis =\ttransform.FindChild ("Main Camera").GetComponent<MouseLook>();\n+\t\tYAxis =\ttransform.Find ("Main Camera").GetComponent<MouseLook>();\n \t\t//Screen.lockCursor=true;\n \t\t\n \t\t\t//\tMessageLog = (Text)GameObject.FindWithTag("MessageLog").GetComponent<Text>();\ndiff --git a/UnityScripts/scripts/World/GameWorldController.cs b/UnityScripts/scripts/World/GameWorldController.cs\nindex ffa07f5b..9720aa6f 100644\n--- a/UnityScripts/scripts/World/GameWorldController.cs\n+++ b/UnityScripts/scripts/World/GameWorldController.cs\n@@ -7,7 +7,7 @@ using System.Collections;\n using System.Collections.Generic;\n using System.IO;\n using System.Text;\n-\n+using UnityEngine.AI;\n using UnityEngine.UI;\n \n /// <summary>\n@@ -78,7 +78,7 @@ public class GameWorldController : UWEBase {\n \t\t\t\tEthereal8=72\n \t\t};\n \n-\n+\t\tpublic NavMeshSurface navmeshsurface;\n \n \t\t[Header("Controls")]\n \t\tpublic MouseLook MouseX;\n@@ -91,6 +91,7 @@ public class GameWorldController : UWEBase {\n \t\t/// Generate Nav meshes or not\n \t\t/// </summary>\n \t\tpublic bool bGenNavMeshes=true;\n+\t\tpublic int GenNavMeshNextFrame=-1;\n \n \t\t/// <summary>\n \t\t/// Enables texture animation effects\n@@ -444,10 +445,30 @@ public class GameWorldController : UWEBase {\n \n \t\t\t\tinstance=this;\n \t\t\t\tAtMainMenu=true;\n+\n+\t\t\t\t//Debug.Log(navmeshsurface.GetComponent<NavMeshSurface>().layerMask.value);\n \t\t\t\treturn;\n \n \t\t}\n \n+\t\tvoid Update()\n+\t\t{\n+\t\t\tif (GenNavMeshNextFrame>=0)\n+\t\t\t{\n+\t\t\t\tGenNavMeshNextFrame--;\n+\t\t\t\tif (GenNavMeshNextFrame ==1)\n+\t\t\t\t{\n+\t\t\t\t\tif ((bGenNavMeshes) && (!EditorMode))\n+\t\t\t\t\t{\n+\t\t\t\t\t\tGenNavMeshNextFrame=-1;\n+\t\t\t\t\t\t//GenerateNavmesh(NavRigLand);\n+\t\t\t\t\t\t//GenerateNavmesh(NavRigWater);\n+\t\t\t\t\t\tGenerateNavmesh(navmeshsurface,256);\n+\t\t\t\t\t}\t\n+\t\t\t\t}\n+\t\t\t}\n+\t\t}\n+\n \t\tvoid LateUpdate()\n \t\t{\n \t\t\t\tif (WorldReRenderPending)\n@@ -722,7 +743,7 @@ public class GameWorldController : UWEBase {\n \t\tpublic static GameObject FindTile(int x, int y, int surface)\n \t\t{\n \t\t\t\tstring tileName = GetTileName (x,y,surface);\n-\t\t\t\tTransform found = instance.getCurrentLevelModel().transform.FindChild (tileName);\n+\t\t\t\tTransform found = instance.getCurrentLevelModel().transform.Find (tileName);\n \t\t\t\tif (found!=null)\n \t\t\t\t{\n \t\t\t\t\t\treturn found.gameObject;\n@@ -775,7 +796,7 @@ public class GameWorldController : UWEBase {\n \t\t/// <param name="tileName">Tile name.</param>\n \t\tpublic static GameObject FindTileByName(string tileName)\n \t\t{\n-\t\t\t\treturn instance.getCurrentLevelModel().transform.FindChild (tileName).gameObject;\n+\t\t\t\treturn instance.getCurrentLevelModel().transform.Find (tileName).gameObject;\n \t\t}\n \n \t\t/// <summary>\n@@ -906,8 +927,10 @@ public class GameWorldController : UWEBase {\n \n \t\t\t\t\t\tif ((bGenNavMeshes) && (!EditorMode))\n \t\t\t\t\t\t{\n-\t\t\t\t\t\t\t\tGenerateNavmesh(NavRigLand);\n-\t\t\t\t\t\t\t\tGenerateNavmesh(NavRigWater);\t\t\t\t\t\t\t\t\n+\t\t\t\t\t\t\t\tGenNavMeshNextFrame=5;//true;\n+\t\t\t\t\t\t\t\t//GenerateNavmesh(NavRigLand);\n+\t\t\t\t\t\t\t\t//GenerateNavmesh(NavRigWater);\n+\t\t\t\t\t\t\t\tGenerateNavmesh(navmeshsurface,256);\n \t\t\t\t\t\t}\n \n \t\t\t\t\t\tif ((LevelNo==7) && (UWEBase._RES==UWEBase.GAME_UW1))\n@@ -971,6 +994,20 @@ public class GameWorldController : UWEBase {\n \n \t\t}\n \n+\t\tvoid GenerateNavmesh(NavMeshSurface navmeshobj, int layer)\n+\t\t{\n+\t\t\t\t\n+\t\t\t//\tif (navmeshobj.GetComponent<NavMeshSurface>()!=null)\n+\t\t\t//\t{\n+\t\t\t\t//\t\tDestroy(navmeshobj.GetComponent<NavMeshSurface>());\n+\t\t\t\t//}\n+\t\t\t\t//NavMeshSurface navmesh = navmeshobj.AddComponent<NavMeshSurface>();\n+\t\t\t\t//navmesh.layerMask = layer;\n+\t\t\t\tnavmeshobj.BuildNavMesh();\n+\t\t}\n+\n+\n+\n \n \t\t/// <summary>\n \t\t/// Freezes the movement of the specified object if it has a rigid body attached.\ndiff --git a/config.ini b/config.ini\nindex c5bba0c5..795a2c0a 100644\n--- a/config.ini\n+++ b/config.ini\n@@ -31,12 +31,29 @@ trackskill=t\n \r\n ;Graphics\r\n ;Light level. Controls the default light level around the player\r\n-DefaultLightLevel=16\r\n+DefaultLightLevel=8\r\n ;Field of view\r\n FOV=75\r\n \r\n+;Music\r\n+;Replace the path with the folder containing the .ogg files \r\n+;The currently release soundpack zip contains the following packs\r\n+;UW1_PSX -- The orchestral soundtrack from the PSX release\r\n+;UW1_SB16 -- A soundblaster style soundtrack\r\n+;UW1_SB16 -- A soundblaster style soundtrack\r\n+;UW1_MIDI -- A midi (adblib??) style soundtrack\r\n+;Custom tracks can be added by creating a new folder and putting your own .ogg files into a new folder and \r\n+;putting it\'s path here.\r\n+;Names are in the format ##.ogg  (e.g. 01.ogg, 04.ogg, 15.ogg)\r\n+UW1_Soundbank=C:\\Games\\UWSoundPack\\UW1_PSX\\\r\n+UW2_Soundbank=C:\\Games\\UWSoundPack\\UW1_PSX\\\r\n+\r\n ;Cheats\r\n ;1 to enable.\r\n ;0 to disable\r\n InfiniteMana=0\r\n-GodMode=0\n\\ No newline at end of file\n+GodMode=0\r\n+\r\n+;Gameplay\r\n+;Use the new context sensitive action controls. Set to zero to revert to vanilla controls.\r\n+ContextUIEnabled=1\n\\ No newline at end of file\n', 'commit_subject': "Rework of AI to use Unity's AI Navmeshes", 'repo_name': 'hankmorgan/UnderworldExporter', 'committer': {'name': 'hankmorgan', 'email': 'b1fd6e89686dd9eb01dc9c28a3367dc940d79455@yahoo.co.uk', 'time_sec': '1518312421', 'tz_offset': '0', 'date': {'seconds': '1518312421'}}, 'commit_tree': '9c12c92afc20f3f3b4e7f461ffe375fd1e345781', 'commit_message': "Rework of AI to use Unity's AI Navmeshes", 'language_name': 'C#', 'license': 'mit', 'hunks': "@@ -31,12 +31,29 @@ trackskill=t\n \r\n ;Graphics\r\n ;Light level. Controls the default light level around the player\r\n-DefaultLightLevel=16\r\n+DefaultLightLevel=8\r\n ;Field of view\r\n FOV=75\r\n \r\n+;Music\r\n+;Replace the path with the folder containing the .ogg files \r\n+;The currently release soundpack zip contains the following packs\r\n+;UW1_PSX -- The orchestral soundtrack from the PSX release\r\n+;UW1_SB16 -- A soundblaster style soundtrack\r\n+;UW1_SB16 -- A soundblaster style soundtrack\r\n+;UW1_MIDI -- A midi (adblib??) style soundtrack\r\n+;Custom tracks can be added by creating a new folder and putting your own .ogg files into a new folder and \r\n+;putting it's path here.\r\n+;Names are in the format ##.ogg  (e.g. 01.ogg, 04.ogg, 15.ogg)\r\n+UW1_Soundbank=C:\\Games\\UWSoundPack\\UW1_PSX\\\r\n+UW2_Soundbank=C:\\Games\\UWSoundPack\\UW1_PSX\\\r\n+\r\n ;Cheats\r\n ;1 to enable.\r\n ;0 to disable\r\n InfiniteMana=0\r\n-GodMode=0\n\\ No newline at end of file\n+GodMode=0\r\n+\r\n+;Gameplay\r\n+;Use the new context sensitive action controls. Set to zero to revert to vanilla controls.\r\n+ContextUIEnabled=1\n\\ No newline at end of file\n", 'addition_count': 19, 'deletion_count': 2, 'src_file': 'a/config.ini', 'tgt_file': 'b/config.ini', 'file_extension': '.ini', 'before_file': ';Path Options\n;Point these to the folder containing the original game executable.\n;If using GOG.com version extract the "game.gog" to a new folder and point to that instead. See readme.\n;Make sure these paths end with the trailing slash \\\nPath_UW0=c:\\games\\uwdemo\\\nPath_UW1=c:\\games\\uw1\nPath_UW2=c:\\games\\uw2\\\nPath_Shock=C:\\Games\\SystemShock\\\nPath_TNova=C:\\Games\\Terra Nova\\CD\\Terra_Nova\\\n\n;MouseLookOptions.\n;Change the following to control mouse sensitivity\n;Setting values to negative will also invert axis.\nMOUSEX=15\nMOUSEY=15\n\n;Special key bindings\n;Setup standard movement controls in options window at game launch.\nflyup=r\nflydown=v\ntogglemouselook=e\ntogglefullscreen=f\ninteractionoptions=f1\ninteractiontalk=f2\ninteractionpickup=f3\ninteractionlook=f4\ninteractionattack=f5\ninteractionuse=f6\ncastspell=q\ntrackskill=t\n\r\n;Graphics\r\n;Light level. Controls the default light level around the player\r\nDefaultLightLevel=16\r\n;Field of view\r\nFOV=75\r\n\r\n;Cheats\r\n;1 to enable.\r\n;0 to disable\r\nInfiniteMana=0\r\nGodMode=0\n;0 to disable\nInfiniteMana=0\nGodMode=0\n\n;Gameplay\n;Use the new context sensitive action controls. Set to zero to revert to vanilla controls.\nContextUIEnabled=1\n\n;Set to 1 to allow the automatic using of door keys on locked doors if the correct key is available\nAutoKeyUse=1\n\n;Set to 1 to allow automatically eating of food hunger level drops below 10\nAutoEat=1\n\n;Developer\n;Create an object report as each level is loaded\nGenReport=1\n;Only show in use objects in reports\nShowInUse=1\n\n', 'message': "Rework of AI to use Unity's AI Navmeshes", 'author_name': 'hankmorgan', 'lang': 'ini'}