daterre / cradle Goto Github PK
View Code? Open in Web Editor NEWPlay Twine stories in Unity.
License: MIT License
Play Twine stories in Unity.
License: MIT License
I'm trying to make a story that persists between scenes, so i can use different scenes for different sets / locations, but still have one .twee story overarching.
when i load a new scene, even if the story gameObject & my twine player are set to "dont destroy on load", i can't advance the story and my twine player is empty.
when i call Advance() i get a keynotfoundexception, even if i call Reset() just before.
any idea how to use a story over multiple scenes?
this is super exciting can't wait to start digging into it- thanks!
Hi!
I am having thoses bugs when i switch the platform to mobile.
UNetWeaver error: Exception :System.MissingMethodException: Method not found: 'Mono.Cecil.ModuleDefinition.ImportReference'.
at Unity.UNetWeaver.Weaver.Weave (System.String assName, IEnumerable1 dependencies, IAssemblyResolver assemblyResolver, System.String unityEngineDLLPath, System.String unityUNetDLLPath, System.String outputDir) [0x00050] in /Users/builduser/buildslave/unity/build/Extensions/Networking/Weaver/UNetWeaver.cs:1714 at Unity.UNetWeaver.Weaver.WeaveAssemblies (IEnumerable
1 assemblies, IEnumerable1 dependencies, IAssemblyResolver assemblyResolver, System.String outputDir, System.String unityEngineDLLPath, System.String unityUNetDLLPath) [0x0006e] in /Users/builduser/buildslave/unity/build/Extensions/Networking/Weaver/UNetWeaver.cs:1837 UnityEngine.Debug:LogError(Object) Unity.UNetWeaver.Log:Error(String) (at /Users/builduser/buildslave/unity/build/Extensions/Networking/Weaver/Program.cs:20) Unity.UNetWeaver.Weaver:WeaveAssemblies(IEnumerable
1, IEnumerable1, IAssemblyResolver, String, String, String) (at /Users/builduser/buildslave/unity/build/Extensions/Networking/Weaver/UNetWeaver.cs:1844) Unity.UNetWeaver.Program:Process(String, String, String, String[], String[], IAssemblyResolver, Action
1, Action`1) (at /Users/builduser/buildslave/unity/build/Extensions/Networking/Weaver/Program.cs:34)
UnityEditor.Scripting.Serialization.Weaver:WeaveUnetFromEditor(String, String, String, String, Boolean)
Failure generating network code.
UnityEditor.Scripting.Serialization.Weaver:WeaveUnetFromEditor(String, String, String, String, Boolean)
Please Help
I'm using the following in the latest Twine and Cradle versions:
$test
<<set $test to 1>>
<<if $test is 1>>
test is 1
<<else>>
test is not 1
<<endif>>
However, when Cradle generates the class for this there doesn't appear to be any conditional logic in there, and when I debug the GetCurrentText() in my OnStateChanged handler, the following is logged:
test is 1
test is not 1
Am I doing something wrong here?
Asked via email:
I want to create a macro similar to <<print $var>> in that it results in the function being replaced with text in that part of the passage, but get a reference to the resulting StoryOutput in C#. Hoping that I can use this kind of thing to make StoryLinks with weird behaviors.
For example, if I make a custom macro <<textOutput param1, param2>>, in C# the function I'd like to implement that with:
[RuntimeMacro]
public void multilink (StoryOutput resultingOutput, string param1, string param2)
{
// resultingOutput is the StoryOutput this macro generates
}
Is this kind of thing possible with Cradle at the moment?
Is Harlowe supported? If so, what portions? It's unclear whether Harlowe is the preferred format, an untested format, or a feature that's not implemented yet.
Using
(live: 10s)[(go-to:"newPassage")(stop:)]
results in going to newPassage immediately, not after a 10s wait.
Requires move passageN_init calls to the generated story strip constructor. Then story.Passages will be populated in the editor and a drop-down can be shown.
I am trying to import my twine file, but it wont accept it, and it wont import it as a C# file either. Where am I supposed to put it? Sorry, I am not very good with unity/twine, and I just can't get this thing to work.
Assets/Plugins/UnityTwine/Editor/TweeAssetProcessor.cs(32,80): error CS0117: System.IO.File' does not contain a definition for
ReadAllText'
How to fix?
Any idea?
I rewrote my twine 2.0 story in twine 1.0 sugarcube and removed all the incompatible functions and I have ended up with a huge number of errors. Where on earth am I going wrong?
Here is the compiled CS
LightyearWorkingV.cs.txt
<(Filename: Assets/LightyearWorkingV.cs Line: 159)
Assets/LightyearWorkingV.cs(159,254): error CS1525: Unexpected symbol `)', expecting `;'
(Filename: Assets/LightyearWorkingV.cs Line: 159)
Assets/LightyearWorkingV.cs(189,76): error CS1525: Unexpected symbol `<<'
(Filename: Assets/LightyearWorkingV.cs Line: 189)
Assets/LightyearWorkingV.cs(305,254): error CS1525: Unexpected symbol `.'
(Filename: Assets/LightyearWorkingV.cs Line: 305)
Assets/LightyearWorkingV.cs(306,0): error CS1010: Newline in constant
(Filename: Assets/LightyearWorkingV.cs Line: 306)
Assets/LightyearWorkingV.cs(307,0): error CS1010: Newline in constant
(Filename: Assets/LightyearWorkingV.cs Line: 307)
Assets/LightyearWorkingV.cs(308,0): error CS1010: Newline in constant
(Filename: Assets/LightyearWorkingV.cs Line: 308)
Assets/LightyearWorkingV.cs(308,50): error CS1012: Too many characters in character literal
(Filename: Assets/LightyearWorkingV.cs Line: 308)
Assets/LightyearWorkingV.cs(309,0): error CS1010: Newline in constant
(Filename: Assets/LightyearWorkingV.cs Line: 309)
Assets/LightyearWorkingV.cs(310,0): error CS1010: Newline in constant
(Filename: Assets/LightyearWorkingV.cs Line: 310)
Assets/LightyearWorkingV.cs(311,0): error CS1010: Newline in constant
(Filename: Assets/LightyearWorkingV.cs Line: 311)
Assets/LightyearWorkingV.cs(312,0): error CS1010: Newline in constant
(Filename: Assets/LightyearWorkingV.cs Line: 312)
Assets/LightyearWorkingV.cs(313,0): error CS1010: Newline in constant
(Filename: Assets/LightyearWorkingV.cs Line: 313)
Assets/LightyearWorkingV.cs(314,0): error CS1010: Newline in constant
(Filename: Assets/LightyearWorkingV.cs Line: 314)
Assets/LightyearWorkingV.cs(315,0): error CS1010: Newline in constant
(Filename: Assets/LightyearWorkingV.cs Line: 315)
Assets/LightyearWorkingV.cs(316,0): error CS1010: Newline in constant
(Filename: Assets/LightyearWorkingV.cs Line: 316)
Assets/LightyearWorkingV.cs(317,0): error CS1010: Newline in constant
(Filename: Assets/LightyearWorkingV.cs Line: 317)
Assets/LightyearWorkingV.cs(318,0): error CS1010: Newline in constant
(Filename: Assets/LightyearWorkingV.cs Line: 318)
Assets/LightyearWorkingV.cs(319,0): error CS1010: Newline in constant
(Filename: Assets/LightyearWorkingV.cs Line: 319)
Assets/LightyearWorkingV.cs(320,0): error CS1010: Newline in constant
(Filename: Assets/LightyearWorkingV.cs Line: 320)
Assets/LightyearWorkingV.cs(321,0): error CS1010: Newline in constant
(Filename: Assets/LightyearWorkingV.cs Line: 321)
Assets/LightyearWorkingV.cs(322,0): error CS1010: Newline in constant
(Filename: Assets/LightyearWorkingV.cs Line: 322)
Assets/LightyearWorkingV.cs(323,0): error CS1010: Newline in constant
(Filename: Assets/LightyearWorkingV.cs Line: 323)
Assets/LightyearWorkingV.cs(324,0): error CS1010: Newline in constant
(Filename: Assets/LightyearWorkingV.cs Line: 324)
Assets/LightyearWorkingV.cs(325,0): error CS1010: Newline in constant
(Filename: Assets/LightyearWorkingV.cs Line: 325)
Assets/LightyearWorkingV.cs(326,0): error CS1010: Newline in constant
(Filename: Assets/LightyearWorkingV.cs Line: 326)
Assets/LightyearWorkingV.cs(327,0): error CS1010: Newline in constant
(Filename: Assets/LightyearWorkingV.cs Line: 327)
Assets/LightyearWorkingV.cs(328,0): error CS1010: Newline in constant
(Filename: Assets/LightyearWorkingV.cs Line: 328)
Assets/LightyearWorkingV.cs(329,0): error CS1010: Newline in constant
(Filename: Assets/LightyearWorkingV.cs Line: 329)
Assets/LightyearWorkingV.cs(330,0): error CS1010: Newline in constant
(Filename: Assets/LightyearWorkingV.cs Line: 330)
Assets/LightyearWorkingV.cs(331,0): error CS1010: Newline in constant
(Filename: Assets/LightyearWorkingV.cs Line: 331)
Assets/LightyearWorkingV.cs(332,0): error CS1010: Newline in constant
(Filename: Assets/LightyearWorkingV.cs Line: 332)
Assets/LightyearWorkingV.cs(333,0): error CS1010: Newline in constant
(Filename: Assets/LightyearWorkingV.cs Line: 333)
Assets/LightyearWorkingV.cs(334,0): error CS1010: Newline in constant
(Filename: Assets/LightyearWorkingV.cs Line: 334)
Assets/LightyearWorkingV.cs(335,0): error CS1010: Newline in constant
(Filename: Assets/LightyearWorkingV.cs Line: 335)
Assets/LightyearWorkingV.cs(336,0): error CS1010: Newline in constant
(Filename: Assets/LightyearWorkingV.cs Line: 336)
Assets/LightyearWorkingV.cs(337,0): error CS1010: Newline in constant
(Filename: Assets/LightyearWorkingV.cs Line: 337)
Assets/LightyearWorkingV.cs(338,0): error CS1010: Newline in constant
(Filename: Assets/LightyearWorkingV.cs Line: 338)
Assets/LightyearWorkingV.cs(339,0): error CS1010: Newline in constant
(Filename: Assets/LightyearWorkingV.cs Line: 339)
Assets/LightyearWorkingV.cs(340,0): error CS1010: Newline in constant
(Filename: Assets/LightyearWorkingV.cs Line: 340)
Assets/LightyearWorkingV.cs(341,0): error CS1010: Newline in constant
(Filename: Assets/LightyearWorkingV.cs Line: 341)
Assets/LightyearWorkingV.cs(342,0): error CS1010: Newline in constant
(Filename: Assets/LightyearWorkingV.cs Line: 342)
Assets/LightyearWorkingV.cs(343,0): error CS1010: Newline in constant
(Filename: Assets/LightyearWorkingV.cs Line: 343)
Assets/LightyearWorkingV.cs(344,0): error CS1010: Newline in constant
(Filename: Assets/LightyearWorkingV.cs Line: 344)
Assets/LightyearWorkingV.cs(345,0): error CS1010: Newline in constant
(Filename: Assets/LightyearWorkingV.cs Line: 345)
Assets/LightyearWorkingV.cs(346,0): error CS1010: Newline in constant
(Filename: Assets/LightyearWorkingV.cs Line: 346)
Assets/LightyearWorkingV.cs(347,0): error CS1010: Newline in constant
(Filename: Assets/LightyearWorkingV.cs Line: 347)
Assets/LightyearWorkingV.cs(348,0): error CS1010: Newline in constant
(Filename: Assets/LightyearWorkingV.cs Line: 348)
Assets/LightyearWorkingV.cs(349,0): error CS1010: Newline in constant
(Filename: Assets/LightyearWorkingV.cs Line: 349)
Assets/LightyearWorkingV.cs(350,0): error CS1010: Newline in constant
(Filename: Assets/LightyearWorkingV.cs Line: 350)
Assets/LightyearWorkingV.cs(493,27): error CS1525: Unexpected symbol `1', expecting `)', `,', `;', `[', or `='
(Filename: Assets/LightyearWorkingV.cs Line: 493)
Assets/LightyearWorkingV.cs(518,71): error CS1525: Unexpected symbol `<<'
(Filename: Assets/LightyearWorkingV.cs Line: 518)
Assets/LightyearWorkingV.cs(518,125): error CS1525: Unexpected symbol `<<'
(Filename: Assets/LightyearWorkingV.cs Line: 518)
Assets/LightyearWorkingV.cs(527,74): error CS1525: Unexpected symbol `<<'
(Filename: Assets/LightyearWorkingV.cs Line: 527)
Assets/LightyearWorkingV.cs(527,133): error CS1525: Unexpected symbol `<<'
(Filename: Assets/LightyearWorkingV.cs Line: 527)
Assets/LightyearWorkingV.cs(549,75): error CS1525: Unexpected symbol `<<'
(Filename: Assets/LightyearWorkingV.cs Line: 549)
Assets/LightyearWorkingV.cs(553,68): error CS1525: Unexpected symbol `<<'
(Filename: Assets/LightyearWorkingV.cs Line: 553)
Assets/LightyearWorkingV.cs(625,75): error CS1525: Unexpected symbol `<<'
(Filename: Assets/LightyearWorkingV.cs Line: 625)
Assets/LightyearWorkingV.cs(668,71): error CS1525: Unexpected symbol `<<'
(Filename: Assets/LightyearWorkingV.cs Line: 668)
Assets/LightyearWorkingV.cs(669,76): error CS1525: Unexpected symbol `<<'
(Filename: Assets/LightyearWorkingV.cs Line: 669)
Assets/LightyearWorkingV.cs(670,75): error CS1525: Unexpected symbol `<<'
(Filename: Assets/LightyearWorkingV.cs Line: 670)
Assets/LightyearWorkingV.cs(671,82): error CS1525: Unexpected symbol `<<'
(Filename: Assets/LightyearWorkingV.cs Line: 671)
Assets/LightyearWorkingV.cs(678,0): error CS1010: Newline in constant
(Filename: Assets/LightyearWorkingV.cs Line: 678)
Assets/LightyearWorkingV.cs(678,16): error CS0201: Only assignment, call, increment, decrement, and new object expressions can be used as a statement
(Filename: Assets/LightyearWorkingV.cs Line: 678)
Assets/LightyearWorkingV.cs(678,54): error CS1525: Unexpected symbol `) { yield return new TwineText(@', expecting `)', `,', `;', `[', or `='
(Filename: Assets/LightyearWorkingV.cs Line: 678)
Assets/LightyearWorkingV.cs(679,0): error CS1010: Newline in constant
(Filename: Assets/LightyearWorkingV.cs Line: 679)
Assets/LightyearWorkingV.cs(681,0): error CS1010: Newline in constant
(Filename: Assets/LightyearWorkingV.cs Line: 681)
Assets/LightyearWorkingV.cs(681,24): error CS1525: Unexpected symbol `275.619'
(Filename: Assets/LightyearWorkingV.cs Line: 681)
Assets/LightyearWorkingV.cs(683,0): error CS1010: Newline in constant
(Filename: Assets/LightyearWorkingV.cs Line: 683)
Assets/LightyearWorkingV.cs(683,24): error CS1525: Unexpected symbol `412.542'
(Filename: Assets/LightyearWorkingV.cs Line: 683)
Assets/LightyearWorkingV.cs(685,0): error CS1010: Newline in constant
(Filename: Assets/LightyearWorkingV.cs Line: 685)
Assets/LightyearWorkingV.cs(685,24): error CS1525: Unexpected symbol `512.223'
(Filename: Assets/LightyearWorkingV.cs Line: 685)
Assets/LightyearWorkingV.cs(692,14): error CS0116: A namespace can only contain types and namespace declarations
(Filename: Assets/LightyearWorkingV.cs Line: 692)
Assets/LightyearWorkingV.cs(697,34): error CS0116: A namespace can only contain types and namespace declarations
(Filename: Assets/LightyearWorkingV.cs Line: 697)
Assets/LightyearWorkingV.cs(705,14): error CS0116: A namespace can only contain types and namespace declarations
(Filename: Assets/LightyearWorkingV.cs Line: 705)
Assets/LightyearWorkingV.cs(710,34): error CS0116: A namespace can only contain types and namespace declarations
(Filename: Assets/LightyearWorkingV.cs Line: 710)
Assets/LightyearWorkingV.cs(725,14): error CS0116: A namespace can only contain types and namespace declarations
(Filename: Assets/LightyearWorkingV.cs Line: 725)
Assets/LightyearWorkingV.cs(730,34): error CS0116: A namespace can only contain types and namespace declarations
(Filename: Assets/LightyearWorkingV.cs Line: 730)
Assets/LightyearWorkingV.cs(740,14): error CS0116: A namespace can only contain types and namespace declarations
(Filename: Assets/LightyearWorkingV.cs Line: 740)
Assets/LightyearWorkingV.cs(745,34): error CS0116: A namespace can only contain types and namespace declarations
(Filename: Assets/LightyearWorkingV.cs Line: 745)
Assets/LightyearWorkingV.cs(756,14): error CS0116: A namespace can only contain types and namespace declarations
(Filename: Assets/LightyearWorkingV.cs Line: 756)
Assets/LightyearWorkingV.cs(761,34): error CS0116: A namespace can only contain types and namespace declarations
(Filename: Assets/LightyearWorkingV.cs Line: 761)
Assets/LightyearWorkingV.cs(769,14): error CS0116: A namespace can only contain types and namespace declarations
(Filename: Assets/LightyearWorkingV.cs Line: 769)
Assets/LightyearWorkingV.cs(774,34): error CS0116: A namespace can only contain types and namespace declarations
(Filename: Assets/LightyearWorkingV.cs Line: 774)
Assets/LightyearWorkingV.cs(784,14): error CS0116: A namespace can only contain types and namespace declarations
(Filename: Assets/LightyearWorkingV.cs Line: 784)
Assets/LightyearWorkingV.cs(789,34): error CS0116: A namespace can only contain types and namespace declarations
(Filename: Assets/LightyearWorkingV.cs Line: 789)
Assets/LightyearWorkingV.cs(798,14): error CS0116: A namespace can only contain types and namespace declarations
(Filename: Assets/LightyearWorkingV.cs Line: 798)
Assets/LightyearWorkingV.cs(803,34): error CS0116: A namespace can only contain types and namespace declarations
(Filename: Assets/LightyearWorkingV.cs Line: 803)
Assets/LightyearWorkingV.cs(811,14): error CS0116: A namespace can only contain types and namespace declarations
(Filename: Assets/LightyearWorkingV.cs Line: 811)
Assets/LightyearWorkingV.cs(816,34): error CS0116: A namespace can only contain types and namespace declarations
(Filename: Assets/LightyearWorkingV.cs Line: 816)
Assets/LightyearWorkingV.cs(824,14): error CS0116: A namespace can only contain types and namespace declarations
(Filename: Assets/LightyearWorkingV.cs Line: 824)
Assets/LightyearWorkingV.cs(829,34): error CS0116: A namespace can only contain types and namespace declarations
(Filename: Assets/LightyearWorkingV.cs Line: 829)
Assets/LightyearWorkingV.cs(839,14): error CS0116: A namespace can only contain types and namespace declarations
(Filename: Assets/LightyearWorkingV.cs Line: 839)
Assets/LightyearWorkingV.cs(847,52): error CS1525: Unexpected symbol `<<'
(Filename: Assets/LightyearWorkingV.cs Line: 847)
Assets/LightyearWorkingV.cs(844,34): error CS0116: A namespace can only contain types and namespace declarations
(Filename: Assets/LightyearWorkingV.cs Line: 844)
Assets/LightyearWorkingV.cs(855,14): error CS0116: A namespace can only contain types and namespace declarations
(Filename: Assets/LightyearWorkingV.cs Line: 855)
Assets/LightyearWorkingV.cs(860,34): error CS0116: A namespace can only contain types and namespace declarations
(Filename: Assets/LightyearWorkingV.cs Line: 860)
Assets/LightyearWorkingV.cs(868,14): error CS0116: A namespace can only contain types and namespace declarations
(Filename: Assets/LightyearWorkingV.cs Line: 868)
Assets/LightyearWorkingV.cs(873,34): error CS0116: A namespace can only contain types and namespace declarations
(Filename: Assets/LightyearWorkingV.cs Line: 873)
Assets/LightyearWorkingV.cs(889,14): error CS0116: A namespace can only contain types and namespace declarations
(Filename: Assets/LightyearWorkingV.cs Line: 889)
Assets/LightyearWorkingV.cs(894,34): error CS0116: A namespace can only contain types and namespace declarations
(Filename: Assets/LightyearWorkingV.cs Line: 894)
Assets/LightyearWorkingV.cs(902,14): error CS0116: A namespace can only contain types and namespace declarations
(Filename: Assets/LightyearWorkingV.cs Line: 902)
Assets/LightyearWorkingV.cs(907,34): error CS0116: A namespace can only contain types and namespace declarations
(Filename: Assets/LightyearWorkingV.cs Line: 907)
Assets/LightyearWorkingV.cs(915,14): error CS0116: A namespace can only contain types and namespace declarations
(Filename: Assets/LightyearWorkingV.cs Line: 915)
Assets/LightyearWorkingV.cs(923,75): error CS1525: Unexpected symbol `<<'
(Filename: Assets/LightyearWorkingV.cs Line: 923)
Assets/LightyearWorkingV.cs(920,34): error CS0116: A namespace can only contain types and namespace declarations
(Filename: Assets/LightyearWorkingV.cs Line: 920)
Assets/LightyearWorkingV.cs(931,14): error CS0116: A namespace can only contain types and namespace declarations
(Filename: Assets/LightyearWorkingV.cs Line: 931)
Assets/LightyearWorkingV.cs(936,34): error CS0116: A namespace can only contain types and namespace declarations
(Filename: Assets/LightyearWorkingV.cs Line: 936)
Assets/LightyearWorkingV.cs(946,14): error CS0116: A namespace can only contain types and namespace declarations
(Filename: Assets/LightyearWorkingV.cs Line: 946)
Assets/LightyearWorkingV.cs(951,34): error CS0116: A namespace can only contain types and namespace declarations
(Filename: Assets/LightyearWorkingV.cs Line: 951)
Assets/LightyearWorkingV.cs(959,14): error CS0116: A namespace can only contain types and namespace declarations
(Filename: Assets/LightyearWorkingV.cs Line: 959)
Assets/LightyearWorkingV.cs(964,34): error CS0116: A namespace can only contain types and namespace declarations
(Filename: Assets/LightyearWorkingV.cs Line: 964)
Assets/LightyearWorkingV.cs(972,14): error CS0116: A namespace can only contain types and namespace declarations
(Filename: Assets/LightyearWorkingV.cs Line: 972)
Assets/LightyearWorkingV.cs(977,34): error CS0116: A namespace can only contain types and namespace declarations
(Filename: Assets/LightyearWorkingV.cs Line: 977)
Assets/LightyearWorkingV.cs(989,14): error CS0116: A namespace can only contain types and namespace declarations
(Filename: Assets/LightyearWorkingV.cs Line: 989)
Assets/LightyearWorkingV.cs(994,34): error CS0116: A namespace can only contain types and namespace declarations
(Filename: Assets/LightyearWorkingV.cs Line: 994)
Assets/LightyearWorkingV.cs(1004,14): error CS0116: A namespace can only contain types and namespace declarations
(Filename: Assets/LightyearWorkingV.cs Line: 1004)
Assets/LightyearWorkingV.cs(1009,34): error CS0116: A namespace can only contain types and namespace declarations
(Filename: Assets/LightyearWorkingV.cs Line: 1009)
Assets/LightyearWorkingV.cs(1021,14): error CS0116: A namespace can only contain types and namespace declarations
(Filename: Assets/LightyearWorkingV.cs Line: 1021)
Assets/LightyearWorkingV.cs(1026,34): error CS0116: A namespace can only contain types and namespace declarations
(Filename: Assets/LightyearWorkingV.cs Line: 1026)
Assets/LightyearWorkingV.cs(1038,14): error CS0116: A namespace can only contain types and namespace declarations
(Filename: Assets/LightyearWorkingV.cs Line: 1038)
Assets/LightyearWorkingV.cs(1043,34): error CS0116: A namespace can only contain types and namespace declarations
(Filename: Assets/LightyearWorkingV.cs Line: 1043)
Assets/LightyearWorkingV.cs(1052,14): error CS0116: A namespace can only contain types and namespace declarations
(Filename: Assets/LightyearWorkingV.cs Line: 1052)
Assets/LightyearWorkingV.cs(1062,75): error CS1525: Unexpected symbol `<<'
(Filename: Assets/LightyearWorkingV.cs Line: 1062)
Assets/LightyearWorkingV.cs(1070,68): error CS1525: Unexpected symbol `<<'
(Filename: Assets/LightyearWorkingV.cs Line: 1070)
Assets/LightyearWorkingV.cs(1057,34): error CS0116: A namespace can only contain types and namespace declarations
(Filename: Assets/LightyearWorkingV.cs Line: 1057)
Assets/LightyearWorkingV.cs(1073,46): error CS8025: Parsing error
I'm getting this funky error when I drag-drop my Harlowe formatted story into Unity. I know it's not my file because I've tried it with the example story files and it gives me the same error (in fact this error is from dragging Clockwork.html into the Assets folder.)
Win32Exception: ApplicationName='/Users/hughsato/PlantDialogue/Assets/Cradle/Editor/ThirdParty/PhantomJS/bin/osx/phantomjs', CommandLine='"phantom.js" "file:///Users/hughsato/PlantDialogue/Assets/Clockwork.html" "/Users/hughsato/PlantDialogue/Assets/Cradle/Editor/.js/StoryFormats/Harlowe/harlowe.bridge.js"', CurrentDirectory='/Users/hughsato/PlantDialogue/Assets/Cradle/Editor/.js'
System.Diagnostics.Process.Start_noshell (System.Diagnostics.ProcessStartInfo startInfo, System.Diagnostics.Process process)
System.Diagnostics.Process.Start_common (System.Diagnostics.ProcessStartInfo startInfo, System.Diagnostics.Process process)
System.Diagnostics.Process.Start ()
(wrapper remoting-invoke-with-check) System.Diagnostics.Process:Start ()
Cradle.Editor.Utils.PhantomJS.Run[HarloweStoryData](System.String url, System.String bridgeScriptPath, Boolean throwExOnError) (at /Users/daterre/Projects/UnityTwine/unity/UnityTwine/Assets/Cradle/.src/Cradle.Editor/Editor/Utils/PhantomJS.cs:36)
Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:232)
System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MethodBase.cs:115)
UnityEditor.AssetPostprocessingInternal.PostprocessAllAssets (System.String[] importedAssets, System.String[] addedAssets, System.String[] deletedAssets, System.String[] movedAssets, System.String[] movedFromPathAssets) (at /Users/builduser/buildslave/unity/build/Editor/Mono/AssetPostprocessor.cs:27)
UnityEditorInternal.InternalEditorUtility:ProjectWindowDrag(HierarchyProperty, Boolean)
UnityEditor.DockArea:OnGUI()
This is unanticipated behavior and should be changed. goto macros should continue execution.
I've been attempting to format story layout using the TwineTextPlayer and I haven't had much luck controlling the positioning and alignment of text. I've tried using all of the alignment controls, and none of them are working as I'd expect them to, except for padding. I also can't seem to get horizontal text overflow to wrap. Oftentimes I mess with the Content Size Fitter, which ends up irreversibly shifting the right border of my text to the far left, forcing me to revert the prefab.
Any idea what I could be doing wrong, or if this is a bug?
I should also mention I'm getting the following warning under the Content Size Fitter script:
"Parent has a type of layout group component. A child of a layout group should not have a Content Size Fitter component, since it should be driven by the layout group."
Just downloaded the latest Snapshot and opened it with Unity 5.6.1.
I'm getting the Following Error with your example Scenes.
NullReferenceException: Object reference not set to an instance of an object
Cradle.Story.get_CurrentPassageName () (at D:/Projects/UnityTwine/git/Assets/Cradle/.src/Cradle/Core/Story.cs:68)
StoryInspector.OnInspectorGUI () (at D:/Projects/UnityTwine/git/Assets/Cradle/.src/Cradle.Editor/Editor/StoryInspector.cs:22)
UnityEditor.InspectorWindow.DrawEditor (UnityEditor.Editor editor, Int32 editorIndex, Boolean rebuildOptimizedGUIBlock, System.Boolean& showImportedObjectBarNext, UnityEngine.Rect& importedObjectBarRect) (at /Users/builduser/buildslave/unity/build/Editor/Mono/Inspector/InspectorWindow.cs:1229)
UnityEditor.DockArea:OnGUI()
This problem doesn't seem to be occuring with SugarCube formatted stories.
Essentially, at each line break of an imported Harlowe format story it adds the "Word" to the end of the line.
This is also happening for me with the 'Clockwork' example provided in the latest commit.
I don't totally understand why it isn't working, but I imported all of the Asset files from the latest commit and then attempted to bring in an .html twine file. I got a Win32Exception, posted below. I'd also be fine exporting to the twee format since that appears to have a parser in Cradle but have been unable to find any way to do that from Twine 2. If you know of a way that would be awesome. This is a really cool project, thanks!
Win32Exception: ApplicationName='/Users/Sam/gressenhall/sams-gressenhall/Assets/Cradle/Editor/ThirdParty/PhantomJS/bin/osx/phantomjs', CommandLine='"phantom.js_" "file:///Users/Sam/gressenhall/sams-gressenhall/Assets/PatrickKennedy.html" "/Users/Sam/gressenhall/sams-gressenhall/Assets/Cradle/Editor/js/StoryFormats/Harlowe/harlowe.bridge.js_"', CurrentDirectory='/Users/Sam/gressenhall/sams-gressenhall/Assets/Cradle/Editor/js'
System.Diagnostics.Process.Start_noshell (System.Diagnostics.ProcessStartInfo startInfo, System.Diagnostics.Process process)
System.Diagnostics.Process.Start_common (System.Diagnostics.ProcessStartInfo startInfo, System.Diagnostics.Process process)
System.Diagnostics.Process.Start ()
(wrapper remoting-invoke-with-check) System.Diagnostics.Process:Start ()
Cradle.Editor.Utils.PhantomJS.Run[HarloweStoryData](System.String url, System.String bridgeScriptPath, Boolean throwExOnError) (at d:/Projects/UnityTwine/git/Assets/Cradle/.src/Cradle.Editor/Editor/Utils/PhantomJS.cs:37)
Cradle.Editor.StoryFormats.Harlowe.HarloweTranscoder.Init () (at d:/Projects/UnityTwine/git/Assets/Cradle/.src/Cradle.Editor/Editor/StoryFormats/Harlowe/HarloweTranscoder.cs:113)
Cradle.Editor.StoryImporter.Transcode () (at d:/Projects/UnityTwine/git/Assets/Cradle/.src/Cradle.Editor/Editor/StoryImporter.cs:44)
Cradle.Editor.CradleAssetProcessor.OnPostprocessAllAssets (System.String[] importedAssets, System.String[] deletedAssets, System.String[] movedAssets, System.String[] movedFromAssetPaths) (at d:/Projects/UnityTwine/git/Assets/Cradle/.src/Cradle.Editor/Editor/CradleAssetProcessor.cs:82)
System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)
Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:232)
System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.Reflection/MethodBase.cs:115)
UnityEditor.AssetPostprocessingInternal.PostprocessAllAssets (System.String[] importedAssets, System.String[] addedAssets, System.String[] deletedAssets, System.String[] movedAssets, System.String[] movedFromPathAssets) (at /Users/builduser/buildslave/unity/build/Editor/Mono/AssetPostprocessor.cs:27)
UnityEditorInternal.InternalEditorUtility:ProjectWindowDrag(HierarchyProperty, Boolean)
UnityEditor.DockArea:OnGUI()
Hi, i want to use Cradle in Unity for Right to Left languages like Persian and Arabic. The words of my story looks good in output (Unity3D play mode) but direction of words is inverse.
For example : سلام بر شما is showing like : شما بر سلام.
I know that this issue is not from Unity3D because i used this languages in many projects.
Now, in TwineTextPlayer.cs there is a function named DisplayOutput. can i change text direction by change rules of using uiInsertIndex variable? it seems the words of story sentences showing in Text object one by one by last number of this variable.
Thanks!
Hello: I’ve been following your work on Cradle and thought I would try it out today. I have partially working things, but thought I would run by the group about whether I am doing things correctly and how to fix those problems I have run across.
Hi !
First of all, wonderful work. Cheers!
I'd like to ask if you can help me on having some improvements on data analysis. Or at least pointing out where and how I could add features. I'm working with writers that can't do without some of the expressions or variables in twine. I've already simplified a lot of stuff with them, but there is still two or three things I can't symplify. And I'm not that comfortable with regex and your code.
Those would be :
<<set $my_var = "Blablabla">>
or
<<set $my_var = false>>
--> when I compile, there does'nt seem to have default values to the extracted and parsed for variables. This is problematic. I guess it's doable with regex, but I can't find the proper way to do this without introducing a big dirty mess in your code ! :)
<<set $myVar = ["value1", "value2", "value3", "value4", "value5"]>>
they use it, in an "enum" way or something close enough. I managed to add the "array access style" in TwineVar, but I didn't manage to get the values given in twine.
Thanks a lot !
PS : I don't need full code, but if you could just say if it's possible, explain me how to do it and point out where, that would be awesome.
PS : they use sugarcube, then entweedle, with very basic syntax so that it's compatible with your plugin
variables and macros in links don't get converted to code, shows only the raw text aka. "Hi $name! How are you?". Something like "Hi "+ Vars.name + "! How are you?" would be expected
If they stay in the final script file, exceptions are reported in wrong files and line numbers.
I'm a complete newcomer to cradle, so bear with me.
I imported all of the files from the latest commit of Cradle to my project directory.
When I import a Harlowe format HTML to my assets folder, it's not being picked up by the editor and no C# script is being generated.
Am I going about this the wrong way? I followed the documentation as closely as possible.
This is a particular nuisance when working with source control and/or in a team environment because the files are constantly auto-imported by Unity and keep having changes in them, leading to conflicts and revision confusion.
Possible workarounds:
The event must be called before any output is generated.
Possible handler signature:
Story.OnVariableChanged(Story story, string varName, StoryVar newValue, StoryVar previousValue)
See #49 for use-case.
It would be a nice addition to have Sugar/Harlowe runtime macros receive a reference to the passage or story that calls it as a first attribute. So for example:
[Cradle.RuntimeMacro("setRoom")]
public void SetRoom (StoryPassage passage, string roomName)
{
// passage is automatically populated with the story passage which called this macro
}
This would be useful for scenes that use multiple stories where I want a macro do things that affect only the story responsible for executing it.
Hey there,
I created a really simple story in Twine2 to test this plugin. I followed the instructions for saving a Twee file using the Entweedle format.
Here is my story file: import_test.txt
Here is a screenshot of my project Asset hierarchy: https://monosnap.com/file/ROrbhuA949I0yldku0mDmVlBhhbvcx
In this case, "import_test.txt" is the story I imported. I've tried dragging it over and "Import New Asset..." but neither ever generate a C# script. I've also tried doing this at various levels in the hierarchy, like in the base Assets directory, down to the TwineTextPlayer directory.
What am I doing wrong? 😬
The docs say this supports twine 2 but I'm struggling to get it to work. The plugin does not recognise links between pages, I think it is because the .twee format syntax is different for 2.0 than 1.4.
On windows, when your unity project's path contains spaces, the story conversion from HTML to C# will fail and unity's console wil display the following 2 errors:
Bridge script could not be loaded: undefined
StoryImportException: HTML or JavaScript errors encountered in the Harlowe story. Does it load properly in a browser?
The current workaround is to remove spaces from your unity project's path.
In Twine, I've created the following blank-slate macro in a script passage titled "setTextDisplay":
macros['setTextDisplay'] = { handler: function() {} }
And I implemented it as a runtime macro in Unity:
using UnityEngine;
public class CustomRuntimeMacros : Cradle.RuntimeMacros
{
[Cradle.RuntimeMacro("setTextDisplay")]
public void SetTextDisplay (string displayName)
{
Debug.Log("Macro: SetTextDisplay");
}
}
However, when I implement this in a Twine (Sugarcane, Twine 1.4.2) passage with <<setTextDisplay "main">>
, the generated C# script places a passage
command:
IStoryThread passage12_Main()
{
yield return passage("setTextDisplay", "main");
yield return lineBreak();
yield break;
}
This doesn't seem like the intended functionality to me. I expect this should look to the runtime macro I specified, but that function is never called.
Publishing to File a Twine 2.0 story (Harlow) called 3 Bug Example or 3BugExample will result in a Story Conversion Fail. BugExample or Bug_Example works fine.
I have redone my whole story with SugarCube since the default (set: $thing to 1)[blabla] didn't work with UnityTwine. But now I get errors for all < < i f > > statements and all < < set $variable to 2 > >. Is there any way to get around that?
EDIT: Ok, so instead of $variable to 2 you have to to do set $variable = 2
I had issues when exporting a twine story with tags using Twine2 and Entweedle 1.0.2 format.
It seems that when a passage contains a tag, the parsing of the entire passage fails. When I switched to Twine 1 everything works as expected.
I suspect it's an issue with Entweedle 1.0.2 format.
I'm receiving the the following exception message when I publish a (very simple) test story (Harlowe) from Twine into Unity:
SystemException: Error running gmcs: Cannot find the specified file
Mono.CSharp.CSharpCodeCompiler.CompileFromFileBatch (System.CodeDom.Compiler.CompilerParameters options, System.String[] fileNames)
Mono.CSharp.CSharpCodeCompiler.CompileFromSourceBatch (System.CodeDom.Compiler.CompilerParameters options, System.String[] sources)
Mono.CSharp.CSharpCodeCompiler.CompileAssemblyFromSourceBatch (System.CodeDom.Compiler.CompilerParameters options, System.String[] sources)
System.CodeDom.Compiler.CodeDomProvider.CompileAssemblyFromSource (System.CodeDom.Compiler.CompilerParameters options, System.String[] fileNames)
Cradle.Editor.CradleAssetProcessor.OnPostprocessAllAssets (System.String[] importedAssets, System.String[] deletedAssets, System.String[] movedAssets, System.String[] movedFromAssetPaths) (at /Users/daterre/Projects/UnityTwine/unity/UnityTwine/Assets/Cradle/.src/Cradle.Editor/Editor/CradleAssetProcessor.cs:146)
System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)
Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters,
The story does open properly in a browser. Solution?
Something I'm trying to figure out how to implement is a way to have multiple Cradle stories get/set StoryVars from a shared location. This way, Cradle stories can share information with one another, or I can have scripts in my Unity scene listening to variables that a number of stories are affecting.
My initial thought is to have a singleton GlobalRuntimeVars
class and to add <<setGlobal $variable = "something">>
type setter/getter commands to access those shared variables.
So my question is: is adding those getter/setter macros easy to pry in with the current code base and where would I do that? Or is there a simpler way to go about this?
Thanks!
When attempting to build the DLL on macOS using MonoDevelop 5.9.6, I receive the error: The type or namespace 'HtmlTag' could not be found. Are you missing an assembly reference?
relating to method Story.htmlTag(StoryVar text)
.
This isn't seen on commit 4aa9c8b (Dec 4th, 2016), which is the version I've been working with thus far.
Possibly distinguish between PassageCue and TagCue attributes. This will make passage tagging very useful for adding consistent behavior accross passages.
EDIT: To anyone reading this, errors pertaining to the use of the proper compatible version of Unity start in the 3rd reply to this thread
Error 1:
Assets/Cradle/UnityTestTools/Examples/UnitTestExamples/Editor/SampleTests.cs(74,10): error CS0246: The type or namespace name `ExpectedException' could not be found. Are you missing an assembly reference?
Error 2 (this occurs on Twine HTML import):
Win32Exception: ApplicationName='D:/OneDrive/School/Senior Thesis/Project/Development/Unity/Uproot/Assets/Cradle/Editor/ThirdParty/PhantomJS/bin/win/phantomjs.exe', CommandLine='"phantom.js_" "file:///D:/OneDrive/School/Senior%20Thesis/Project/Development/Unity/Uproot/Assets/Twine/Day11.html" "D:/OneDrive/School/Senior Thesis/Project/Development/Unity/Uproot/Assets/Cradle/Editor/js/StoryFormats/Harlowe/harlowe.bridge.js_"', CurrentDirectory='D:/OneDrive/School/Senior Thesis/Project/Development/Unity/Uproot/Assets/Cradle/Editor/js'
System.Diagnostics.Process.Start_noshell (System.Diagnostics.ProcessStartInfo startInfo, System.Diagnostics.Process process)
System.Diagnostics.Process.Start_common (System.Diagnostics.ProcessStartInfo startInfo, System.Diagnostics.Process process)
System.Diagnostics.Process.Start ()
(wrapper remoting-invoke-with-check) System.Diagnostics.Process:Start ()
Cradle.Editor.Utils.PhantomJS.Run[HarloweStoryData] (System.String url, System.String bridgeScriptPath, Boolean throwExOnError) (at D:/Projects/UnityTwine/git/Assets/Cradle/.src/Cradle.Editor/Editor/Utils/PhantomJS.cs:37)
Cradle.Editor.StoryFormats.Harlowe.HarloweTranscoder.Init () (at D:/Projects/UnityTwine/git/Assets/Cradle/.src/Cradle.Editor/Editor/StoryFormats/Harlowe/HarloweTranscoder.cs:113)
Cradle.Editor.StoryImporter.Transcode () (at D:/Projects/UnityTwine/git/Assets/Cradle/.src/Cradle.Editor/Editor/StoryImporter.cs:44)
Cradle.Editor.CradleAssetProcessor.OnPostprocessAllAssets (System.String[] importedAssets, System.String[] deletedAssets, System.String[] movedAssets, System.String[] movedFromAssetPaths) (at D:/Projects/UnityTwine/git/Assets/Cradle/.src/Cradle.Editor/Editor/CradleAssetProcessor.cs:82)
System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)
Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:232)
System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MethodBase.cs:115)
UnityEditor.AssetPostprocessingInternal.PostprocessAllAssets (System.String[] importedAssets, System.String[] addedAssets, System.String[] deletedAssets, System.String[] movedAssets, System.String[] movedFromPathAssets) (at C:/buildslave/unity/build/Editor/Mono/AssetPostprocessor.cs:29)
Using Unity Beta 5.6.0b11. Any idea on how I can fix this? I can't import any Twine stories. Thanks in advance! I'm really looking forward to working with this plugin.
In Twine (at least in Sugarcane), when a set
incrementor macro is called like <<set $testVar += 1>>
when the variable $testVar
has not been previous set, that variable is automatically initialized with the value of 0
and is then incremented.
Currently in Cradle, this generates the line Vars.testVar += 1;
which, if testVar
hasn't been initialized yet, generates an error: VarTypeException: Cannot combine null with Int32 using Add.
I'm going to look into how this can be achieved, but wondering if you might have any insight into where you think would be a good place to start, @daterre?
Hi. We still have the problem, even if we update the craddle dlls :(
We still have hardcoded paths to /Users/Documents/Daterre/...
We also have tried those solutions : AngryAnt/Behave-release#21
Any hints ?
Thx !
Hi!
I'm brand new to unity and C# and I'm super excited to use UnityTwine for the game I'm working on! It looks amazing!
But no matter what I do I can't get my stories to import at C# scripts. I (think) I've followed the instructions to the letter for both Twine 2 and Twine 1.4 but no matter what I try they keep showing up as text files instead of C# scripts.
Any idea what I might be doing wrong?
Basically, what I've done is download UnityTwine into a folder on my desktop, start a new project in Unity 5, create a folder for the Unity Twine Assets in my project, drag the UnityTwine stuff into that folder in Unity, and then follow the instructions for importing a story to the letter. Nothing seems to work!
Any help would be great appreciated. Looking forward to be able to start using your very cool tool!
Thanks!
Hiya,
I doing some research and came across this great plugin for Unity.
As I'm testing around with Twine and Cradle I seem to have come across an issue (or it might be I just can't figure out where to get the data from).
When I test my story in Twine it will correctly show me HTML formatting done with simple HTML tags ( etc), but when the story is imported to Unity using Cradle, the HTML formatting is gone. In the generated .cs file, I can see that the sentence is broken up in the correct spot(s) of the sentence.
F.ex.
Twine text:
Hello <b>world</b>
Unity:
yield return text("Hello ");
yield return text("world");
So my question is, is there a way to get the HTML rich tags to work with Cradle? And if so, how?
I'm using Twine 2.0 and Harlowe story format.
Hey man, so I did what you copy UnityTwine into the Assets, and in my 2D project dragged TwinTextPlayer prefab into the scene. I imported the *.twee file which automatically created a Csharp script which I then dragged onto the TwinTextPlayer on the left tab.
However when I press play, the screen stays black. When I stop it, and go into the Game tab, it says Twine Text and under that Twine Link.
I'm first trying with a test file to keep it simple:
:: StoryTitle
Slumber
:: UserScript[script]
:: UserStylesheet[stylesheet]
:: Start
Hovno s makem.
[[S tabakem]]
[[Bez tabaku]]
:: S tabakem
[[Stejne hovno.]]
:: Bez tabaku
[[Stejne hovno.]]
:: Stejne hovno.
You wins!
There are no issues in the debug log.
I can make screenshots / vid to show how I do it, I'm sure it's something minor.
EDIT: Ok, for some reason when I attach the story script I have to save it, close Unity and when I open it up again it works. Any idea regarding that?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.