realDragon11 / Trawel-Text

An open world text adventure rpg. (Source-Available, ask before redistributing.)
Other
5 stars 3 forks source link

Nodes that block entering them under a condition, but don't kick out #50

Closed realDragon11 closed 10 months ago

realDragon11 commented 10 months ago

The ability to gate player progress without kicking them out of a node exploration session would be useful. for example, doors in mines ideally they should prevent the player from advancing past them if their challenge cannot be beaten (like muggers, security checkpoints, wolves, etc etc); without requiring a forcego that kicks them out on failure

A example possible behavior is making the player forcego into the node, but instead of kicking them out on a 'true', pushing them back to the last node instead this could be done either with a flag on the node itself or setting a static/nodeconnector temporary flag the behavior if it's the first node should likely still kick them out of the exploration session (ie, if there is no last node)

under this example, nodes could not gain this status mid explore without odd behavior, so either it would have to not be present on regenerations and not added, or better yet, not be able to chain into another forcego (which would prevent both types of oddness: being kicked between two gates, and being forced into ladder/lost fight)

realDragon11 commented 10 months ago

Added, here's how edge cases were handled: Can redirect into a forcego. Technically the gate kickback can happen independently of kick out and forcego, although the utility of such is limited. If the gating is the first node, or two gates lead to each other, it kicks out. It only detects a gate kick linkage after the second kick out, which means if they're trapped between two doors they'll have to fail to open both of them, which might be good for clarity reasons.

Implementation was done with a global flag, same as forcego protection (which it disables on activating to avoid letting you be in a rage combatant node unintentionally).