Modding Q&A [For Quick Questions and Answers]

Users who are viewing this thread

Status
Not open for further replies.
What is that black area?
dbLPPQ.jpg
Scene code look like:
5VNggA.jpg
I used grpund paint for delete black area, its working but when I enter the scene again return to old black area.
 
frozenpainter said:
What is that black area?
dbLPPQ.jpg
Scene code look like:
5VNggA.jpg
I used grpund paint for delete black area, its working but when I enter the scene again return to old black area.

What happens when you play with size x and size y values?

------------------------------------

Can somebody tell me the number of sounds one can put in a line in module_sounds.py?

("draw_sword",sf_priority_4, ["draw_sword_02.flac","draw_sword_03.flac"]),

Is there a maximum?
 
snouz said:
Can somebody tell me the number of sounds one can put in a line in module_sounds.py?

("draw_sword",sf_priority_4, ["draw_sword_02.flac","draw_sword_03.flac"]),

Is there a maximum?
I never tried to break the limit, so no idea hehe. This is a example from VC:
Code:
 ("metal_hit_high_armor_high_damage",sf_priority_5|sf_vol_9, ["metal_high_high_01.wav","metal_high_high_02.wav","metal_high_high_03.wav","metal_high_high_04.wav","metal_high_high_05.wav","metal_high_high_06.wav","metal_high_high_07.wav","metal_high_high_08.wav","metal_high_high_09.wav","metal_high_high_10.wav","metal_high_high_11.wav","metal_high_high_12.wav","metal_high_high_13.wav","metal_high_high_14.wav","metal_high_high_15.wav","metal_high_high_16.wav","metal_high_high_17.wav","metal_high_high_18.wav","metal_high_high_19.wav","metal_high_high_20.wav","metal_high_high_21.wav","metal_high_high_22.wav","metal_high_high_23.wav","metal_high_high_24.wav","metal_high_high_25.wav","metal_high_high_26.wav","metal_high_high_27.wav","metal_high_high_28.wav","metal_high_high_29.wav","metal_high_high_30.wav","metal_high_high_31.wav","metal_high_high_32.wav"]),
^ that is a lot (32)
 
1) Can any of a troop's attributes, skills, or proficiencies be modified mid-mission? I know of the operations that exist for this (e.g., troop_raise_attribute and troop_raise_skill), but I'm betting they've mostly been used outside of missions.

2) Would any of the changes from #1 affect an agent of that troop type who was spawned prior to the modifications to its troop?

I did a bit of research on this but I found surprisingly little w/ my keywords. I've been planning to test this some anyway, but I wanted to consult the wise beforehand.
 
Hi all! I have an idea to add musicians to the "lord's parties" (now they are regiments) in single-player, and make them play bugles and drums accordingly to what is happening on the battlefield (different calls for charging, shooting etc.). I guess musicians can be made as some unique troops, drums and bugles can be made as weapon with 0 damage. But I don't know how to connect sound to certain order from player, and specifically to actions on the enemy's side, since I don't think bot-commander gives orders at all.
Maybe there is a mod or an OSP, where it already is, so I can take a look?

I don't work with scripts yet, but it is an important question for the future:smile:
 
Ivkolya said:
But I don't know how to connect sound to certain order from player, and specifically to actions on the enemy's side, since I don't think bot-commander gives orders at all.

you can test for the AI of agents and intercept your own commands/orders events. For that you will need to learn how to script, check the mission templates, the triggers applied to it... example:


Code:
team_get_hold_fire_order                 = 1784  # (team_get_hold_fire_order, <destination>, <team_no>, <division>),
                                                 # Retrieves current status of hold fire order for specified team/division (see aordr_* constants in header_mission_templates.py for reference).
Code:
aordr_fire_at_will      = 0
aordr_hold_your_fire    = 1

you giving a order..
Code:
ti_on_order_issued            = -71.0 # An agent has issued a tactical order
    # trigger param 1 = order_code (see mordr_* constants in header_mission_templates.py)
    # trigger param 2 = agent_id

Code:
mordr_hold				= 0
mordr_follow			= 1
mordr_charge			= 2
mordr_mount				= 3
mordr_dismount			= 4
mordr_advance			= 5
mordr_fall_back			= 6
mordr_stand_closer		= 7
mordr_spread_out		= 8
mordr_use_blunt_weapons = 9
mordr_use_any_weapon    = 10
mordr_stand_ground      = 11
mordr_hold_fire         = 12
mordr_fire_at_will      = 13
mordr_retreat           = 14
mordr_use_melee_weapons	= 15
mordr_use_ranged_weapons= 16
mordr_fire_at_my_command= 17
mordr_all_fire_now		= 18
mordr_left_fire_now		= 19
mordr_middle_fire_now	= 20
mordr_right_fire_now	= 21
mordr_form_1_row		= 22
mordr_form_2_row		= 23
mordr_form_3_row		= 24
mordr_form_4_row		= 25
mordr_form_5_row		= 26

Engine has what you need. Now its up to you to study it and hack your feature in there
 
