Modding Q&A [For Quick Questions and Answers]

Users who are viewing this thread

Status
Not open for further replies.
Anglolord said:
So why do they not load in the game? Am I missing a code somewhere?

the first check you need to do: order of imports on module.ini

textures > materials > meshes

if you invert the order they wont be displayed properly in the game (even if it looks OK on OpenBRF)
 
Not entirely sure where this question goes but this seems like the right place.

Would it be possible to make a book and have it increase multiple skills? I was looking at some books in Morghs, but they dont list any of the bonuses they give, so im not entirely sure how you would go about doing that.

Like for instance, Book of Persistance - +2 Wound Treatment / Surgery / First Aid

Would something like that be possible? and if so, how would you do it?
Also, anyway to make it so it could be brought into any mod or would that be more difficult?
 
Hi,
I tried and looked for a solution on the forum but I did not find.

I want to modify the Module System (Floris Mod Pack) to be able to ask my patrol (outpost patrol) to reinforce my outpost, but it is not recognized as a usual castle! Is there a solution?

Code:
    ##reinforce garrison
  [anyone|plyr, "outpost_patrol", [], "I need you to reinforce a garrison.", "patrol_orders_garrison_ask", 
  []],
  
  [anyone, "patrol_orders_garrison_ask", [], "Where should we go?", "patrol_garrison_target", #"dplmc_patrol_garrison_target", 
  []],
  
  [anyone|plyr|repeat_for_parties, "patrol_garrison_target",
  [
    (store_repeat_object, ":party_no"),
    (is_between, ":party_no", centers_begin, centers_end),
    (store_faction_of_party, ":party_faction", ":party_no"),
    (eq, ":party_faction", "$players_kingdom"),
    (str_store_party_name, s11, ":party_no"),
  ],
  "{!}{s11}.", "patrol_garrison_confirm_ask", 
  [
    (store_repeat_object, "$diplomacy_var"),
  ]
  ],
  
  [anyone|plyr, "patrol_garrison_target", [], "Nevermind.", "outpost_patrol_pretalk", 
  []],
  
  [anyone, "patrol_garrison_confirm_ask", 
   [(str_store_party_name, s5),], 
   "As you wish, we will reinforce the forteresse.", "patrol_garrison_confirm", 
   []
  ],
  
  [anyone|plyr, "patrol_garrison_confirm", [(str_store_party_name, s5, "$diplomacy_var"),], "Thank you.", "close_window", 
  [
    (party_set_name, "$g_encountered_party", "@{s5} patrol"),
    (party_set_slot, "$g_encountered_party", slot_party_ai_object, "$diplomacy_var"),
    (party_set_slot, "$g_encountered_party", slot_party_ai_state, spai_retreating_to_center),
    (party_set_ai_behavior, "$g_encountered_party", ai_bhvr_travel_to_party),
    (party_set_ai_object, "$g_encountered_party", "$diplomacy_var"),
    (assign, "$g_leave_encounter", 1),
   ]],
  
  [anyone|plyr, "patrol_garrison_confirm", [], "Wait, I changed my mind.", "outpost_patrol_pretalk", 
  []],

  ##       

152369207394624505.jpg


Thank you to help me.


 
lolitablue said:
Code:
  [anyone|plyr|repeat_for_parties, "patrol_garrison_target",
  [
    (store_repeat_object, ":party_no"),
    (is_between, ":party_no", centers_begin, centers_end),
    (store_faction_of_party, ":party_faction", ":party_no"),
    (eq, ":party_faction", "$players_kingdom"),
    (str_store_party_name, s11, ":party_no"),
  ],
  "{!}{s11}.", "patrol_garrison_confirm_ask", 
  [
    (store_repeat_object, "$diplomacy_var"),
  ]
  ],

you would probably want to change this
Code:
(is_between, ":party_no", centers_begin, centers_end),
into something like
Code:
(party_get_template_id, ":pt", ":party_no"),
(this_or_next|eq, ":pt", <outpost_party_template>),
(is_between, ":party_no", centers_begin, centers_end),
or
Code:
(this_or_next|eq, ":party_no", "p_outpost"),
(is_between, ":party_no", centers_begin, centers_end),




