Hello out there, i want to go forward and write down a quest or some event to get some very rare or historical recipes. I read the jsons from town tier quest and so on but cant put the finger on some things.
Where is the action / function / system to trigger an event ?
What files are necessary to begin a quest ?
Is there a Tutorial for creating events or is there a mod which uses that ?
I would like to have a starting kick to get on with that, so pls give me some detailed starting information. I think i could reproduce a lot from the vanilla jsons but without understanding i will encounter errors which i cant solve myselve.
Uhm, campaigns are not hard, but they are sure very time consuming and require a lot of workâŚ
They are all at the /data/gm folder. Check there. Below a little resume of what is going on.
First you will need to add a campaign at the campaign index (stonehearth:data:gm_index)
Then a campaign file where you list the arcs of the campaign, that start at âtriggerâ, and having âchallengeâ and âclimaxâ as optional following arcs.
The arc file (called encounter list) will list all files used in that arc.
The first file to run (where the campaign actually starts) is the one which have âin_edgeâ : âstartâ, as name.
in_edge is the name of the current encounter. out_edge is the name of the following encounter (the one to run after this one is done)
The term here would be âencountersâ. Events are a different thing (and thereâs documentation about them in the stonehearth/docs folder, unlike the encounters).
I believe that at some point there was a livestream where the different types of triggers and the general campaign system was explained, but I canât find it. It might have been deleted by Twitch, since it was from very long ago. Or maybe itâs somewhere in one of the other modding-related streams
Agreed. We should review this at some point.
So, as another tip, the different types of encounters are listed in stonehearth/services/server/game_master/controllers/encounters.
Use the Campaign Browser in debugtools to see how the different nodes connect to each other, and compare it with the json in the data/gm folder.
it is possible to catch the vent when a anima pasture is full ?
I want to automatly set a command for kill the animalâŚ
need a tool for dont have to click one by one for ordered the killâŚ
Hmm⌠You might listen to the stonehearth:on_pasture_animals_changed event, and compare get_max_animals() with get_num_animals() (from the shepherd pasture component) in that specific pasture.
thanks.
have you a good example for me how to mod this ?
i am new on mod. i have only added furniture.
i need to collect material before go in this feature
Just a note for anyone modding for auto-harvesting the pastured animals - PLEASE add some way to prevent the harvesting of specific animals, such as Bluebell the sheep! Iâve accidentally harvested her several times already.
here my first try. it is not complete do not use it. CE_mod2.smod (2.2 KB)
in wait_for_pasture_vacancy2.lua
in function WaitForPastureVacancy2:pasture_check()
i dont know how to test the colar of the animal before kill it.
i dont know how to send the slaughter command.
Since very recently. But we still have the limitation of 10MB for attachments, and I think Discourse charges for file storage.
So itâs not really a good solution for uploading mods, we still need to figure out how to go about it.
i have this error :
release-707 (x64)[M]
stonehearth/components/ai/ai_component.lua:412: could not load action script at CE_mod2:actions:shepherd:wait_for_pasture_vacancyCE
stack traceback:
radiant/modules/common.lua:245: in function âreport_tracebackâ
radiant/modules/common.lua:256: in function <radiant/modules/common.lua:250>
[C]: in function âassertâ
stonehearth/components/ai/ai_component.lua:412: in function â_get_key_and_constructor_for_actionâ
stonehearth/components/ai/ai_component.lua:292: in function â_add_action_internalâ
stonehearth/components/ai/ai_component.lua:237: in function âadd_actionâ
stonehearth/services/server/ai/ai_injector.lua:69: in function â_inject_actionsâ
stonehearth/services/server/ai/ai_injector.lua:50: in function â_inject_aiâ
stonehearth/services/server/ai/ai_injector.lua:15: in function â__user_initâ
radiant/lib/unclasslib.lua:270: in function â__initâ
radiant/lib/unclasslib.lua:201: in function âAiInjectorâ
âŚ
âŚs/server/town/orchestrators/promote_orchestrator.lua:71: in function â_change_jobâ
âŚs/server/town/orchestrators/promote_orchestrator.lua:22: in function â_trigger_cbâ
radiant/modules/effects/trigger_effect.lua:14: in function âfnâ
radiant/controllers/nonpersistent_timer.lua:56: in function âfireâ
radiant/controllers/time_tracker_controller.lua:84: in function <radiant/controllers/time_tracker_controller.lua:84>
[C]: in function âxpcallâ
radiant/modules/common.lua:265: in function âxpcallâ
radiant/controllers/time_tracker_controller.lua:84: in function âset_nowâ
radiant/modules/gamestate.lua:9: in function âset_nowâ
radiant/server.lua:60: in function <radiant/server.lua:58>
could you explain me why ?
i dont know you to set the action json and the lua file is a simple copy of existing one i only rename the event.
Is it possible, that campaigns must be loaded at world creation ?
i tried to have it start in a savegame but the âwait_for_net_worthâ is not triggering the out_edge.
In a new game it does.
Is:
Encounter
Type: wait_for_population
Possible ?
And
Can check more than one item threshold in one encounter ?
And
Can i read classes with lvl to trigger something
Maybe like
Wait for class blacksmith lvl 6
I have been busy the hole day long with just the first steps of my questline to get it to work. And my outline of the other quest needs more possible encounter types.
Yes, you can wait for having a class at a specific level.
Take a look at stonehearth/data/gm/campaigns/trader/arcs/encounters/returning_crop_trader_encounter.json
It has this (the trader that offers foreign crops only appears after you have a farmer lvl 6):
Yes, you can have more than one requirement for your encounter. For example, in stonehearth/data/gm/campaigns/orc_war/arcs/trigger/old_khan/encounters/wait_to_start.json you have two requirements:
i finaly get the idea for my event for butcher.
now i want to send the command
but i dont know how.
here the text i found in shepherd_pasture_component.lua ;
commands_component:set_command_enabled(âstonehearth:commands:slaughterâ, false)
i see too the command:slaughter but dont know how to sendâŚ
have you a example ?
what do this in json :
âinjected_commandsâ: [
âstonehearth:commands:release_petâ
]
Thank you @Relyss
that got me going. Now i did the first steps with my campaignâŚand it is an awful lot of workâŚ
but it is also a lot of fun.
8 encounters are made and it does what i wantâŚbut testing the campaign is awful
sry, that i read not enough in the existing campaigns before i posted my questions
New question:
If i trigger the encounter by event - building finished
Can i have two possible triggers leading to one next encounter ?
Or must i create a copy for each race splitting at that point ?
Because the building should be different for rayyas and ascendancy because of style and needed resources.
Ok while writing this i possibly got an answer.
If i unlock recipes i must first check race and then unlock the specific recipes right ?
If i want to trigger by a race specific building event i have to check race before leading to the trigger ?
Omg now its getting complicated because the campaign must have two temporarily seperate roads. Or is there a simpler way to do it ?