Modding Q&A [For Quick Questions and Answers]

Users who are viewing this thread

Status
Not open for further replies.
Go to module_scripts.py,
This is the script that handles the scenes generated for battles:
Code:
  # script_setup_random_scene
  # Input: arg1 = center_no, arg2 = mission_template_no
  # Output: none
  ("setup_random_scene",
    [
      (party_get_current_terrain, ":terrain_type", "p_main_party"),
      (assign, ":scene_to_use", "scn_random_scene"),
      (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),
      (jump_to_scene,":scene_to_use"),
  ]),

Then add custom scenes for rt_plain (plain terrain encounter in the game map) for example:
.....
    (else_try),
        (eq, ":terrain_type", rt_plain),
(store_random_in_range,":battle_scene",1,100),
(try_begin),
(is_between,":battle_scene",1,20),
(assign, ":scene_to_use", "scn_custom_battle_scene_plain_01"),
(else_try),
(is_between,":battle_scene",21,40),
(assign, ":scene_to_use", "scn_custom_battle_scene_plain_02"),
(else_try),
(is_between,":battle_scene",41,60),
(assign, ":scene_to_use", "scn_custom_battle_scene_plain_03"),
(else_try),
(assign, ":scene_to_use", "scn_random_scene_plain"),
(try_end),
      (else_try),
        (eq, ":terrain_type", rt_snow),
        (assign, ":scene_to_use", "scn_random_scene_snow"),
...
 
So I assume that means that it will be selected from a 100 different scenes, with scene 1-60 being those three custom ones and the last 40 just being randomly generated?
 
how can i create a thirst in my game? i want all parties to need water to move, and when water is not found in their items they go back to town to get water. when water is not found in the inventory all party members HP is halved.

i want this to effect all agents on the board. not just players. so if lords war party inventory = 0 water item they go to nearest town to get more or wait till its available.
i want to simplify this at first.
 
Cozur said:
So I assume that means that it will be selected from a 100 different scenes, with scene 1-60 being those three custom ones and the last 40 just being randomly generated?
No,
Code:
           (store_random_in_range,":battle_scene",1,100),
Is kind of a dice which when the script is called will give a number between 1 and 100
Code:
            (try_begin),
               (is_between,":battle_scene",1,20),
               (assign, ":scene_to_use", "scn_custom_battle_scene_plain_01"),
If the dice result is a value between 1 and 20, scn_custom_battle_scene_plain_01 will be the map used in the encounter
Code:
            (else_try),
               (is_between,":battle_scene",21,40),
               (assign, ":scene_to_use", "scn_custom_battle_scene_plain_02"),
If the dice result is a value between 21 and 40, scn_custom_battle_scene_plain_02 will be the map used in the encounter and so forth.
Code:
            (else_try),
               (assign, ":scene_to_use", "scn_random_scene_plain"),
            (try_end),
If the dice does not provide a value between 1 and 60 (between 1 and 20 launches first map, between 21 and 40 launches second map, between 41 and 60 launches third map), it switches to the random generated plains.

Note that the script is just an example and that you can modify the values to what fits you most.
If you still do not understand take it to PM so we don't spam the thread with the same question.
 
Does anyone know why music tracks could shuffle? The script was working pretty fine until some moment, when it started playing some random tracks at locations where they aren't supposed to play. Or other faction tracks @ another faction territory and not ever playing the needed one.
 
What do you guys think from scene for my coming mod:
(I posted it in german forum but there were no response)

Northampton Castle:










resource:
Image-01-1024x625.jpg
 
Arczx said:
1) How do you mod in religion?

2) How do you combine two different maps?

3) How do you mod in naval combat and coastal cities, as well as sea-bound trade routes for mods?

1) Module System, programming and ingenuity, though I bet someone did it before.

2) explain a bit more what you want to do.

3) simply search the Forge for "ship" like this. You can get a lot of answers like #1, #2, etc.

Though the search is really annoying (for me at least) and is not always returning the most relevant answers it still is useful, so search the Forge and the Unofficial Tutorials subpage and see what you get. Good luck.
 
All of his stuff is OSP, but you need to credit the original authors. Since all ranged weapons are prefixed with xeno_, they are supposed to be his. I do wonder about the arbalest though, it seems like a modified version of the Pope's arbalest, even the brfs have the same name.
 
Status
Not open for further replies.
Back
Top Bottom