Exemple #1
0
        public override void Execute(BaseEvent baseEvent)
        {
            QuestState questState;

            if (getQuestEntryState)
            {
                var entryNum = (int)questEntryNumber.GetValue(null, null);
                questState = QuestLog.GetQuestEntryState(questName.GetValue(), entryNum);
                if (DialogueDebug.LogInfo)
                {
                    Debug.Log("Dialogue System: ORK Step Get Quest State: '" + questName.GetValue() + "' entry #" + entryNum + " is " + questState);
                }
            }
            else
            {
                questState = QuestLog.GetQuestState(questName.GetValue());
                if (DialogueDebug.LogInfo)
                {
                    Debug.Log("Dialogue System: ORK Step Get Quest State: '" + questName.GetValue() + "' is " + questState);
                }
                QuestLog.SetQuestState(questName.GetValue(), questState);
            }
            if (variableType == GameVariableType.Float)
            {
                ORKEventTools.SetVariableValue(baseEvent, (float)((int)questState), origin, useObject, variableObject, objectID, key);
            }
            else
            {
                ORKEventTools.SetVariableValue(baseEvent, QuestLog.StateToString(questState), origin, useObject, variableObject, objectID, key);
            }
            baseEvent.StepFinished(this.next);
        }
Exemple #2
0
        public override void Execute(BaseEvent baseEvent)
        {
            var result = Lua.Run(luaCode, DialogueDebug.LogInfo);

            if (saveReturnValue)
            {
                if (DialogueDebug.LogInfo)
                {
                    Debug.Log("Dialogue System: Returning value '" + result.AsString + "' to ORK event.");
                }
                switch (variableType)
                {
                case GameVariableType.Bool:
                    ORKEventTools.SetVariableValue(baseEvent, result.AsBool, origin, useObject, variableObject, objectID, key);
                    break;

                case GameVariableType.Float:
                    ORKEventTools.SetVariableValue(baseEvent, result.AsFloat, origin, useObject, variableObject, objectID, key);
                    break;

                default:
                    ORKEventTools.SetVariableValue(baseEvent, result.AsString, origin, useObject, variableObject, objectID, key);
                    break;
                }
            }
            baseEvent.StepFinished(this.next);
        }
Exemple #3
0
        public override void Execute(BaseEvent baseEvent)
        {
            var result = DialogueLua.GetVariable(DSVariableName);

            if (DialogueDebug.LogInfo)
            {
                Debug.Log("Dialogue System: Get DS Variable: Storing DS variable " + DSVariableName + " value '" + result.AsString + "' in ORK variable w/key=" + key.GetValue());
            }
            switch (variableType)
            {
            case GameVariableType.Bool:
                ORKEventTools.SetVariableValue(baseEvent, result.AsBool, origin, useObject, variableObject, objectID, key);
                break;

            case GameVariableType.Float:
                ORKEventTools.SetVariableValue(baseEvent, result.AsFloat, origin, useObject, variableObject, objectID, key);
                break;

            default:
                ORKEventTools.SetVariableValue(baseEvent, result.AsString, origin, useObject, variableObject, objectID, key);
                break;
            }
            baseEvent.StepFinished(this.next);
        }