public override void Execute(params object[] executeArgs)
		{
			GameWorld world = executeArgs[0] as GameWorld;
			string vectorVariable = CommandArgs[0].ToString();
			string value = CommandArgs[1].ToString();

			ScriptLinkTableNode vector = world.GlobalValueTable.GetRecord(vectorVariable);
			if (vector != null)
			{
				vector.NextNodes[1].Value = value.StartsWith("%") ? Context.GetLocalValue(value.Substring(1)).ToString() : value;
			}
		}
        public override void Execute(params object[] executeArgs)
        {
            GameWorld world          = executeArgs[0] as GameWorld;
            string    vectorVariable = CommandArgs[0].ToString();

            ScriptLinkTableNode vector = world.GlobalValueTable.GetRecord(vectorVariable);

            if (vector != null)
            {
                vector.NextNodes[0].Value = "0";
                vector.NextNodes[1].Value = "0";
                vector.NextNodes[2].Value = "0";
            }
        }
Exemple #3
0
        public override void Execute(params object[] executeArgs)
        {
            GameWorld           world        = executeArgs[0] as GameWorld;
            string              listVariable = CommandArgs[0].ToString();
            string              strValue     = CommandArgs[1].ToString();
            ScriptLinkTableNode list         = Context.LocalTable.GetRecord(listVariable);

            if (list != null)
            {
                list.NextNodes.Add(new ScriptLinkTableNode()
                {
                    Value = strValue
                });
            }
        }
        public override void Execute(params object[] executeArgs)
        {
            GameWorld world        = executeArgs[0] as GameWorld;
            string    listVariable = CommandArgs[0].ToString();

            ScriptLinkTableNode list = Context.LocalTable.GetRecord(listVariable);

            if (list != null)
            {
                world.ChangeGobalValue("reg0", list.NextNodes.Count.ToString());
            }
            else
            {
                EngineManager.Instance.log.LogMessage(string.Format("Couldn't find list with name `{0}`!", listVariable), LogMessage.LogType.Error);
            }
        }
        public override void Execute(params object[] executeArgs)
        {
            GameWorld world        = executeArgs[0] as GameWorld;
            string    listVariable = CommandArgs[0].ToString();

            ScriptLinkTableNode list = Context.LocalTable.GetRecord(listVariable);

            if (list == null)
            {
                list = new ScriptLinkTableNode();
                Context.LocalTable.AddRecord(list);
            }
            else
            {
                GameManager.Instance.log.LogMessage(string.Format("The list variable with name `{0}` already existed!", listVariable), LogMessage.LogType.Warning);
            }
        }
Exemple #6
0
        public override void Execute(params object[] executeArgs)
        {
            GameWorld world        = executeArgs[0] as GameWorld;
            string    listVariable = CommandArgs[0].ToString();
            string    strIndex     = CommandArgs[1].ToString();
            string    strValue     = CommandArgs[1].ToString();
            int       index        = -1;

            if (!int.TryParse(strIndex, out index))
            {
                GameManager.Instance.log.LogMessage(string.Format("Invalid List index value: `{0}`!", strIndex), LogMessage.LogType.Error);
                return;
            }

            ScriptLinkTableNode list = Context.LocalTable.GetRecord(listVariable);

            if (list != null)
            {
                if (index >= 0)
                {
                    if (index < list.NextNodes.Count)
                    {
                        list.NextNodes[index].Value = strValue;
                    }
                    else
                    {
                        GameManager.Instance.log.LogMessage(string.Format("Invalid List index value: `{0}`!", strIndex), LogMessage.LogType.Error);
                    }
                }
                else
                {
                    GameManager.Instance.log.LogMessage(string.Format("Invalid List index value: `{0}`!", strIndex), LogMessage.LogType.Error);
                }
            }
            else
            {
                GameManager.Instance.log.LogMessage(string.Format("Couldn't find list with name `{0}`!", listVariable), LogMessage.LogType.Error);
            }
        }