Still some errors:
This is my yarn:
Code: Select all
Thought: Alrighty. If I want to get this old car fixed up, I'm going to have to earn some money.
<<set $carFundLeft to $carFundTotal - $carFund>>
Thought: I'm SO close, just ${$carFundLeft} to go - a few gigs should do it.
Thought: Better check my MP3 player is juiced up before I head out.
<<bringUpMP3>>
<<pause 2>>
Thought: Looks good! I got some new stuff on here, I'm excited to check out the new playlists.
<<alert {"Hit 'Q' to open and close your MP3 player"}>>
<<alert "Hit 'Q' to open and close your MP3 player">>
//<<addQuest "paperQuest" "Extra Extra" "Deliver papers for Zane's paper route." "You've delivered all of the papers!" "You missed the deadline and Zane's customers are upset with you both.">>
Here's what I'm getting:
{$carFundLeft} is just printing as {$0}. This started before 10-11a, I noticed it in our build last night before I added it.
pause works great!
alert 1:
Code: Select all
Dialogue System: Lua code 'local run_cmd_args = EvaluateYarnExpression({ 'Hit 'Q' to open and close your MP3 player' })
_G['alert'](run_cmd_args[1])
' threw exception 'Code has syntax errors:
Line 1, Col 45 '{': Failed to parse Expr of GroupExpr.
Line 1, Col 44 '(': Failed to parse Letter of Name.
Line 1, Col 44 '(': Failed to parse Name of VarName.
Line 1, Col 44 '(': Failed to parse 'nil' of NilLiteral.
Line 1, Col 44 '(': Failed to parse Text of BoolLiteral.
Line 1, Col 44 '(': Failed to parse '0'...'9' of Digit.
Line 1, Col 44 '(': Failed to parse (Digit)+ of FloatNumber.
Line 1, Col 44 '(': Failed to parse Name of VariableArg.
Line 1, Col 44 '(': Failed to parse firstTerm of OperatorExpr.
Line 1, Col 44 '(': Failed to parse Expr of ExprStmt.
Line 1, Col 44 '(': Failed to parse remaining input.
'
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)
Alert 2 I'm obviously coding wrong, just wanted to check
Code: Select all
Dialogue System: Lua code '_G['alert'](' "', 'Hit', 'Q', 'to', 'open', 'and', 'close', 'your', 'MP3', 'player', '"')
' threw exception 'Number of parameters specified does not match the expected number.'
UnityEngine.Debug:LogError (object)
I also added some stuff to YarnConverter.cs that I think are helpful!
And the RUN nodes don't have the continue sequence they're presenting as an invisible dialogue box, but I figured out how to fix it! I added this to 1111:
Code: Select all
dlgEntry.Sequence = EntrySequence.ContinueDialogue;
I added in some code at 1032 to be able to access some of the Sequencer commands from Yarn
Code: Select all
else if (cmdName == "seq")
{
var dlgEntry = CreateDialogueEntry(conversation, title, desc);
var cmdType = cmdTokens.Length > 1 ? cmdTokens[1] : "0";
var cmdTypeString = "";
switch (cmdType)
{
case "LookAt":
cmdTypeString = "LookAt(" + cmdTokens[2] + "," + cmdTokens[3] + ");\n Continue();";
break;
case "SetActive": // only works to disable
cmdTypeString = "SetActive(" + cmdTokens[2] + "," + cmdTokens[3] + "); \n Continue();";
break;
default:
cmdTypeString = "";
break;
}
if (cmdTypeString != "")
{
dlgEntry.Sequence = String.Format(cmdTypeString);
dlgEntry.Title = "Run " + cmdType;
basicStmt.AddDialogueEntry(dlgEntry);
}
}
this is accessible through calling
Code: Select all
<<seq LookAt Car Zane>>
<<seq SetActive Zane false>>
I tried doing ShowAlert, but I couldn't do it because I haven't figured out how to pass a string from Yarn. You can't set active to true, even though Zane is not involved in this conversation. I think the sequences are still useful!