Seipherwood said:
Not entirely sure where this question goes but this seems like the right place.

Would it be possible to make a book and have it increase multiple skills? I was looking at some books in Morghs, but they dont list any of the bonuses they give, so im not entirely sure how you would go about doing that.

Like for instance, Book of Persistance - +2 Wound Treatment / Surgery / First Aid

Would something like that be possible? and if so, how would you do it?
Also, anyway to make it so it could be brought into any mod or would that be more difficult?

you would need to use the module system for that:
Code:
	#script_game_get_skill_modifier_for_troop
	# This script is called from the game engine when a skill's modifiers are needed
	# INPUT: arg1 = troop_no, arg2 = skill_no
	# OUTPUT: trigger_result = modifier_value
	("game_get_skill_modifier_for_troop",[(store_script_param, ":troop_no", 1),
			(store_script_param, ":skill_no", 2),
			(assign, ":modifier_value", 0),
			(try_begin),
				(eq, ":skill_no", "skl_wound_treatment"),
				(call_script, "script_get_troop_item_amount", ":troop_no", "itm_book_wound_treatment_reference"),
				(gt, reg0, 0),
				(val_add, ":modifier_value", 1),
			(else_try),
				(eq, ":skill_no", "skl_trainer"),
				(call_script, "script_get_troop_item_amount", ":troop_no", "itm_book_training_reference"),
				(gt, reg0, 0),
				(val_add, ":modifier_value", 1),
			(else_try),
				(eq, ":skill_no", "skl_surgery"),
				(call_script, "script_get_troop_item_amount", ":troop_no", "itm_book_surgery_reference"),
				(gt, reg0, 0),
				(val_add, ":modifier_value", 1),
			(try_end),
			(set_trigger_result, ":modifier_value"),
			]),
 
erennuman_mb said:
Why does the module system assign -1 or 0 to variables, only to store something else in them a few lines later? Is there any benefit to this?

to prevent unassigned variables. They share memory address and in some cases (like fast loops) or OS (like Linux and Mac) can have some weird behaviours. A classic example is the Linux/MAc bug with the budget giving players like 9 trillions in debt.

Code:
(assign, ":var1", 0),
(val_add, ":var1", 10),

without the assign there you have no idea what the result of that sum would be.
 
Ikaguia said:
lolitablue said:
Code:
  [anyone|plyr|repeat_for_parties, "patrol_garrison_target",
  [
    (store_repeat_object, ":party_no"),
    (is_between, ":party_no", centers_begin, centers_end),
    (store_faction_of_party, ":party_faction", ":party_no"),
    (eq, ":party_faction", "$players_kingdom"),
    (str_store_party_name, s11, ":party_no"),
  ],
  "{!}{s11}.", "patrol_garrison_confirm_ask", 
  [
    (store_repeat_object, "$diplomacy_var"),
  ]
  ],

you would probably want to change this
Code:
(is_between, ":party_no", centers_begin, centers_end),
into something like
Code:
(party_get_template_id, ":pt", ":party_no"),
(this_or_next|eq, ":pt", <outpost_party_template>),
(is_between, ":party_no", centers_begin, centers_end),
or
Code:
(this_or_next|eq, ":party_no", "p_outpost"),
(is_between, ":party_no", centers_begin, centers_end),

Thank you for answering me but it does not work. Sorry.


I replaced
Code:
(is_between, ":party_no", centers_begin, centers_end),

by
Code:
(party_get_template_id, ":pt", ":party_no"),
(this_or_next|eq, ":pt", <outpost_party_template>),
(is_between, ":party_no", centers_begin, centers_end),

 
lolitablue said:
I replaced
Code:
(is_between, ":party_no", centers_begin, centers_end),

by
Code:
(party_get_template_id, ":pt", ":party_no"),
(this_or_next|eq, ":pt", <outpost_party_template>),
(is_between, ":party_no", centers_begin, centers_end),

you are suppose to replace the
Code:
<outpost_party_template>

with yours. That is a placeholder.
 
Can anyone tell me how I can:

-Repeat sound X times or make it infinity.

-Play sound at  x entry point .

  (entry_point_get_position,pos1, 100),
