Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

SugarCube denies the existence of a macro the story editor knows exists

When I run my StoryInit I'm given an error that one of the three macros that are part of my initialization process do not exist, yet in my editor not only is it present, but the little blue arrow recognizing a function call is present from StoryInit to the "non-existent" macro in question, and the two following macros, called in the exact same manner, function perfectly. The calls are:

<<EarlyArray>>
<<RandomArray>>
<<DestinationArray>>

And obviously the passages are EarlyArray, RandomArray, and DestinationArray, (and I did just check to make sure there were no spelling errors or anything screwing up the EarlyArray call) I keep the array setups separate because I keep adding content to them as I go, and it's much cleaner not to have them all compressed into a single extremely long initialization passage to make it easier and more clear what is where. If need be, of course, I can move the functionality of EarlyArray back into StoryInit, but I'd prefer not to, and I'd like to know how to solve this issue in case something similar to it crops up again.

Comments

  • The error message is correct you don't have a EarlyArray, RandomArray, or DestinationArray macro, they are Passages and the correct way to display one inside the other is by using the <<display "Passage Title">> macro.
    Your original code was relying on a short-cut effect of macro calling which if it could not find the macro named, it would look for a passage of the same name and <<display>> that instead.

    So your StoryInit passage would look something like the following:
    <<set $varA to "a value">>
    ......
    <<set $varZ to "a value">>
    
    <<display "EarlyArray">>
    <<display "RandomArray">>
    <<display "DestinationArray">>
    
  • edited October 2015
    Ahhh, thanks, I suppose that's just an effect from swapping over the format, man it would've taken me forever to figure that out on my own... Nowwww for the re-writes. Hoo boy. Got a lot to do now, but thanks just the same.

    One 2ndary question, I used to have arrays filled with similar passage calls so I could dynamically select links to passages (IE: the array would have the contents "<<passage>>" in it). If those are replaced with "<<display "passage">>" will that still work?
  • I noticed that in the example you supplied in the other thread.

    I am guessing that you are using a <<print $array[element]>> macro call to insert the "<<passage>>" array element value into the current passage?
    If that is so then I personally would change the "<<passage>>" value in the array to be "passage" and then change the <<print $array[element]>> macro call to be <<display $array[element]>> instead.
  • Oh! Yeah that works great, thanks, that should do just fine. Thanks for all your help with these, I think I should have it all under control. At least until I try to run it after all the adjustments and EVERYTHING BREAKS. But eh, won't be the first time. Thanks again, for everything.
Sign In or Register to comment.