Yarn 1.2.7
Re: Yarn 1.2.7
This patch will fix the issue where the <<command>> is in the wrong place (linked to both options instead of just the correct option):
<Edit: See updated patch below.>
I'm still looking into the issue with arguments.
<Edit: See updated patch below.>
I'm still looking into the issue with arguments.
Re: Yarn 1.2.7
This patch also fixes the my_command issue:
DS_YarnPatch_2022-09-26.unitypackage
The importer was setting up the Yarn commands so they'd try to pass all arguments as strings. Now it passes the correct type.
DS_YarnPatch_2022-09-26.unitypackage
The importer was setting up the Yarn commands so they'd try to pass all arguments as strings. Now it passes the correct type.
-
- Posts: 83
- Joined: Wed Jun 24, 2020 5:06 pm
Re: Yarn 1.2.7
I think something broke -
The command works if the string is only one word long, but if it's longer, it tries to send each word through as a different argument - it becomes this: _G['alert']('"with', 'my', 'man"')
Run Node also seems to be broken? now when the conversation hits a run node, it doesn't run the node, the conversation stops, but the controls don't unlock as though the conversation is over. I can fix this manually by changing the Links To: Node from <START> to the node after it, but that's not the way it's importing.
The command works if the string is only one word long, but if it's longer, it tries to send each word through as a different argument - it becomes this: _G['alert']('"with', 'my', 'man"')
Run Node also seems to be broken? now when the conversation hits a run node, it doesn't run the node, the conversation stops, but the controls don't unlock as though the conversation is over. I can fix this manually by changing the Links To: Node from <START> to the node after it, but that's not the way it's importing.
Re: Yarn 1.2.7
Hmm, I'll need to take a look at that case for the Run Node. I'll let you know what I find.
What is the command that results in: _G['alert']('"with', 'my', 'man"')
What is the command that results in: _G['alert']('"with', 'my', 'man"')
-
- Posts: 83
- Joined: Wed Jun 24, 2020 5:06 pm
Re: Yarn 1.2.7
Thanks!
It's <<alarm "with my man">>
<<alarm "with">> works fine, no errors.
The <<wait 1>> command has also gone weird. It's writing Delay(1) in the Sequence, but it just hangs up there - actually this has nothing to do with the new programming, it's because I changed the Continue button from "never" to "always"
It's <<alarm "with my man">>
<<alarm "with">> works fine, no errors.
The <<wait 1>> command has also gone weird. It's writing Delay(1) in the Sequence, but it just hangs up there - actually this has nothing to do with the new programming, it's because I changed the Continue button from "never" to "always"
Re: Yarn 1.2.7
How would you propose handling this. The corresponding dialogue entry node will delay for 1 second, but then the node will also wait for the player to click the continue button.gblekkenhorst wrote: ↑Fri Sep 30, 2022 10:35 pmThe <<wait 1>> command has also gone weird. It's writing Delay(1) in the Sequence, but it just hangs up there - actually this has nothing to do with the new programming, it's because I changed the Continue button from "never" to "always"
-
- Posts: 83
- Joined: Wed Jun 24, 2020 5:06 pm
Re: Yarn 1.2.7
I got it working like this:
For now I'm just hard coding the time to wait into the function, because if I try to pass it as an argument I am still getting this error:
(Int not float works, when I tried float the pause stopped working.)
I'm trying to print a variable in the dialogue, Variable["carFundTotal"] throws the error 'expecting FORMAT_FUNCTION_ID' and $carFundTotal just prints $carFundTotal.
Code: Select all
public void Pause()
{
int time = 1;
StartCoroutine(StartWait(time));
}
public IEnumerator StartWait(inttime)
{
DialogueManager.instance.gameObject.GetComponentInChildren<Canvas>().enabled = false;
yield return new WaitForSeconds(time);
DialogueManager.instance.gameObject.GetComponentInChildren<Canvas>().enabled = true;
}
Code: Select all
ArgumentException: Object of type 'System.String' cannot be converted to type 'System.Int32'.
I'm trying to print a variable in the dialogue, Variable["carFundTotal"] throws the error 'expecting FORMAT_FUNCTION_ID' and $carFundTotal just prints $carFundTotal.
Last edited by gblekkenhorst on Thu Oct 06, 2022 7:50 pm, edited 1 time in total.
Re: Yarn 1.2.7
Hi,
Sorry for the delay getting a final answer on that other issue. I'll update you on it when I have an answer.
Would you also please click on that ArgumentException line in the Console, press Ctrl+C to copy its details to the clipboard, then paste them here?
The card fund total is {$carFundTotal} dollars.
Sorry for the delay getting a final answer on that other issue. I'll update you on it when I have an answer.
What is the command with the argument? Can you paste it here so I can test something similar? The patch should have fixed that.gblekkenhorst wrote: ↑Thu Oct 06, 2022 7:30 pmFor now I'm just hard coding the time to wait into the function, because if I try to pass it as an argument I am still getting this error:
Code: Select all
ArgumentException: Object of type 'System.String' cannot be converted to type 'System.Single'.
Would you also please click on that ArgumentException line in the Console, press Ctrl+C to copy its details to the clipboard, then paste them here?
Have you tried putting the variable in curly braces? Example:gblekkenhorst wrote: ↑Thu Oct 06, 2022 7:30 pmI'm trying to print a variable in the dialogue, Variable["carFundTotal"] throws the error 'expecting FORMAT_FUNCTION_ID' and $carFundTotal just prints $carFundTotal.
The card fund total is {$carFundTotal} dollars.
-
- Posts: 83
- Joined: Wed Jun 24, 2020 5:06 pm
Re: Yarn 1.2.7
I switched this back to int because float wasn't working:
Command with the argument:
using <<pause 1>>
Here are the errors:
Curly brackets around the variables worked, thanks!
Command with the argument:
using <<pause 1>>
Code: Select all
public void Pause(int time)
{
// int time = 10;
StartCoroutine(StartWait(time));
}
public IEnumerator StartWait(int time)
{
DialogueManager.instance.gameObject.GetComponentInChildren<Canvas>().enabled = false;
yield return new WaitForSeconds(time);
DialogueManager.instance.gameObject.GetComponentInChildren<Canvas>().enabled = true;
}
Code: Select all
ArgumentException: Object of type 'System.Single' cannot be converted to type 'System.Int32'.
System.RuntimeType.CheckValue (System.Object value, System.Reflection.Binder binder, System.Globalization.CultureInfo culture, System.Reflection.BindingFlags invokeAttr) (at <eae584ce26bc40229c1b1aa476bfa589>:0)
System.Reflection.MonoMethod.ConvertValues (System.Reflection.Binder binder, System.Object[] args, System.Reflection.ParameterInfo[] pinfo, System.Globalization.CultureInfo culture, System.Reflection.BindingFlags invokeAttr) (at <eae584ce26bc40229c1b1aa476bfa589>:0)
System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <eae584ce26bc40229c1b1aa476bfa589>:0)
System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at <eae584ce26bc40229c1b1aa476bfa589>:0)
Language.Lua.LuaMethodFunction.InvokeMethod (Language.Lua.LuaValue[] args) (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/Lua/Lua Interpreter/LuaValue/LuaMethodFunction.cs:35)
UnityEngine.Debug:LogException(Exception)
Language.Lua.LuaMethodFunction:InvokeMethod(LuaValue[]) (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/Lua/Lua Interpreter/LuaValue/LuaMethodFunction.cs:40)
Language.Lua.FunctionCall:Evaluate(LuaValue, LuaTable) (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/Lua/Lua Interpreter/Expr/FunctionCall.cs:41)
Language.Lua.PrimaryExpr:Evaluate(LuaTable) (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/Lua/Lua Interpreter/Expr/PrimaryExpr.cs:15)
Language.Lua.ExprStmt:Execute(LuaTable, Boolean&) (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/Lua/Lua Interpreter/Chunk/ExprStmt.cs:11)
Language.Lua.Chunk:Execute(Boolean&) (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/Lua/Lua Interpreter/Chunk/Chunk.cs:42)
Language.Lua.Chunk:Execute() (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/Lua/Lua Interpreter/Chunk/Chunk.cs:15)
Language.Lua.LuaInterpreter:Interpreter(String, LuaTable) (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/Lua/Lua Interpreter/LuaInterpreter.cs:38)
PixelCrushers.DialogueSystem.Lua:RunRaw(String, Boolean, Boolean) (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/Lua/Lua Wrapper/Lua Interpreter/Lua.cs:223)
PixelCrushers.DialogueSystem.Lua:Run(String, Boolean, Boolean) (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/Lua/Lua Wrapper/Lua Interpreter/Lua.cs:129)
PixelCrushers.DialogueSystem.ConversationModel:GetState(DialogueEntry, Boolean, Boolean, Boolean) (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/MVC/Model/Logic/Model/ConversationModel.cs:234)
PixelCrushers.DialogueSystem.ConversationModel:GetState(DialogueEntry) (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/MVC/Model/Logic/Model/ConversationModel.cs:304)
PixelCrushers.DialogueSystem.ConversationController:OnFinishedSubtitle(Object, EventArgs) (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/MVC/Controller/ConversationController.cs:270)
PixelCrushers.DialogueSystem.ConversationView:FinishSubtitle() (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/MVC/View/View/ConversationView.cs:428)
PixelCrushers.DialogueSystem.ConversationView:HandleContinueButtonClick() (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/MVC/View/View/ConversationView.cs:400)
PixelCrushers.DialogueSystem.ConversationView:OnConversationContinue(IDialogueUI) (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/MVC/View/View/ConversationView.cs:383)
UnityEngine.Component:SendMessage(String, Object, SendMessageOptions)
PixelCrushers.DialogueSystem.AbstractDialogueUI:OnContinueConversation() (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/UI/Abstract/Dialogue/AbstractDialogueUI.cs:366)
PixelCrushers.DialogueSystem.AbstractDialogueUI:OnContinue() (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/UI/Abstract/Dialogue/AbstractDialogueUI.cs:356)
PixelCrushers.DialogueSystem.StandardUIContinueButtonFastForward:OnFastForward() (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/UI/Standard/Effects/StandardUIContinueButtonFastForward.cs:75)
UnityEngine.EventSystems.EventSystem:Update() (at C:/Program Files/UnityEditors/2020.2.6f1/Editor/Data/Resources/PackageManager/BuiltInPackages/com.unity.ugui/Runtime/EventSystem/EventSystem.cs:385)
Code: Select all
Dialogue System: Lua code '_G['pause'](1)
' threw exception 'Object of type 'System.Single' cannot be converted to type 'System.Int32'.'
UnityEngine.Debug:LogError (object)
PixelCrushers.DialogueSystem.Lua:RunRaw (string,bool,bool) (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/Lua/Lua Wrapper/Lua Interpreter/Lua.cs:228)
PixelCrushers.DialogueSystem.Lua:Run (string,bool,bool) (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/Lua/Lua Wrapper/Lua Interpreter/Lua.cs:129)
PixelCrushers.DialogueSystem.ConversationModel:GetState (PixelCrushers.DialogueSystem.DialogueEntry,bool,bool,bool) (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/MVC/Model/Logic/Model/ConversationModel.cs:234)
PixelCrushers.DialogueSystem.ConversationModel:GetState (PixelCrushers.DialogueSystem.DialogueEntry) (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/MVC/Model/Logic/Model/ConversationModel.cs:304)
PixelCrushers.DialogueSystem.ConversationController:OnFinishedSubtitle (object,System.EventArgs) (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/MVC/Controller/ConversationController.cs:270)
PixelCrushers.DialogueSystem.ConversationView:FinishSubtitle () (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/MVC/View/View/ConversationView.cs:428)
PixelCrushers.DialogueSystem.ConversationView:HandleContinueButtonClick () (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/MVC/View/View/ConversationView.cs:400)
PixelCrushers.DialogueSystem.ConversationView:OnConversationContinue (PixelCrushers.DialogueSystem.IDialogueUI) (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/MVC/View/View/ConversationView.cs:383)
PixelCrushers.DialogueSystem.AbstractDialogueUI:OnContinueConversation () (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/UI/Abstract/Dialogue/AbstractDialogueUI.cs:366)
PixelCrushers.DialogueSystem.AbstractDialogueUI:OnContinue () (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/UI/Abstract/Dialogue/AbstractDialogueUI.cs:356)
PixelCrushers.DialogueSystem.StandardUIContinueButtonFastForward:OnFastForward () (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/UI/Standard/Effects/StandardUIContinueButtonFastForward.cs:75)
UnityEngine.EventSystems.EventSystem:Update () (at C:/Program Files/UnityEditors/2020.2.6f1/Editor/Data/Resources/PackageManager/BuiltInPackages/com.unity.ugui/Runtime/EventSystem/EventSystem.cs:385)
Re: Yarn 1.2.7
Hi,
Try changing this:
to this:
Then I think you should be able to use <<pause 1>>
Try changing this:
Code: Select all
public void Pause(int time)
Code: Select all
public void Pause(double time)