I’m attempting to procedurally-generate a list of linked
Passages in Harlowe 3 and am running into that lovely wall of simplified programming that is presented to the developer. The thing is that I just want to prototype a simple story without converting everything over to Sugarcube/Snowman.
What I am trying to do and am struggling with is figuring out how to generate an
Passages and link them together. I am absolutely OK with creating temporary lookup tables to link things together, however I’m struggling with the syntax for it.
My current feeling is that something like this should work, but I can’t wrap my head around the API reference for this kind of activity. The following is a pseudo-code attempt at what I’m trying to accomplish … it doesn’t work straight up but is an amalgamation of what I’ve been trying.
(set: $rooms to (a:)) (set: $num_rooms to range(1,20)) (for: each _iter, $num_rooms)[ (set: $rooms to $rooms + (a: (dm: "title", "Room " + _iter, "Description", "Room " + _iter + " Description")))) ] (set: $lookup to (dm:)) (for: each $room, $rooms): (for: each $room2, $rooms)): (if: $room is not $room2): <!-- random chance that it links up, example here to set the 'left' passage --> (set: $lookup to $lookup + (dm: "Room1_Left", $room2))
Then later on, pull up:
[[Go left | $lookup->Room1_Left]]
The issue is that I am struggling with some of the syntax here. The above code doesn’t work for me and I’m struggling with coercing it into the ‘ideal’ format.
If this is completely infeasible then that is fine, but I’m fairly certain I can hack this in with the correct syntax. (Future projects I’d switch over to Sugarcube, but I want to try and give this the old college try before I completely dump it and refactor).
I got frustrated and switched over to Sugarcube (and 15 minutes into reading documentation/examples I’m already beyond where I got with Harlowe). HOWEVER I’m going to leave this question up for now as I can see it being exceedingly valid for non-programmers to extend their IF games. If a good answer rolls along I’ll try it out in my local project.
0 Asked on March 5, 2021 by jinxy
1 Asked on March 2, 2021 by pocketonion
0 Asked on February 27, 2021 by pale_rider
1 Asked on February 22, 2021 by yookakim
2 Asked on February 22, 2021 by christian-ivicevic
0 Asked on February 19, 2021 by antonio-agustin
1 Asked on February 12, 2021 by muhammad-faizan-khan
1 Asked on February 12, 2021 by json-brody
1 Asked on February 4, 2021 by user3150201
1 Asked on February 3, 2021 by kit-k
0 Asked on January 29, 2021
1 Asked on January 24, 2021 by herewego
Get help from others!