Your example works for me if I cut-n-paste your three macro calls into a new passage in the order they appear in your example and then run it.
Are you sure you have correctly spelt the property names in your actual code?
NOTE: Due to how the state of all known story variables get cloned/copied each time passage traversal occurs, the $spider variable and the $C01.opponent property will end up referencing two different but initially 'equal' objects.
Once this occurs changing the value of $spider.name will not result in the value of $C01.opponent.name changing as well.
I'm sure of my spelling but with your second point you have something, greyelf. Actually my example was simplified. $spider was in a "Monsters" passage, and $C01 was in a "Combats" passage, both "linked" to "StoryInit" via <<include>> macros.
I have deleted that and put everything in "StoryInit", and now that works. So, I have the workaround (the most important) but not the explanation. If <<include>> doesn't work in "StoryInit", that's a pity. I very much like a modular design for every project of mine, an old habit.
I have deleted that and put everything in "StoryInit", and now that works. So, I have the workaround (the most important) but not the explanation. If <<include>> doesn't work in "StoryInit", that's a pity. I very much like a modular design for every project of mine, an old habit.
As noted by greyelf, <<include>> may be used within the StoryInit special passage without issue. It's likely that you either did have a misspelling somewhere, even if it was in the passage names passed to <<include>>, or you were including the passages in the wrong order. You, obviously, had something wrong somewhere, as there's no reason it shouldn't have worked if done correctly.
You're right : I was including my passages in the wrong order. And now, am I correct in assuming that the combination Twine + SugarCube works like a single-pass compiler? If so, I'll take that into account.
Comments
Are you sure you have correctly spelt the property names in your actual code?
NOTE: Due to how the state of all known story variables get cloned/copied each time passage traversal occurs, the $spider variable and the $C01.opponent property will end up referencing two different but initially 'equal' objects.
Once this occurs changing the value of $spider.name will not result in the value of $C01.opponent.name changing as well.
I have deleted that and put everything in "StoryInit", and now that works. So, I have the workaround (the most important) but not the explanation. If <<include>> doesn't work in "StoryInit", that's a pity. I very much like a modular design for every project of mine, an old habit.
Still, thanks for your help :-)
note: Using TWEE notation, and the Start passage as the starting point.