frozenpainter said:
When I increase size x and y I meet this black area.
I remember having the same problem. It's ground colour or whatever it was called. You can remove it by painting it white. But don't bother, because it'll show up again the next time you load the scene. I believe that you need to re-make the scene from scratch, without fiddling with the size values this time. The game doesn't like it when you fiddle with the size values.
 
Hello,
Does anyone know how to edit the garrison sizes?
I figured out how to edit party size limits, but not garrison size limits.

Any heads up or telling me which script handles garrisons would be appreciated.
 
troycall said:
Does anyone know how to edit the garrison sizes?

Code:
  # Adds reinforcement to party according to its type and faction
  # Called from several places, simple_triggers for centers, script_hire_men_to_kingdom_hero_party for hero parties
  ("cf_reinforce_party",
    [
 
I am trying to add some fog to the main menu, and instead I am getting a mouse mesh. What is the problem?

Code:
 ("game_start", 0, 0,
  [(ti_on_presentation_load,
    [
	
	(assign, "$g_presentation_start_obj_1", -1),
    # (assign, "$g_presentation_start_obj_2", -1),
    # (assign, "$g_presentation_start_obj_alpha_1", -1),
    # (assign, "$g_presentation_start_obj_alpha_2", -1),
    ]),
    (ti_on_presentation_run,
    [
	   (store_trigger_param_1, ":cur_time"),
	  
	  (set_fixed_point_multiplier, 1000),
          (presentation_set_duration, 1000000),
	  
        (try_begin),
          (lt, "$g_presentation_start_obj_1", 0),
          (create_mesh_overlay, "$g_presentation_start_obj_1", "mesh_pic_vyrn_fog"),
          (overlay_set_alpha, "$g_presentation_start_obj_1", 0),
         # (position_set_x, pos1, 512),
         # (position_set_y, pos1, 512),
         # (overlay_set_size, "$g_presentation_start_obj_1", pos1),
          (position_set_x, pos1, 512),
          (position_set_y, pos1, 512),
          (overlay_set_position, "$g_presentation_start_obj_1", pos1),
          (overlay_animate_to_alpha, "$g_presentation_start_obj_1", 1000, 0xFF),
        (else_try),
           (gt, ":cur_time", 0),
           (overlay_get_position, pos25, "$g_presentation_start_obj_1"),
	   (position_move_x, pos25, 212),
	   (position_move_y, pos25, 212),
           (overlay_animate_to_position, "$g_presentation_start_obj_1", 20, pos25),
           (overlay_animate_to_alpha, "$g_presentation_start_obj_1", 500, 0xFF),
        (try_end),
     
    ]),
  ]),

Code:
 ("pic_vyrn_fog", 0, "pic_vyrn_fog", 0, 0, 0, 0, 0, 0, 1, 1, 1),

ZvKEG.png

Fko6T.png
 
I'm adding troops to party when player starts, now I'd like some variations with the troops rather than one variation.

Here is what I have in mind that could work:

Code:
  (store_random_in_range, ":fac_1_c_king0", "trp_finn_noble_1", "trp_mazovian_town_recruit"), # Culture units
  (store_random_in_range, ":fac_1_c_king1", "trp_finn_noble_1", "trp_mazovian_town_recruit"), # We want some troop variations, so we repeat the commands several times with different variables.
  (store_random_in_range, ":fac_1_c_king2", "trp_finn_noble_1", "trp_mazovian_town_recruit"),
  (store_random_in_range, ":fac_1_c_king3", "trp_finn_noble_1", "trp_mazovian_town_recruit"),

However i'm curious, is there a way to make that all into less lines?
As it stands, I tested the store_random_in_range althrough it chooses between noble_1 and mazovian_town_recruit, it however does not act as I want it to, when it chooses it spawns all those units as that one specific unit it chose, rather than a variety of units between finn_noble and mazovian_town_recruit.

So what I want to do is make the game randomly choose several troops (In one store_random_in_range if possible) between that finn_noble to mazovian range.

So right now simplfiied this is how its functioning:
  (store_random_in_range, ":fac_1_c_king2", "trp_finn_noble_1", "trp_mazovian_town_recruit"), > If the value ends up being, for example: finn_noble_1 then 30-100 of those troops will spawn with the party, with no variation (no noble_2 or noble_3 etc)

The way I intend for it to work is, 30-100 troops would spawn, each one being random, as in between noble_1 to mazovian_town_recruit.

Right now it only chooses one troop class per local variable and it would be annoying to code this into a large scale.
 
troycall said:
I'm adding troops to party when player starts, now I'd like some variations with the troops rather than one variation.

I doubt I understood it all, but it seems in short that you want a army of random composition. So a quick way to do that would be:

Code:
(try_for_range, ":unused", 0, 100), # Change 100 to the army size, or a variable, etc
 (store_random_in_range, ":troop", "trp_finn_noble_1", "trp_mazovian_town_recruit"), # it will choose between noble_1 and the one before town_recruit, NOT the town_recruit, remember its (max-1)
 (party_add_members, ":party", ":troop", 1), # it won't add more troops if it goes over the limit, remember that... 
(try_end),

Native uses a system with multiple templates. If you don't want to use that, the above code is a alternative.
 
kalarhan said:
troycall said:
I'm adding troops to party when player starts, now I'd like some variations with the troops rather than one variation.

I doubt I understood it all, but it seems in short that you want a army of random composition. So a quick way to do that would be:

Code:
(try_for_range, ":unused", 0, 100), # Change 100 to the army size, or a variable, etc
 (store_random_in_range, ":troop", "trp_finn_noble_1", "trp_mazovian_town_recruit"), # it will choose between noble_1 and the one before town_recruit, NOT the town_recruit, remember its (max-1)
 (party_add_members, ":party", ":troop", 1), # it won't add more troops if it goes over the limit, remember that... 
(try_end),

Native uses a system with multiple templates. If you don't want to use that, the above code is a alternative.
That works great for the main player party, if I wish for it to apply to all parties in the game a range, for example all of the lords in fac_kingdom_1, what do I need to do for that?

Thanks for the solution by the way, you saved me a lot of repetitive work.


 
troycall said:
I wish for it to apply to all parties in the game a range, for example all of the lords in fac_kingdom_1, what do I need to do for that?

1) You should step back and study the recruiting system used on Native. It is already random, with a weighted system that you can easily control

2) You need to be more specific. Is this a special event, only at game start, every time a lord gets a new army, every time a lord gets reinforcements, etc... each mechanism has its own place on the game code (triggers, etc) and in general they use the same recruiting script, which you could modify