(play_sound_at_position, "snd_distant_dog_bark", pos1),

this way not working for me ;/


-  What is option in this case?

(play_sound_at_position, <sound_id>, <position_no>, [options]),
 
PitchPL said:
-  What is option in this case?

Code:
play_sound_at_position   =  599  # (play_sound_at_position, <sound_id>, <position>, [options]),
                                 # Plays a sound in specified scene position. See sf_* flags in header_sounds.py for reference on possible options.

See sf_* flags in header_sounds.py for reference on possible options.
 
Hello my friends so useful...

Help me please...

That's my problem:
If I hire 10 freelancers from "Sigmund the recruiter" and after I want to customize their equipment, it will cost me; for example: I give them one sword or shield it will cost me the price of a single sword for all these men!

What I would like to do?
If I had 10 men then I want to paid ten swords or shield for them!

How to multiply the price by 10?

Thank you for your help
 
lolitablue said:
How to multiply the price by 10?
Multiply the price by 10...
Code:
val_mul                = 2107	#dest, operand ::       dest = dest * operand
				# (val_mul,<destination>,<value>),
store_mul              = 2122	#dest, op1, op2 :      dest = op1 * op2
				# (store_mul,<destination>,<value>,<value>),
 
_Sebastian_ said:
lolitablue said:
How to multiply the price by 10?
Multiply the price by 10...
Code:
val_mul                = 2107	#dest, operand ::       dest = dest * operand
				# (val_mul,<destination>,<value>),
store_mul              = 2122	#dest, op1, op2 :      dest = op1 * op2
				# (store_mul,<destination>,<value>,<value>),

Thank you.

I know that there is a mod that has this system cost when equiping our soldiers but I forgot the name!

He could inspire me to realize my idea. Because I don't know where to start.
 
lolitablue said:
Because I don't know where to start.

describe what you want to do in detail (not couple words), bring your code (What you did so far) and any screenshots that help explain it. Then ask the parts you dont understand about or need help with.
 
Kortlcha said:
I added passage. But I need the codes which makes me jump another scene. I couldn't find the codes I need. How can I do that?

it is explained in the tutorial. The code is the game menu itself (the menu entry). Just observe the order (ID) of the entry

Code:
 (
    "zendar",mnf_auto_enter,
    "You enter the town of Zendar.",
    "none",
    [(reset_price_rates,0),(set_price_rate_for_item,"itm_tools",70),(set_price_rate_for_item,"itm_salt",140)],
    [
      ("zendar_enter",[],"_",[(set_jump_mission,"mt_town_default"),(jump_to_scene,"scn_zendar_center"),(change_screen_mission)],"Door to the town center."),

note how "zendar_center" is the entry, and it has a text to be displayed in the game: "Door to the ..."
 
Hello everyone. So I was playing a little with the village/castles/towns improvements and I have a question now. Does the code below really adds the 5% prosperity ? Because I tested it in-game and the village prosperity does not changes right after the improvement is complete but after some days. So, I'm not sure if it's the improvement(Mill) is affecting the prosperity or is something else.

Code:
      (try_begin),
        (is_between, ":center_no", villages_begin, villages_end),
        (party_slot_eq, ":center_no", slot_center_has_fish_pond, 1),
        (val_add, ":ideal", 5),
      (try_end),
 
VvVlad said:
Hello everyone. So I was playing a little with the village/castles/towns improvements and I have a question now. Does the code below really adds the 5% prosperity ? Because I tested it in-game and the village prosperity does not changes right after the improvement is complete but after some days. So, I'm not sure if it's the improvement(Mill) is affecting the prosperity or is something else.

Code:
      (try_begin),
        (is_between, ":center_no", villages_begin, villages_end),
        (party_slot_eq, ":center_no", slot_center_has_fish_pond, 1),
        (val_add, ":ideal", 5),
      (try_end),

next time you should post the entire script. Assuming this is pure Native you need to look at the script name and what it is the function for it. The idea here is to have a ideal value, not the prosperity per si, to balance the random increase/decrease that happens on a schedule of 24 hours.
 
Status
Not open for further replies.
Back
Top Bottom