Idea's on how to trigger an encounter with a command?

It appears that the majority of the functions in arc.lua for triggering encounters are private, and the debugging ones are public, but notes say it will break a save game. I’m also not sure what parent_node is referring to either. I don’t know, maybe it’s not really feasible without having to rework a lot of code.

You can download debug tools and look at the code. The campaign browser allows to trigger encounters immediately.
However, if the encounter has requirements, it will reset its timer, and not trigger it.

The parent node is the node that called that encounter (it is easier to see it in the campaign browser’s tree).

If by command you mean on the unit frame inside the game, I guess you could trigger an event there, and use an encounter of type “wait_for_event” to trigger your encounter.

I take it we just put the zip file in the mods folder? :confused:
No installation directions on github.

Eh, NVM

http://discourse.stonehearth.net/t/not-building-buildings-and-not-removing-buildings/18701/2?u=shograffiti

1 Like

It says in the code comments the game.master function it calls will break save games and is for debugging only.[quote=“Relyss, post:2, topic:24197”]
The parent node is the node that called that encounter (it is easier to see it in the campaign browser’s tree).
[/quote]

Thank you.[quote=“Relyss, post:2, topic:24197”]
If by command you mean on the unit frame inside the game, I guess you could trigger an event there, and use an encounter of type “wait_for_event” to trigger your encounter.
[/quote]

Hmm. So maybe create a blank function, and wait_for_event source be the object I’m attaching the command to, and and event the name of the blank function?

Depending on your goal. You want to trigger an encounter via Lua? I don’t know how to do that, in fact I’m investigating because there was some code to trigger a campaign but it doesn’t work for my current case. We could ask the devs.

What I was suggesting was: if your goal is to click a button in the UI, and the click triggers an encounter from your campaign, you can have a wait_for_event encounter, with an out_edge of the encounter you want to trigger. When you click the button, the button has to trigger an event, which will be caught by the wait_for_event encounter.

In the campaign browser tree it would look like this:

This might or might not work, it was just an idea :confused:

I don’t know which values can be placed for “source”, would have to ask the devs.