Is there code to manually trigger a part of a quest?


#1

is there code to manually trigger a part of a quest?

say you are doing amberstone, and the part of the quest handled by 12_heirbloom_unlock.json fails.
which was my fauly. now fixed with help from kaimonkey.

but people continued the save and because that part fails, amberstone doesnt continue, is there a way to manually trigger the next quest part? (after ofc unlocking herblooms via the seed box spawned via debug tool?

or even re-trigger a quest that went wrong? (even better)
@max99x or @Relyss


#2

You can trigger specific nodes with something like this:

stonehearth.game_master:get_game_master('player_1'):debug_trigger_campaign_encounter({
  arc = 'trigger',
  campaign_name = 'amberstone',
  encounter_name = '12_heirbloom_unlock',
})

Whether this will solve your specific problem with the quest I can’t tell without more context.


#3

I think this triggers the encounter in a separate debug campaign, so if there are children nodes that depend on previous game master context, things might break or not work as expected.

Or so I think, but I never tried it for continuing a campaign. :thinking:


#4

well its broken anyway, so might as well try :stuck_out_tongue:
@Banto there is a chance!


#5

@max99x For context, that .Lua in that quest node failed and threw an error, which as far as I know, stops that “node” from telling the next one to do its thing?


#6

If you click on Quest entry, can you spawn any of those encounters?
image

Most of the amberstone encounters are repeteable, so maybe with some luck you can gain enough reputation with other quests to continue the campaign.


#7

the problem was mainly here:


though max’s code seems to be rather usefull, it seems to work to fix banto’s town progession problem at least but jumping to the un-triggered node.
possibly it could be used for the bun buns here too but needs some experimenting.
(also, i was kinda surprised both the unlock and the counter dont both come out of heirbloom intro, instead of going in a straight path.)