Modding Q&A [For Quick Questions and Answers]

Users who are viewing this thread

Status
Not open for further replies.
Barabashenko said:
kalarhan said:
Barabashenko said:
Hi. How can I set "agent_set_speed_modifier" for the specific animation (for example - "reload_musket")? I need to make agents walk instead of running while reloading muskets, as they do in WFaS or Gekokujo. Thanks.

those are different things. The operation is used to control run speed, not the animation that is in use.

You can download the modsys from WFaS and see how they used the flags to control reload as well. It is public like Warband and Viking Conquest.

Already did that before posting my question here, but no luck. I have no idea which script responds for this function, I even thought that it's hardcoded, but Gekokujo has the same feature.

There's no inbuilt function for that, you have to create a trigger that periodically checks if an agent reloads a musket and then set the speed modifier accordingly.
 
("setup_random_scene",
    [
      (party_get_current_terrain, ":terrain_type", "p_main_party"),
    (party_get_slot,":entrench","p_main_party",slot_party_entrenched),
    (assign, ":scene_to_use", "scn_random_scene"),
    (try_begin),
    (eq, ":terrain_type", rt_steppe),
            (store_random_in_range,":battle_scene",1,100),
            (try_begin),
            (is_between,":battle_scene",1,10),
              (assign, ":scene_to_use", "scn_random_scene_steppe_custom_1"),
          (else_try),
        (is_between,":battle_scene",10,20),
              (assign, ":scene_to_use", "scn_random_scene_steppe_custom_2"),
      (else_try),
        (is_between,":battle_scene",20,30),
              (assign, ":scene_to_use", "scn_random_scene_steppe_custom_3"),
      (else_try),
        (is_between,":battle_scene",30,40),
              (assign, ":scene_to_use", "scn_random_scene_steppe_custom_4"),
      (else_try),
        (is_between,":battle_scene",40,50),
              (assign, ":scene_to_use", "scn_random_scene_steppe_custom_5"),
      (else_try),
        (is_between,":battle_scene",50,60),
              (assign, ":scene_to_use", "scn_random_scene_steppe_custom_6"),
      (else_try),
        (is_between,":battle_scene",60,70),
              (assign, ":scene_to_use", "scn_random_scene_steppe_custom_7"),
      (else_try),
        (is_between,":battle_scene",70,80),
              (assign, ":scene_to_use", "scn_random_scene_steppe_custom_8"),
      (else_try),
        (is_between,":battle_scene",80,90),
              (assign, ":scene_to_use", "scn_random_scene_steppe_custom_9"),
      (else_try),
        (is_between,":battle_scene",90,95),
              (assign, ":scene_to_use", "scn_random_scene_steppe_custom_10"),
      (else_try),
        (is_between,":battle_scene",95,100),
              (assign, ":scene_to_use", "scn_random_scene_steppe_custom_11"),
      (try_end),
      (else_try),
        (eq, ":terrain_type", rt_plain),
            (store_random_in_range,":battle_scene",1,100),
            (try_begin),
            (is_between,":battle_scene",1,4),
              (assign, ":scene_to_use", "scn_random_scene_plain_custom_1"),
          (else_try),
        (is_between,":battle_scene",4,7),
              (assign, ":scene_to_use", "scn_random_scene_plain_custom_2"),
      (else_try),
        (is_between,":battle_scene",7,10),
              (assign, ":scene_to_use", "scn_random_scene_plain_custom_3"),
      (else_try),
        (is_between,":battle_scene",10,13),
              (assign, ":scene_to_use", "scn_random_scene_plain_custom_4"),
      (else_try),
        (is_between,":battle_scene",13,16),
              (assign, ":scene_to_use", "scn_random_scene_plain_custom_5"),
      (else_try),
        (is_between,":battle_scene",16,19),
              (assign, ":scene_to_use", "scn_random_scene_plain_custom_6"),
      (else_try),
        (is_between,":battle_scene",19,22),
              (assign, ":scene_to_use", "scn_random_scene_plain_custom_7"),
      (else_try),
        (is_between,":battle_scene",22,25),
              (assign, ":scene_to_use", "scn_random_scene_plain_custom_8"),
      (else_try),
        (is_between,":battle_scene",25,2:cool:,
              (assign, ":scene_to_use", "scn_random_scene_plain_custom_9"),
      (else_try),
        (is_between,":battle_scene",28,31),
              (assign, ":scene_to_use", "scn_random_scene_plain_custom_10"),
      (else_try),
        (is_between,":battle_scene",31,34),
              (assign, ":scene_to_use", "scn_random_scene_plain_custom_11"),
          (else_try),
        (is_between,":battle_scene",34,37),
              (assign, ":scene_to_use", "scn_random_scene_plain_custom_12"),
      (else_try),
        (is_between,":battle_scene",37,40),
              (assign, ":scene_to_use", "scn_random_scene_plain_custom_13"),
      (else_try),
        (is_between,":battle_scene",40,43),
              (assign, ":scene_to_use", "scn_random_scene_plain_custom_14"),
      (else_try),
        (is_between,":battle_scene",43,46),
              (assign, ":scene_to_use", "scn_random_scene_plain_custom_15"),
      (else_try),
        (is_between,":battle_scene",46,49),
              (assign, ":scene_to_use", "scn_random_scene_plain_custom_16"),
      (else_try),
        (is_between,":battle_scene",49,52),
              (assign, ":scene_to_use", "scn_random_scene_plain_custom_17"),
      (else_try),
        (is_between,":battle_scene",52,55),
              (assign, ":scene_to_use", "scn_random_scene_plain_custom_18"),
      (else_try),
        (is_between,":battle_scene",55,5:cool:,
              (assign, ":scene_to_use", "scn_random_scene_plain_custom_19"),
      (else_try),
        (is_between,":battle_scene",58,61),
              (assign, ":scene_to_use", "scn_random_scene_plain_custom_20"),
      (else_try),
              (is_between,":battle_scene",61,64),
              (assign, ":scene_to_use", "scn_random_scene_plain_mountain_custom_1"),
          (else_try),
        (is_between,":battle_scene",64,67),
              (assign, ":scene_to_use", "scn_random_scene_plain_mountain_custom_2"),
      (else_try),
        (is_between,":battle_scene",67,70),
              (assign, ":scene_to_use", "scn_random_scene_plain_mountain_custom_3"),
      (else_try),
        (is_between,":battle_scene",70,73),
              (assign, ":scene_to_use", "scn_random_scene_plain_mountain_custom_4"),
      (else_try),
        (is_between,":battle_scene",73,76),
              (assign, ":scene_to_use", "scn_random_scene_plain_mountain_custom_5"),
      (else_try),
        (is_between,":battle_scene",76,79),
              (assign, ":scene_to_use", "scn_random_scene_plain_mountain_custom_6"),
      (else_try),
        (is_between,":battle_scene",79,82),
              (assign, ":scene_to_use", "scn_random_scene_plain_mountain_custom_7"),
      (else_try),
        (is_between,":battle_scene",82,85),
              (assign, ":scene_to_use", "scn_random_scene_plain_mountain_custom_8"),
      (else_try),
        (is_between,":battle_scene",85,87),
              (assign, ":scene_to_use", "scn_random_scene_plain_mountain_custom_9"),
      (else_try),
        (is_between,":battle_scene",87,89),
              (assign, ":scene_to_use", "scn_random_scene_plain_mountain_custom_10"),
      (else_try),
        (is_between,":battle_scene",89,91),
              (assign, ":scene_to_use", "scn_random_scene_plain_river_custom_1"),
          (else_try),
        (is_between,":battle_scene",91,93),
              (assign, ":scene_to_use", "scn_random_scene_plain_river_custom_2"),
      (else_try),
        (is_between,":battle_scene",93,96),
              (assign, ":scene_to_use", "scn_random_scene_plain_river_custom_3"),
      (else_try),
        (is_between,":battle_scene",96,99),
              (assign, ":scene_to_use", "scn_random_scene_plain_river_custom_4"),
      (else_try),
        (is_between,":battle_scene",99,100),
              (assign, ":scene_to_use", "scn_random_scene_plain_river_custom_5"),
      (try_end),
      (else_try),
        (eq, ":terrain_type", rt_snow),
            (store_random_in_range,":battle_scene",1,100),
            (try_begin),
            (is_between,":battle_scene",1,10),
              (assign, ":scene_to_use", "scn_random_scene_snow_custom_1"),
          (else_try),
        (is_between,":battle_scene",10,20),
              (assign, ":scene_to_use", "scn_random_scene_snow_custom_2"),
      (else_try),
        (is_between,":battle_scene",20,30),
              (assign, ":scene_to_use", "scn_random_scene_snow_custom_3"),
      (else_try),
        (is_between,":battle_scene",30,40),
              (assign, ":scene_to_use", "scn_random_scene_snow_custom_4"),
      (else_try),
        (is_between,":battle_scene",40,50),
              (assign, ":scene_to_use", "scn_random_scene_snow_custom_5"),
      (else_try),
        (is_between,":battle_scene",50,60),
              (assign, ":scene_to_use", "scn_random_scene_snow_custom_6"),
      (else_try),
        (is_between,":battle_scene",60,70),
              (assign, ":scene_to_use", "scn_random_scene_snow_custom_7"),
      (else_try),
        (is_between,":battle_scene",70,80),
              (assign, ":scene_to_use", "scn_random_scene_snow_custom_8"),
      (else_try),
        (is_between,":battle_scene",80,90),
              (assign, ":scene_to_use", "scn_random_scene_snow_custom_9"),
      (else_try),
        (is_between,":battle_scene",90,95),
              (assign, ":scene_to_use", "scn_random_scene_snow_custom_10"),
      (else_try),
        (is_between,":battle_scene",95,100),
              (assign, ":scene_to_use", "scn_random_scene_snow_custom_11"),
      (try_end),
      (else_try),
        (eq, ":terrain_type", rt_desert),
            (store_random_in_range,":battle_scene",1,100),
            (try_begin),
            (is_between,":battle_scene",1,10),
              (assign, ":scene_to_use", "scn_random_scene_desert_custom_1"),
          (else_try),
        (is_between,":battle_scene",10,20),
              (assign, ":scene_to_use", "scn_random_scene_desert_custom_2"),
      (else_try),
        (is_between,":battle_scene",20,30),
              (assign, ":scene_to_use", "scn_random_scene_desert_custom_3"),
      (else_try),
        (is_between,":battle_scene",30,40),
              (assign, ":scene_to_use", "scn_random_scene_desert_custom_4"),
      (else_try),
        (is_between,":battle_scene",40,50),
              (assign, ":scene_to_use", "scn_random_scene_desert_custom_5"),
      (else_try),
        (is_between,":battle_scene",50,60),
              (assign, ":scene_to_use", "scn_random_scene_desert_custom_6"),
      (else_try),
        (is_between,":battle_scene",60,70),
              (assign, ":scene_to_use", "scn_random_scene_desert_custom_7"),
      (else_try),
        (is_between,":battle_scene",70,80),
              (assign, ":scene_to_use", "scn_random_scene_desert_custom_8"),
      (else_try),
        (is_between,":battle_scene",80,90),
              (assign, ":scene_to_use", "scn_random_scene_desert_custom_9"),
      (else_try),
        (is_between,":battle_scene",90,100),
              (assign, ":scene_to_use", "scn_random_scene_desert_custom_10"),
      (try_end),
      (else_try),
        (eq, ":terrain_type", rt_steppe_forest),
            (store_random_in_range,":battle_scene",1,100),
            (try_begin),
            (is_between,":battle_scene",1,20),
              (assign, ":scene_to_use", "scn_random_scene_steppe_forest_custom_1"),
          (else_try),
        (is_between,":battle_scene",20,40),
              (assign, ":scene_to_use", "scn_random_scene_steppe_forest_custom_2"),
      (else_try),
        (is_between,":battle_scene",40,60),
              (assign, ":scene_to_use", "scn_random_scene_steppe_forest_custom_3"),
      (else_try),
        (is_between,":battle_scene",60,80),
              (assign, ":scene_to_use", "scn_random_scene_steppe_forest_custom_4"),
      (else_try),
        (is_between,":battle_scene",80,100),
              (assign, ":scene_to_use", "scn_random_scene_steppe_forest_custom_5"),
      (try_end),
      (else_try),
        (eq, ":terrain_type", rt_forest),
        (store_random_in_range,":battle_scene",1,100),
        (try_begin),
              (is_between,":battle_scene",1,10),
              (assign, ":scene_to_use", "scn_random_scene_plain_forest_custom_1"),
          (else_try),
        (is_between,":battle_scene",10,20),
              (assign, ":scene_to_use", "scn_random_scene_plain_forest_custom_2"),
      (else_try),
        (is_between,":battle_scene",20,30),
              (assign, ":scene_to_use", "scn_random_scene_plain_forest_custom_3"),
      (else_try),
        (is_between,":battle_scene",30,40),
              (assign, ":scene_to_use", "scn_random_scene_plain_forest_custom_4"),
      (else_try),
        (is_between,":battle_scene",40,50),
              (assign, ":scene_to_use", "scn_random_scene_plain_forest_custom_5"),
      (else_try),
        (is_between,":battle_scene",50,60),
              (assign, ":scene_to_use", "scn_random_scene_plain_forest_custom_6"),
      (else_try),
        (is_between,":battle_scene",60,70),
              (assign, ":scene_to_use", "scn_random_scene_plain_forest_custom_7"),
      (else_try),
        (is_between,":battle_scene",70,80),
              (assign, ":scene_to_use", "scn_random_scene_plain_forest_custom_8"),
      (else_try),
        (is_between,":battle_scene",80,90),
              (assign, ":scene_to_use", "scn_random_scene_plain_forest_custom_9"),
      (else_try),
        (is_between,":battle_scene",90,100),
              (assign, ":scene_to_use", "scn_random_scene_plain_forest_custom_10"),
      (try_end),
      (else_try),
        (eq, ":terrain_type", rt_snow_forest),
            (store_random_in_range,":battle_scene",1,100),
            (try_begin),
            (is_between,":battle_scene",1,20),
              (assign, ":scene_to_use", "scn_random_scene_snow_forest_custom_1"),
          (else_try),
        (is_between,":battle_scene",20,40),
              (assign, ":scene_to_use", "scn_random_scene_snow_forest_custom_2"),
      (else_try),
        (is_between,":battle_scene",40,60),
              (assign, ":scene_to_use", "scn_random_scene_snow_forest_custom_3"),
      (else_try),
        (is_between,":battle_scene",60,80),
              (assign, ":scene_to_use", "scn_random_scene_snow_forest_custom_4"),
      (else_try),
        (is_between,":battle_scene",80,100),
              (assign, ":scene_to_use", "scn_random_scene_snow_forest_custom_5"),
      (try_end),
      (else_try),
        (eq, ":terrain_type", rt_desert_forest),
            (store_random_in_range,":battle_scene",1,100),
            (try_begin),
            (is_between,":battle_scene",1,20),
              (assign, ":scene_to_use", "scn_random_scene_desert_forest_custom_1"),
          (else_try),
        (is_between,":battle_scene",20,40),
              (assign, ":scene_to_use", "scn_random_scene_desert_forest_custom_2"),
      (else_try),
        (is_between,":battle_scene",40,60),
              (assign, ":scene_to_use", "scn_random_scene_desert_forest_custom_3"),
      (else_try),
        (is_between,":battle_scene",60,80),
              (assign, ":scene_to_use", "scn_random_scene_desert_forest_custom_4"),
      (else_try),
        (is_between,":battle_scene",80,100),
              (assign, ":scene_to_use", "scn_random_scene_desert_forest_custom_5"),
      (try_end),
      (else_try),
    (eq,":entrench",1),
    (set_jump_mission,"mt_entrenched_encounter"),
    (assign,"$camp_supply",1), #Tempered  reset camp supplies before a battle
      (try_begin),
        (eq, ":terrain_type", rt_steppe),
        (assign, ":scene_to_use", "scn_entrenched_steppe"),
      (else_try),
        (eq, ":terrain_type", rt_plain),
        (assign, ":scene_to_use", "scn_entrenched_plain"),
      (else_try),
        (eq, ":terrain_type", rt_snow),
        (assign, ":scene_to_use", "scn_entrenched_snow"),
      (else_try),
        (eq, ":terrain_type", rt_desert),
        (assign, ":scene_to_use", "scn_entrenched_desert"),
      (else_try),
        (eq, ":terrain_type", rt_steppe_forest),
        (assign, ":scene_to_use", "scn_entrenched_steppe_forest"),
      (else_try),
        (eq, ":terrain_type", rt_forest),
        (assign, ":scene_to_use", "scn_entrenched_plain_forest"),
      (else_try),
        (eq, ":terrain_type", rt_snow_forest),
        (assign, ":scene_to_use", "scn_entrenched_snow_forest"),
      (else_try),
        (eq, ":terrain_type", rt_desert_forest),
        (assign, ":scene_to_use", "scn_entrenched_desert_forest"),
      (try_end),     
    (else_try),
    (eq,"$g_camp_mode", 1),
    (set_jump_mission,"mt_entrenched_encounter"),
    (assign,"$camp_supply",1), #Tempered  reset camp supplies before a battle
      (try_begin),
        (eq, ":terrain_type", rt_steppe),
        (assign, ":scene_to_use", "scn_not_entrenched_steppe"),
      (else_try),
        (eq, ":terrain_type", rt_plain),
        (assign, ":scene_to_use", "scn_not_entrenched_plain"),
      (else_try),
        (eq, ":terrain_type", rt_snow),
        (assign, ":scene_to_use", "scn_not_entrenched_snow"),
      (else_try),
        (eq, ":terrain_type", rt_desert),
        (assign, ":scene_to_use", "scn_not_entrenched_desert"),
      (else_try),
        (eq, ":terrain_type", rt_steppe_forest),
        (assign, ":scene_to_use", "scn_not_entrenched_steppe_forest"),
      (else_try),
        (eq, ":terrain_type", rt_forest),
        (assign, ":scene_to_use", "scn_not_entrenched_plain_forest"),
      (else_try),
        (eq, ":terrain_type", rt_snow_forest),
        (assign, ":scene_to_use", "scn_not_entrenched_snow_forest"),
      (else_try),
        (eq, ":terrain_type", rt_desert_forest),
        (assign, ":scene_to_use", "scn_not_entrenched_desert_forest"),
      (try_end),
    (else_try),
    (eq,":entrench",0),
      (try_begin),
        (eq, ":terrain_type", rt_steppe),
        (assign, ":scene_to_use", "scn_random_scene_steppe"),
      (else_try),
        (eq, ":terrain_type", rt_plain),
        (assign, ":scene_to_use", "scn_random_scene_plain"),
      (else_try),
        (eq, ":terrain_type", rt_snow),
        (assign, ":scene_to_use", "scn_random_scene_snow"),
      (else_try),
        (eq, ":terrain_type", rt_desert),
        (assign, ":scene_to_use", "scn_random_scene_desert"),
      (else_try),
        (eq, ":terrain_type", rt_steppe_forest),
        (assign, ":scene_to_use", "scn_random_scene_steppe_forest"),
      (else_try),
        (eq, ":terrain_type", rt_forest),
        (assign, ":scene_to_use", "scn_random_scene_plain_forest"),
      (else_try),
        (eq, ":terrain_type", rt_snow_forest),
        (assign, ":scene_to_use", "scn_random_scene_snow_forest"),
      (else_try),
        (eq, ":terrain_type", rt_desert_forest),
        (assign, ":scene_to_use", "scn_random_scene_desert_forest"),
        (else_try),
        (eq, ":terrain_type", rt_water),
        (assign, ":scene_to_use", "scn_water"),
      (else_try),
        (eq, ":terrain_type", rt_bridge),
        (assign, ":scene_to_use", "scn_random_scene_plain"),
      (try_end),
    (try_end),
    (modify_visitors_at_site,":scene_to_use"),
    (reset_visitors),
      (jump_to_scene,":scene_to_use"),
  ]),
#TEMPERED CHANGES END

Hello! Could someone look through and tell if everything is fine in the script?
 
KnightV said:
Hello! Could someone look through and tell if everything is fine in the script?

first thingy you need to do is fix the indentation. It will prevent you from having bad blocks (missing ENDIF) that will break your logic and cause bugs.

if you are in doubt about the flow then add some comments, a few debug messages and any other tool (like a workflow graph) to help you see what the code is doing.
 
Hello folks,

I have a pretty simple question, or at least I hope it is. Is there a possibility to not make my map icon float? There has to be, because Praven for example does not float (or other citys on hills), I just couldn't figure out how it works.

Here is a screenshot:

20200115231051-1.jpg

Thanks a lot guys :smile:



Edit:

NPC99 said:
gokiller said:
[Bcw]Btm_Earendil said:
Algerian.Sultan said:
I noticed that most of my map icons ave a problem with my campaign map terrain.
rsUcjuJ.jpg
Is there a way of fixing it other than having to modify the icons or the campaign map?
I somehow doubt it can be fixed without modifying either the icons or the campaign map.
What about moving the model up in openbrf? Or is that complete nonsense? (Never tried something like that with icons)

Moving it up would only work if there was a deep plinth underneath the map icon (as used in Viking Conquest) that you didn’t mind being partially visible (without a plinth, part of the icon would float above the ground). For map icons unmounted on plinths you need to edit the campaign map in Thorgrim’s Map Editor to create a flat shelf in it’s current location. Alternatively, you could relocate the map icon to a flat part of the map.

Is this the only way? No way to move the model down like in the normal scene editor with "T"?
 
DucksInaManSuit said:
i haven't ever used mods for warband before, is it possible to make lords who change sides use the soldiers from their new kingdom?

yeap, all game rules are open for modders to do whatever they want with them.

are you using modsys and, if so, which one (name, version, link of download used). If not, you would need to do .txt tweaks but those are usually not discussed here in depth.
 
DucksInaManSuit said:
I'm using Warband Module System

did you check the basic tutorials?

kalarhan said:

once you know the basics it will be easier to talk about coding changes. You will need to check things like

script_update_npc_volunteer_troops_in_village
script_cf_create_kingdom_party
script_hire_men_to_kingdom_hero_party

and so on

 
Ok, I checked out the PDF and the tutorial.

[quote author=kalarhan]

script_update_npc_volunteer_troops_in_village
script_cf_create_kingdom_party
script_hire_men_to_kingdom_hero_party

[/quote]

Would I really have to mess with all these just to get this simple effect? There's no way to edit the cf_reinforce_party script so they recruit from their current faction instead of original?
 
DucksInaManSuit said:
There's no way to edit the XXX

game is a combination of events and you need to check (examine) the full workflow to see what/when/how/why you need to change stuff.

btw you posted on Diplomacy thread. You know you cant use 1.171 modsys for other modules (other than Native Warband), right? Diplomacy has its own modsys, a different download.
 
kalarhan said:
DucksInaManSuit said:
There's no way to edit the XXX

game is a combination of events and you need to check (examine) the full workflow to see what/when/how/why you need to change stuff.

btw you posted on Diplomacy thread. You know you cant use 1.171 modsys for other modules (other than Native Warband), right? Diplomacy has its own modsys, a different download.

I didn't know that, no. What modsys does Diplomacy use?
 
DucksInaManSuit said:
kalarhan said:
DucksInaManSuit said:
There's no way to edit the XXX

game is a combination of events and you need to check (examine) the full workflow to see what/when/how/why you need to change stuff.

btw you posted on Diplomacy thread. You know you cant use 1.171 modsys for other modules (other than Native Warband), right? Diplomacy has its own modsys, a different download.

I didn't know that, no. What modsys does Diplomacy use?
Their own ^^
You can find it in the download repository: https://forums.taleworlds.com/index.php/topic,326973.0.html
 
Okay fellas, I have a new question. And it is not one, that hasn't been asked before, yet I am just to limited to understand.

So I am using this OSP, which let's you implement mercenary camps in Calradia. This works fine for me, and I implemented my own little castle, where you can recruit your troops. In the OSP you edit: constans, dialogs, scripts, parties, game_menus, simple_triggers, party_templates, scenes, troops and items. So far, so good.
Now I implemented these scenes:
Code:
# Merc Camp Begin	
  ("geroian_camp",sf_generate,"none", "none", (0,0),(100,100),-100,"0x000000003000050000064592000063c100001bee00006f14",
    [],[],"outer_terrain_plain"),	
  ("balion_camp",sf_generate,"none", "none", (0,0),(100,100),-100,"0x000000003000050000064592000063c100001bee00006f14",
    [],[],"outer_terrain_beach"),	 	
  ("ylfing_camp",sf_generate,"none", "none", (0,0),(100,100),-100,"0x00000000b00562e200040900000063f40000679f00006cda",
    [],[],"sea_outer_terrain_1"),	
  ("zendar_camp",sf_generate,"none", "none", (0,0),(100,100),-100,"0x000000003000050000064592000063c100001bee00006f14",
    [],[],"outer_terrain_snow"),
  ("darkwood_camp",sf_generate,"none", "none", (0,0),(100,100),-100,"0x000000003000050000064592000063c100001bee00006f14",
    [],[],"outer_terrain_plain"),
  ("ravenstone_camp",sf_generate,"none", "none", (0,0),(100,100),-100,"0x000000003000050000064592000063c100001bee00006f14",
    [],[],"outer_terrain_plain"),	
# Merc Camp End

Important to me is the scene for the darkwood camp. I now want to add weather into my darkwood scene, more clearly I want to make it quite foggy, maybe even rainy I'll see.
So maybe now you'll be like, not again that question because people indeed did ask this before like here:
cwr said:
Is there a way to make fog appear in a scene every time? I made fog the first time by editing the weather with the in-game editor, but upon reloading the scene the fog goes away. :sad:
Somebody said:
set_fog_distance works pretty much anywhere you call it from once you're in a scene.
And hey, there is an answer! Yea, well but where do I have to put this order? So my guess is, that it is done in mission_templates, right? But how do I define, that the weather is exclusivly used in the scene for darkwood_camp?

I found a tutorial here: is this one still up to date?
Abhuva said:
Basic principles of using weather in scenes

We have different things to change the overall weather situation in a scene:
- set_fog_distance   
- set_rain
- scene_set_day_time
- set_global_cloud_amount

(set_rain,<rain-type>,<rain-strenght>),
set_rain needs to be always called before a mission gets started and cant be changed during a mission.
Rain type will determine wether its snow or rain (2 for snow, 1 for rain)
Rain strenght will determine how "much" it rains...
A simple example how to use it in a generic trigger would be this:
abhuva_rain = (ti_before_mission_start,0,0,[],[
  (store_random_in_range,":rain_yesno",1,101),  ## this will output a random number between 1 and 100
  (try_begin),
        (ge, ":rain_yesno",50),      ## we have a 50% change that it will be raining or not
(party_get_current_terrain, ":terrain_type", "p_main_party"),
        (store_random_in_range,":rain_strength",1,101),  ## this will output a random number between 1 and 100
(try_begin),
(eq, ":terrain_type", rt_snow),
(set_rain,2,":rain_strength"),
(else_try),
(set_rain,1,":rain_strength"),
(try_end),
  (try_end),
])

(scene_set_day_time,<time of day>),
This is a indirect command, basicly the time of day will determine what type of skybox will be used. We cant choose a specific skybox, the game is hardcoded to choose from the existing ones randomly if they fit specific settings.
scene_set_day_time is pretty straigthforward to use, note that it also needs to be set before the mission starts and cant be changed during a mission:
(ti_before_mission_start, 0, 0, [],
      [
        (scene_set_day_time, 13),  ## sets time of day to 1 pm
        ]),

Now that we could choose between a night/dawn/day skybox, how can we further specify if its cloudy or not? Here comes the command (set_global_cloud_amount,<strenght>) into play.
The higher the strenght the more likely it is that the game will choose a cloudy version of the skybox. (i am not sure about exact values, this would need extensive testings as its hardcoded and cant be looked at easy)
(ti_before_mission_start, 0, 0, [],
      [
        (set_global_cloud_amount, 100),  ## sets cloud amount to very very cloudy
        ]),


Lastly we have set_fog_distance.
(set_fog_distance,<distance>,<color in hex code>),
This is the only command we can dynamical change during a mission.
The distance is distance in meters. Note that anything below 20 is way too foggy imo, something like 550-800 is good for a little bit haze at sunny days, anything over 1500 seems to have nearly no fog/haze at all (its there but barely visible).
The color needs to be coded in the following way:
0xAARRGGBB  --> A is alpha value, not used for fog and should be set to FF
--> R,G and B are Red, Green and Blue values of the color.
for example: 0xFF0000FF would be totally blue fog.

abhu_fog = (0,0,ti_once, [],
[
(set_fog_distance,50,0xFFB3B3AC),
]

One last example to show this all together: we want a cloudy scene at dawn, with mid-range fog and slightly raining:
(ti_before_mission_start, 0, 0, [],
      [
          (scene_set_day_time, 6), 
          (set_global_cloud_amount, 100),
          (set_rain,1,30),
        ]),
(0,0,ti_once, [],
[
(set_fog_distance,250,0xFFB3B3AC),
]

:grin: most script examples are made-up as i wrote this, to script your own weather setup this should give you the basics.

So I at least guess, it still is up to date. So I  want to change the fog for example and because of that use this code:
Code:
(ti_before_mission_start, 0, 0, [],
       [
          (scene_set_day_time, 6),  
          (set_global_cloud_amount, 100), 
          (set_rain,1,30),
        ]),
(0,0,ti_once, [],
 [
	(set_fog_distance,250,0xFFB3B3AC),
]

But how do I tell the game, that it is only for my scene? I am a little bit confused, because I did not see a single weather changed scene in my mission_templates. And the only "specific" scenes I found are arena scenes or mulitplayer scenes.

Yea, I hope someone can help me, honstely I think it can't be that hard and that I can just not see the forest because of all the trees (this is a German saying).
 
Schwarzwolf said:
But how do I tell the game, that it is only for my scene?

a mission is related to only one mission template. Which one are you using? Is it a unique mission template (mst_my_new_stuff_XXX) just for your new scene, or a common one used by many (like "lead_charge"/mst_lead_charge) ?

if the first all you need to do is put your trigger on that mission template.

if the second you also will need to test for the scene. Use the operation that checks what is the current scene

Code:
    (store_current_scene, ":cur_scene"),
    (eq, ":cur_scene", "scn_XXXXXXX"),
 
kalarhan said:
Schwarzwolf said:
But how do I tell the game, that it is only for my scene?

a mission is related to only one mission template. Which one are you using? Is it a unique mission template (mst_my_new_stuff_XXX) just for your new scene, or a common one used by many (like "lead_charge"/mst_lead_charge) ?

if the first all you need to do is put your trigger on that mission template.

if the second you also will need to test for the scene. Use the operation that checks what is the current scene

Code:
    (store_current_scene, ":cur_scene"),
    (eq, ":cur_scene", "scn_XXXXXXX"),

(Okay, question on the second part, can I use lead_battle, even if it is not a battle scene? So there is no fighting going on? It's basicly like walking through a city and you are able to speak with the people there.) I guess I found a better spot, look in the spoiler below :smile:


This is how it looks at the moment. The dedal stuff is the tavern animations pack. Look out for the darkwood stuff at the end :smile:
Code:
mission_templates = [
	("town_default",0,-1,
	 "Default town visit",[
		(0,mtef_scene_source|mtef_team_0,af_override_horse,0,1,pilgrim_disguise),
		(1,mtef_scene_source|mtef_team_0,af_override_horse,0,1,[]),
		(2,mtef_scene_source|mtef_team_0,af_override_horse,0,1,[]),
		(3,mtef_scene_source|mtef_team_0,af_override_horse,0,1,[]),
		(4,mtef_scene_source|mtef_team_0,af_override_horse,0,1,[]),
		(5,mtef_scene_source|mtef_team_0,af_override_horse,0,1,[]),
		(6,mtef_scene_source|mtef_team_0,af_override_horse,0,1,[]),
		(7,mtef_scene_source|mtef_team_0,af_override_horse,0,1,[]),
		(8,mtef_scene_source,af_override_horse,0,1,[]),
		(9,mtef_scene_source,af_override_horse,0,1,[]),
		(10,mtef_scene_source,af_override_horse,0,1,[]),
		(11,mtef_scene_source,af_override_horse,0,1,[]),
		(12,mtef_scene_source,af_override_horse,0,1,[]),
		(13,mtef_scene_source,0,0,1,[]),
		(14,mtef_scene_source,0,0,1,[]),
		(15,mtef_scene_source,0,0,1,[]),
		(16,mtef_visitor_source,af_override_horse,0,1,[]),
		(17,mtef_visitor_source,af_override_horse,0,1,[]),
		(18,mtef_visitor_source,af_override_horse,0,1,[]),
		(19,mtef_visitor_source,af_override_horse,0,1,[]),
		(20,mtef_visitor_source,af_override_horse,0,1,[]),
		(21,mtef_visitor_source,af_override_horse,0,1,[]),
		(22,mtef_visitor_source,af_override_horse,0,1,[]),
		(23,mtef_visitor_source,af_override_horse,0,1,[]),
		(24,mtef_visitor_source,af_override_horse,0,1,[]),
		(25,mtef_visitor_source,af_override_horse,0,1,[]),
		(26,mtef_visitor_source,af_override_horse,0,1,[]),
		(27,mtef_visitor_source,af_override_horse,0,1,[]),
		(28,mtef_visitor_source,af_override_horse,0,1,[]),
		(29,mtef_visitor_source,af_override_horse,0,1,[]),
		(30,mtef_visitor_source,af_override_horse,0,1,[]),
		(31,mtef_visitor_source,af_override_horse,0,1,[]),
		
		#dedal begin
		(1,mtef_visitor_source,af_override_horse|af_override_gloves,0,1,[]),#32
		(2,mtef_visitor_source,af_override_horse|af_override_gloves,0,1,[]),#33
		(3,mtef_visitor_source,af_override_horse|af_override_gloves,0,1,[]),#34
		(4,mtef_visitor_source,af_override_horse|af_override_gloves,0,1,[]),#35
		(5,mtef_visitor_source,af_override_horse|af_override_gloves,0,1,[]),#36
		(6,mtef_visitor_source,af_override_horse|af_override_gloves,0,1,[]),#37
		(7,mtef_visitor_source,af_override_horse|af_override_gloves,0,1,[]),#38
		(8,mtef_visitor_source,af_override_horse|af_override_gloves,0,1,[]),#39
		(10,mtef_visitor_source,af_override_horse|af_override_gloves,0,1,[]),#40
	 ],[
		dedal_tavern_animations,
#dedal end
	
      (1, 0, ti_once, [],
      [
        (store_current_scene, ":cur_scene"),
        (scene_set_slot, ":cur_scene", slot_scene_visited, 1),
        (try_begin),
          (gt, "$sneaked_into_town", disguise_none),
          (call_script, "script_music_set_situation_with_culture", mtf_sit_town_infiltrate),
        (else_try),
          (eq, "$talk_context", tc_tavern_talk),
          (call_script, "script_music_set_situation_with_culture", mtf_sit_tavern),
        (else_try),
          (call_script, "script_music_set_situation_with_culture", mtf_sit_town),
        (try_end),
      ]),

      (ti_before_mission_start, 0, 0, [],
      [
        (call_script, "script_change_banners_and_chest"),
        (call_script, "script_initialize_tavern_variables"),
      ]),

##taoc darkwood merc camp begin
    (store_current_scene, ":cur_scene"),
    (eq, ":cur_scene", "scn_darkwood_camp"),
		(ti_before_mission_start, 0, 0, [],
			[ 
			(set_global_cloud_amount, 100),
			(set_rain,1,30),
			]),
		(0,0,ti_once, [],
		[
		(set_fog_distance,250,0xFFB3B3AC),
		]),
##taoc darkwood merc camp end

     

Something about it is messed up haha :lol:
I got this error:
Code:
*** Warband Refined & Enhanced Compiler Kit (W.R.E.C.K.) version 1.0.0 ***
Please report errors, problems and suggestions at http://lav.lomskih.net/wreck/

Loading module... DONE.
Loading plugins... DONE.
Checking module syntax... FAILED.
MODULE `mission_templates` ERROR:
failed to parse element #0
  failed to parse element #3
    value of <l.cur_scene[@?]> is undefined at compile time


COMPILATION FAILED.
Do I have to define it in module_constants.py?
 
Schwarzwolf said:
Do I have to define it in module_constants.py?

nope, your trigger has bad syntax, just fix that. Also note your second trigger (fog) is not checking the scene.

learn about triggers:
https://forums.taleworlds.com/index.php/topic,14272.0.html

and check your syntax

Code:
(trigger_NAME or timer, second timer, third timer, [ CONDITIONS ], [ CONSEQUENCES ]),

Code:
####################################################################################################################
#  Each trigger contains the following fields:
# 1) Check interval: How frequently this trigger will be checked
# 2) Delay interval: Time to wait before applying the consequences of the trigger
#    After its conditions have been evaluated as true.
# 3) Re-arm interval. How much time must pass after applying the consequences of the trigger for the trigger to become active again.
#    You can put the constant ti_once here to make sure that the trigger never becomes active again after it fires once.
# 4) Conditions block (list). This must be a valid operation block. See header_operations.py for reference.
#    Every time the trigger is checked, the conditions block will be executed.
#    If the conditions block returns true, the consequences block will be executed.
#    If the conditions block is empty, it is assumed that it always evaluates to true.
# 5) Consequences block (list). This must be a valid operation block. See header_operations.py for reference.
####################################################################################################################
 
kalarhan said:
Schwarzwolf said:
Do I have to define it in module_constants.py?

nope, your trigger has bad syntax, just fix that. Also note your second trigger (fog) is not checking the scene.

learn about triggers:
https://forums.taleworlds.com/index.php/topic,14272.0.html

and check your syntax

Code:
(trigger_NAME or timer, second timer, third timer, [ CONDITIONS ], [ CONSEQUENCES ]),

Code:
####################################################################################################################
#  Each trigger contains the following fields:
# 1) Check interval: How frequently this trigger will be checked
# 2) Delay interval: Time to wait before applying the consequences of the trigger
#    After its conditions have been evaluated as true.
# 3) Re-arm interval. How much time must pass after applying the consequences of the trigger for the trigger to become active again.
#    You can put the constant ti_once here to make sure that the trigger never becomes active again after it fires once.
# 4) Conditions block (list). This must be a valid operation block. See header_operations.py for reference.
#    Every time the trigger is checked, the conditions block will be executed.
#    If the conditions block returns true, the consequences block will be executed.
#    If the conditions block is empty, it is assumed that it always evaluates to true.
# 5) Consequences block (list). This must be a valid operation block. See header_operations.py for reference.
####################################################################################################################

First off all thank you for your help!

I think I got my syntax straight, at least it does not give me an error anymore! After that I checked the scene, but I could not see any differences. So I played with the values, when the game checks my trigger which should now be every in-game-hour instead of 0 (does 0 mean, that it does not get checked? Or that it gets checked the whole time?). So I waited but still did not see any weather change.

So my first guess would be, that I messed up the spot, where my mission should be in. Like the mission_templates = [("town_default",0,-1,"Default town visit",[, because my scene isn't actually a town, it's a mercenary camp. And it is not placed in between the towns in module_parties.py On the other hand I told the tuple what my scene is...
Can that be the case? Or did I just not get my code right.

Code:
##taoc darkwood merc camp begin
	  (ti_before_mission_start, 1, 0, [],
		[ 
    		(store_current_scene, ":cur_scene"),
    		(eq, ":cur_scene", "scn_darkwood_camp"),
			(set_global_cloud_amount, 100),
			(set_rain,1,30),
		]),
	  (1,0,ti_once, [],
		[
    		(store_current_scene, ":cur_scene"),
    		(eq, ":cur_scene", "scn_darkwood_camp"),
			(set_fog_distance,250,0xFFB3B3AC),
		]),
##taoc darkwood merc camp end
 
Schwarzwolf said:
be every in-game-hour instead of 0

it's a mercenary camp

what does the specification says?
Code:
1) Check interval: How frequently this trigger will be checked
so 0 (zero) just means it checks like crazy. Its a game, so every frame. 1 (one) would mean every one second. And so on.

the mission template is chosen by you. The script that controls the selection on the world map encounters, as a example, is

Code:
  # script_game_event_party_encounter:
  # This script is called from the game engine whenever player party encounters another party or a battle on the world map
  # INPUT:
  # param1: encountered_party
  # param2: second encountered_party (if this was a battle
  ("game_event_party_encounter",

basically you need a condition (if it is XXX, then use menu YYY, which will call mission template ZZZ)

if your entry point is different (like a door inside a scene, etc), you need to check that code.

in other words: you need to find the start event that will lead you inside your new scene, then connect that to a chosen mission template, and that mission template needs the weather trigger.

look at this example from the event [player goes to meet a lady]

Code:
  ("setup_meet_lady",
    [
     ...
      
      (set_jump_mission,"mt_visit_town_castle"),
      ...
      (modify_visitors_at_site,":castle_scene"),
      (reset_visitors),
      
     ...

      (jump_to_scene,":castle_scene"),
      ...
      (change_screen_mission),
  ]),

(extra code hidden by the "...")
 
Status
Not open for further replies.
Back
Top Bottom