A loop around all game parties, filtered by lord parties of XXX faction is easy to write. The question is: why and when you need that.
 
Does anyone know if you can emit FEWER than 1 particle per second? I've got some falling leaves, but they are falling at a rate that seems a tad excessive.

https://www.youtube.com/watch?v=hOACvVnYiII

I tried entering 0.3 for num_particles but that just resulted in zero emissions at all.


Code:
#Weirwood Leaves 
	 ("weirwood_leaves", psf_billboard_2d | psf_always_emit, "weirwood_leaf",
     1, 9, 0, 0.025, 4, 4,      #num_particles, life, damping, gravity_strength, turbulance_size, turbulance_strength
     (0, 1), (1, 1),            #alpha keys
     (0, 0.5), (1, 0.5),        #red keys
     (0, 0.5), (1, 0.5),        #green keys
     (0, 0.5), (1, 0.5),        #blue keys
     (0, 0.25),   (1, 0.25),    #scale keys
     (10, 10, 5),                 #emit box size
     (0, 0.01, -0.9),           #emit velocity
      0.02,                     #emit dir randomness
      15,                       #rotation speed
      0,                        #rotation damping
    ),
 
Mandible said:
Does anyone know if you can emit FEWER than 1 particle per second? I've got some falling leaves, but they are falling at a rate that seems a tad excessive.
Show the operation's code that you use to call the particle system.

Sherlock Holmes said:
Does anyone know how I would make it so that upon aiming a certain weapon you can't move? Like in the Deluge. Thanks!
If you want to apply it to a weapon type instead, you can set the aim-animation priority to a higher number (amf_priority_kick, or higher).
Otherwise track whether an agent aims with the specific weapon and then alter it's speed using;
Code:
# (agent_set_speed_modifier, <agent_id>, <value>),
# Version 1.153+. Changes agent's speed. Value is in percentage, 100 is default, value can be between [0..1000]
 
kalarhan said:
troycall said:
I wish for it to apply to all parties in the game a range, for example all of the lords in fac_kingdom_1, what do I need to do for that?

1) You should step back and study the recruiting system used on Native. It is already random, with a weighted system that you can easily control

2) You need to be more specific. Is this a special event, only at game start, every time a lord gets a new army, every time a lord gets reinforcements, etc... each mechanism has its own place on the game code (triggers, etc) and in general they use the same recruiting script, which you could modify

A loop around all game parties, filtered by lord parties of XXX faction is easy to write. The question is: why and when you need that.

1. What I intend to do is change the starting amount of troops *when game starts, so for example they start with 1000 troops* for every party (Increase or decrease the amount (For kings etc should be slightly more troops)). (While making sure they are using the correct troops for their faction) for example swadian lords use swadian troops, its already set I'm not sure how to change it tho.

2. Also make it so that everytime a lord gets a new army, they recruit in a similiar pace (increased pace if 1000 starting troops, for example if starting at 100, speed is 1x, if starting at 1000 troops, recruting amounts should be 10x as to not take ages to recruit.

3. Everytime they get reinforcements, should also depend on the amount of starting troops I had set, I can easily accomplish all of this, since I already made a global variable for controlling maximum party sizes - I can use that as the amount of starting troops, thus there would be compatibility between maximum party sizes and well, this.

As expressed I can accomplish that easily if i get a hint on which script may be controlling the amount of starting troops, and how fast lords reinforce/get new armies.

I checked cf_reinforce_party however it seems to only affect reinforcements, and not initial starting amount of troops per lords.
 
Status
Not open for further replies.
Back
Top Bottom