Modding Q&A [For Quick Questions and Answers]

Users who are viewing this thread

Status
Not open for further replies.
La Grandmaster said:
If anyone knows why I only get two guards spawning at entry point 52 - instead of two at entry point 50 and one at entry point 51 I would appreciate it
La Grandmaster said:
- the entry points are listed in the mission template as - should I have coded in entry points 48 and 49 as well? evn though i wont use them
Yes you have to add them. The entry points in scenes are not the same ones used in operations. In operations you are using index of entry in mission template, not the number of entry in scene. 
So basically your entry point 48 (in mission template) is entry_no=48 (for purpose for all operations) that uses entry-no=50 (from your scene).

It seems illogical at start, but this way you are able to do things like:
Code:
(47,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]),
(47,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
This allows you to spawn dismounted troops on scene entry 47 using entry_no=47, and mounted ones on the same scene entry 47, when using entry_no=48. Tricky, but useful.

If you don't want to add unused entries then just change:
Code:
        (set_visitors,50,"trp_mounted_walker_aryan",2),
        (set_visitor,51,"trp_mounted_walker_aryan"),
to:
Code:
        (set_visitors,48,"trp_mounted_walker_aryan",2),
        (set_visitor,49,"trp_mounted_walker_aryan"),
and it should work.
 
Got a relatively simple question that most certainly has a complicated answer.

How would I prevent the engine from expecting/generating terrain and greatly expand the boundaries? The reason for this, is that I'd like to create a very large map for a planned PW server, but the terrain used in Warband's engine is just too ineffecient; a flat plane uses an ungodly number of polygons, which is especially hellish for the auto-generated collision.

I would then use a custom heightmap which would be optimized in 3DS Max, but that I know how to do. It's the above I would like to learn about.

Would it involve commenting out a couple lines, or is it just so dastardly that it should never be attempted, lest the engine cause a computer to crash and burn?

Thanks in advance.
 
You can do everything you mentioned just by editing your entry in module_scenes.py
- remove sf_generate from the flags (2nd field) to prevent the engine from generating terrain
- set min and max (5th and 6th field) to make an arbitrarily large scene (given that you are not constrained by auto-generated terrain maximum size anymore)
- set mesh and body (3rd and 4th field) to your manually generated terrain mesh and body, or use scene props if your terrain is made up of several meshes/bodies (probably a better idea performance wise)

Keep in mind, however, that you will need to place all flora manually (including grass).
 
Something unusual said:
Cozur said:
Looking for a piece of code that will cause set lords to defect to a set faction if a castle is captured.
I think this will work:
Code:
           (call_script, "script_change_troop_faction", "trp_", "fac_"),

Thanks man.

Also looking for a way to stop companions moving around. I'd rather be able to have them appear in set taverns.
 
I believe you need to disable the script that moves them around
script_update_companion_candidates_in_taverns (I think that's it)
  and add them manually in the tavern spawning menu, mnu_town_tavern under the merchants near the end
Code:
            (try_begin),
               (eq, "$current_town", "p_"),
               (set_visitor, ":cur_entry", "trp_"),
               (val_add, ":cur_entry", 1),
             (try_end),
 
jacobhinds said:
is there a way to give certain factions larger armies? for example lords from one faction might have armies up to 300 in size, while another might be limited to around 50.

Edit the faction reinforcements in party_templates.
 
Somebody said:
Docm30 said:
Is there a good way I can make an agent always face forward and not turn to face the player when approached or talked to?
(agent_set_no_dynamics)? It might only prevent them from moving, as the player agent can still turn when that's applied to them. Otherwise you can do stupid stuff like having them be mounted on a tiny invisible horse (if you can manage to enforce a horseback idle animation), or even having a scene prop on top of an invisible agent.
Cozur said:
Any way to make it so that the entrance to this scene:
appears in a certain town only. Say you enter the town of Whatevertowncity and you can enter this particular scene, but only in this particular town? And when you do, it takes 12 hours to enter the scene, and 12 hours to leave it.
Add a menu option in the default town menu, checking for whatever town this is. You then use rest_for_hours before jumping to the menu or making use of Native's auto-jump feature after resting. In the scene itself you should add a trigger to rest_for_hours inside when the player exits the scene (tab, scene limit), or toss it in the menu's second option before having it jump back to whatever city.
cucas said:
How can I make AI shoot badly under foggy conditions? I want to reduce shooting range and accuracy.
This already happens with crossbows inside the engine itself, but you can also catch get_global_cloud_amount/get_global_haze_amount and then do agent_set_accuracy_modifier/agent_set_reload_speed_modifier inside the mission template when agents are spawned. Try not to check it inside the loop itself and experiment to see what conditions actually create fog inside the game.

Hmm, like this?

Code:
	("town_bank",
       [(party_slot_eq, "p_town_17", slot_party_type, spt_town)],
       "Visit the Iron Bank of Braavos.",
       [	
			(assign, reg10, 0),
			(start_presentation, "prsnt_bank"),
        ]),
 
Any particular reason this script wouldn't work?:

Code:
        (try_begin),
        (eq, ":center_no", "p_town_6"),
        (eq, ":center_faction", "fac_kingdom_8"),
        (call_script, "script_change_troop_faction", "trp_knight_1_1", "fac_kingdom_8"),
        (call_script, "script_change_troop_faction", "trp_knight_1_2", "fac_kingdom_8"),
        (call_script, "script_change_troop_faction", "trp_knight_1_3", "fac_kingdom_8"),
        (call_script, "script_change_troop_faction", "trp_knight_1_4", "fac_kingdom_8"),
        (call_script, "script_change_troop_faction", "trp_knight_1_5", "fac_kingdom_8"),
        (call_script, "script_change_troop_faction", "trp_knight_1_6", "fac_kingdom_8"),
        (call_script, "script_change_troop_faction", "trp_knight_1_7", "fac_kingdom_8"),
        (call_script, "script_change_troop_faction", "trp_knight_1_11", "fac_kingdom_8"),
        (call_script, "script_change_troop_faction", "trp_knight_1_14", "fac_kingdom_8"),
        (call_script, "script_change_troop_faction", "trp_knight_1_15", "fac_kingdom_8"),
        (call_script, "script_change_troop_faction", "trp_knight_1_18", "fac_kingdom_8"),
        (call_script, "script_change_troop_faction", "trp_knight_1_19", "fac_kingdom_8"),
        (call_script, "script_change_troop_faction", "trp_knight_1_20", "fac_kingdom_8"),
        (call_script, "script_change_troop_faction", "trp_knight_1_21", "fac_kingdom_8"),
        (call_script, "script_change_troop_faction", "trp_knight_1_22", "fac_kingdom_8"),
        (call_script, "script_change_troop_faction", "trp_knight_1_23", "fac_kingdom_8"),
        (try_end),
 
Is there anyway to enforce ragdolls to be enabled?

Also
Code:
["krag", "Springfield M1892-99 Krag", [("krag",0)], itp_type_crossbow |itp_merchandise|itp_primary|itp_two_handed|itp_cant_reload_on_horseback|itp_next_item_as_melee ,itc_parry_polearm|itcf_shoot_musket|itcf_carry_crossbow_back, 
683 , weight(4.3)|difficulty(0)|spd_rtng(18) | shoot_speed(410) | thrust_damage(200 ,pierce)|max_ammo(5)|accuracy(126),imodbits_none,
[(ti_on_weapon_attack, [(play_sound,"snd_rifle")])]],
What do i need to add to make the sound heard by everyone on multiplayer, because that currently only lets the player hear it.
 
Cozur said:
Any particular reason this script wouldn't work?:
What script? Its simply a try-end block, so what do you mean...
The conditions in the block or the script it self which should be called?
Adding debug messages is allways a got method to check what works and what isn't working.

Willhelm said:
Is there anyway to enforce ragdolls to be enabled?

Also
Code:
["krag", "Springfield M1892-99 Krag", [("krag",0)], itp_type_crossbow |itp_merchandise|itp_primary|itp_two_handed|itp_cant_reload_on_horseback|itp_next_item_as_melee ,itc_parry_polearm|itcf_shoot_musket|itcf_carry_crossbow_back, 
683 , weight(4.3)|difficulty(0)|spd_rtng(18) | shoot_speed(410) | thrust_damage(200 ,pierce)|max_ammo(5)|accuracy(126),imodbits_none,
[(ti_on_weapon_attack, [(play_sound,"snd_rifle")])]],
What do i need to add to make the sound heard by everyone on multiplayer, because that currently only lets the player hear it.
By setting "Number of Ragdolls" to unlimited in the graphics options?!

"ti_on_weapon_attack" is only fired serverside, so just the host can hear it.
You'd have to write a client/server event for that... or even better use a script which is called by the engine everytime a missile launches client/serverside.
It's called "game_missile_launch" and has been added to WFAS, but also works for Warband ofc.
Code:
  # script_game_missile_launch
  # Input: arg1 = shooter_agent_id, arg2 = weapon_item_id, pos1 = weapon_item_position
  # Output: none 
  ("game_missile_launch",
  [
    (store_script_param, ":shooter_agent", 1),
    (store_script_param, ":item_id", 2),
    ...
    ...
  ]),
 
cucas said:
Hey, so I've created a faction just for mercenaries and I've been wondering how to make it possible to hire them.

The idea is to initiate a dialog if I encounter them on the world map and make them join me if I pay up.

In theory, I think I might know how it works, but i can't make it happen in practice. Sadly, I don't even know how to make a dialog just for the mercs. Ideally, the idea is to have a few options, like this:

1. Hire them into my party (don't know how to transfer troops).

2. Hire them as a separate party. ( think I'd have to use script_change_troop_faction)

3. Bribe a party already recruited by AI at twice their price (original_faction is merc, but current party is not?)

Well first create the party spawn on the world map.
To make a dialog just look at other dialogs for party template and you'll see how it's done. To hire them into your party I think there is an operation that does that (so search in header_operations.py, party_join I think?) and add it after the player selects that dialog option.
To hire them as a separate party just make it so that after the player talks to the party and hires them set their ai behavior to follow the player. 
Do pretty much the same thing with the bribing dialog.
 
Well hello dear modders. Can anyone of you help me how to add the Native training system in a mod like Persistent World? For example: To become an archer, you go to an Archery Range, take the practice bow and arrows, and shoot at 3 targets and there you go! You become an Archer! The reason why I want to know this is because I am bored of the training system in Persistent World, and second, I am making a mod and I want this kind of training system in my mod. Please if anyone has the time to help me with this I would be verry thankful, also this will make mods such as Persistent World more interesting. Whoever is interested in helping me with a mod like Persistent World I am making, they can PM me.
 
Willhelm said:
Also
Code:
["krag", "Springfield M1892-99 Krag", [("krag",0)], itp_type_crossbow |itp_merchandise|itp_primary|itp_two_handed|itp_cant_reload_on_horseback|itp_next_item_as_melee ,itc_parry_polearm|itcf_shoot_musket|itcf_carry_crossbow_back, 
683 , weight(4.3)|difficulty(0)|spd_rtng(18) | shoot_speed(410) | thrust_damage(200 ,pierce)|max_ammo(5)|accuracy(126),imodbits_none,
[(ti_on_weapon_attack, [(play_sound,"snd_rifle")])]],
What do i need to add to make the sound heard by everyone on multiplayer, because that currently only lets the player hear it.

a very simple way of playing sound that will be heard by everyone is this method

Code:
(ti_on_weapon_attack, [
 (store_trigger_param_1, ":agent_id"),
 (agent_play_sound, ":agent_id", "snd_rifle"),
 ])
agent_play_sound is automatically synced with the client, so it will not require a new event that will play sound in clients
 
The_dragon said:
Willhelm said:
Also
Code:
["krag", "Springfield M1892-99 Krag", [("krag",0)], itp_type_crossbow |itp_merchandise|itp_primary|itp_two_handed|itp_cant_reload_on_horseback|itp_next_item_as_melee ,itc_parry_polearm|itcf_shoot_musket|itcf_carry_crossbow_back, 
683 , weight(4.3)|difficulty(0)|spd_rtng(18) | shoot_speed(410) | thrust_damage(200 ,pierce)|max_ammo(5)|accuracy(126),imodbits_none,
[(ti_on_weapon_attack, [(play_sound,"snd_rifle")])]],
What do i need to add to make the sound heard by everyone on multiplayer, because that currently only lets the player hear it.

a very simple way of playing sound that will be heard by everyone is this method

Code:
(ti_on_weapon_attack, [
 (store_trigger_param_1, ":agent_id"),
 (agent_play_sound, ":agent_id", "snd_rifle"),
 ])
agent_play_sound is automatically synced with the client, so it will not require a new event that will play sound in clients
But its only synced to players within a radius of 20 meter, so you wont hear it from a further distance.
The script "game_missile_launch" is the way to go, as I mentioned in my previous post.
 
_Sebastian_ said:
Cozur said:
Any particular reason this script wouldn't work?:
What script? Its simply a try-end block, so what do you mean...
The conditions in the block or the script it self which should be called?
Adding debug messages is allways a got method to check what works and what isn't working.

Ah yeah, I'd managed to add it under the wrong block, works now. Wanted to add this, though:

Code:
        (call_script, "script_add_notification_menu", "mnu_defect_kings_landing_taken_by_dragonstone", 0, 0),

However, it fires constantly, due to no limitations. How do I make the menu pop up only once?
 
I am serious, if anyone can help me with this I really don't know how to put this in the mod I am making  :sad:
 
Status
Not open for further replies.
Back
Top Bottom