Modding Q&A [For Quick Questions and Answers]

Users who are viewing this thread

Status
Not open for further replies.
Hello everybody,i'm having some troubles with this script. it removes troops for all lords except for fac_kingdom_1 lords. and also it removes garrison from villages.

here is the part i edited:


Code:
      (assign, ":party_template", 0),
      (store_random_in_range, ":rand", 0, 100),
      (try_begin),
        (this_or_next|eq, ":party_type", spt_town),
        (eq, ":party_type", spt_castle),  #CASTLE OR TOWN
        (try_begin),
          (lt, ":rand", 65),
          (assign, ":party_template", ":party_template_a"),
        (else_try),
          (assign, ":party_template", ":party_template_b"),
        (try_end),
      (else_try),
        (eq, ":party_type", spt_kingdom_hero_party),
        (try_begin),
        (eq,":party_faction","fac_kingdom_1"),
        (try_begin),
        (troop_get_slot,0,":leader",slot_african),
        (assign, ":party_template",":party_template_a"),
        (else_try),
        (troop_get_slot,0,":leader",slot_lamtuna),
        (assign, ":party_template", ":party_template_b"),
        (else_try),
        (troop_get_slot,0,":leader",slot_zenata),
        (assign, ":party_template",":party_template_c"),
        (try_end),
        (try_begin),
          (lt, ":rand", 50),
          (assign, ":party_template", ":party_template_a"),
        (else_try),
          (lt, ":rand", 75),
          (assign, ":party_template", ":party_template_b"),
        (else_try),
          (assign, ":party_template", ":party_template_c"),
        (try_end),
      (else_try),
      (try_end),
 
Code:
  (assign, ":party_template", 0),
      (store_random_in_range, ":rand", 0, 100),
      (try_begin),
        (this_or_next|eq, ":party_type", spt_town),
        (eq, ":party_type", spt_castle),  #CASTLE OR TOWN
        (try_begin),
          (lt, ":rand", 65),
          (assign, ":party_template", ":party_template_a"),
        (else_try),
          (assign, ":party_template", ":party_template_b"),
        (try_end),
      (else_try),
        (eq, ":party_type", spt_kingdom_hero_party),
        (try_begin),
             (eq,":party_faction","fac_kingdom_1"),                          #<- all further code is executed only if :party_faction is faction kingdom_1
             (try_begin),
                 (troop_get_slot,0,":leader",slot_african),
                 (assign, ":party_template",":party_template_a"),       #<- assingment of :party_template
             (else_try),
                 (troop_get_slot,0,":leader",slot_lamtuna),
                 (assign, ":party_template", ":party_template_b"),
             (else_try),
                 (troop_get_slot,0,":leader",slot_zenata),
                 (assign, ":party_template",":party_template_c"),
             (try_end),
        (try_begin),
          (lt, ":rand", 50),
          (assign, ":party_template", ":party_template_a"),                   #<- reassignment and overwriting the former value of :party_template
        (else_try),
          (lt, ":rand", 75),
          (assign, ":party_template", ":party_template_b"),
        (else_try),
          (assign, ":party_template", ":party_template_c"),
        (try_end),
      (else_try),                                       # <- does nothing ...should be removed.
      (try_end),



From what I can see, all this script does is to assign a reinforcements template to the variable :party_template.
Check out the comments in the scripts as it seems that you overwrite the value set within the next block.
I can't see how this would have any effect on the garrisons. It's just about to find the template that should be used.
So, whether I misunderstood your question or you left out some important parts that we should know about in order to be able to help you out.

 
I have a little Problem: I move scene props away in MP, but the collision stays there. I added the "moveable" flag, but still there is the problem.
 
Hey Folks!

Quick Question about the multiplayer GUI.  I've got my database sending equipment data when the player chooses a "troop"  this works fine except that the icons do not populate the slot view (you can mouse over a seemingly empty slot and the tool-tip text will show).  If I hit ESC and go back into the troop selection, the icons for equipment will show up without issue.

I think I'm missing something.  Is there an easy way to make the presentation 'refresh' without exiting and then going back into the selection screen?

Edit - I neglected to mention that clicking on an 'empty' icon populates all of the slots that appeared empty. 

I apologize if this is too elementary.
 
I missed something :p here is the whole script , know bugs : all garrisons have 0 mens and all lord except fac_1 lords doesn't have troops.

Code:
  # script_cf_reinforce_party
  # Input: arg1 = party_no,
  # Output: none
  # 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",
    [
      (store_script_param_1, ":party_no"),
      
      (store_faction_of_party, ":party_faction", ":party_no"),
      (party_get_slot, ":party_type",":party_no", slot_party_type),

#Rebellion changes begin: 
      (try_begin),
        (eq, ":party_type", spt_kingdom_hero_party),
        (party_stack_get_troop_id, ":leader", ":party_no"),
        (troop_get_slot, ":party_faction",  ":leader", slot_troop_original_faction),
      (try_end),
#Rebellion changes end

      (try_begin),
        (eq, ":party_faction", "fac_player_supporters_faction"),
        (party_get_slot, ":town_lord", ":party_no", slot_town_lord),
        (try_begin),
          (gt, ":town_lord", 0),
          (troop_get_slot, ":party_faction", ":town_lord", slot_troop_original_faction),
        (else_try),
          (party_get_slot, ":party_faction", ":party_no", slot_center_original_faction),
        (try_end),
      (try_end),
      
      (faction_get_slot, ":party_template_a", ":party_faction", slot_faction_reinforcements_a),
      (faction_get_slot, ":party_template_b", ":party_faction", slot_faction_reinforcements_b),
      (faction_get_slot, ":party_template_c", ":party_faction", slot_faction_reinforcements_c),

      (assign, ":party_template", 0),
      (store_random_in_range, ":rand", 0, 100),
      (try_begin),
        (this_or_next|eq, ":party_type", spt_town),
        (eq, ":party_type", spt_castle),  #CASTLE OR TOWN
        (try_begin),
          (lt, ":rand", 65),
          (assign, ":party_template", ":party_template_a"),
        (else_try),
          (assign, ":party_template", ":party_template_b"),
        (try_end),
      (else_try),
        (eq, ":party_type", spt_kingdom_hero_party),
        (try_begin),
        (eq,":party_faction","fac_kingdom_1"),
        (try_begin),
        (troop_get_slot,0,":leader",slot_african),
        (assign, ":party_template",":party_template_a"),
        (else_try),
        (troop_get_slot,0,":leader",slot_lamtuna),
        (assign, ":party_template", ":party_template_b"),
        (else_try),
        (troop_get_slot,0,":leader",slot_zenata),
        (assign, ":party_template",":party_template_c"),
        (try_end),
        (try_begin),
          (lt, ":rand", 50),
          (assign, ":party_template", ":party_template_a"),
        (else_try),
          (lt, ":rand", 75),
          (assign, ":party_template", ":party_template_b"),
        (else_try),
          (assign, ":party_template", ":party_template_c"),
        (try_end),
      (else_try),
      (try_end),

      (try_begin),
        (gt, ":party_template", 0),
        (party_add_template, ":party_no", ":party_template"),
      (try_end),
  ]),
 
Guys I'm having an issue with Freelancer script. is there a way to clear the 'Good to see you here Caba'drin, That was a good scrap! No joy blah blah" before it happens, ie I have a menu item that requests a meeting with my commander..

Code:
(
    "commander_aud",0,
    "Your request for a meeting is relayed to your commanders camp , and finally {s6} appears from his tent to speak with you.",
    "none",
    [(set_background_mesh, "mesh_pic_soldier_world_map"),(str_store_troop_name, s6, "$enlisted_lord")],
    [
      ("continue",[],
       "Continue...",
       [
        (call_script, "script_get_meeting_scene"), (assign, ":meeting_scene", reg0),
        (modify_visitors_at_site,":meeting_scene"),
        (reset_visitors),
        (set_visitor,0,"trp_player"),
        (set_visitor,17,"$enlisted_lord"),
        (jump_to_scene,":meeting_scene"),
        (change_screen_map_conversation, "$enlisted_lord"),
        
        ]),
        ("reject_talk_lord",[],"No, nevermind.",
        [(change_screen_map),]),
    ]
  ),

I need to clear what ever global is used to remember the battle, the guy we are helping appears and says 'yo' then the Lord I'm working for pops up and it doesn't clear when i say goodbye and players are unable to speak to the lord in any other way than in that scene. Any help would be appreciated.cheers!
 
(try_begin),
        (eq,":party_faction","fac_kingdom_1"),
        (try_begin),
        (troop_get_slot,0,":leader",slot_african), # <- Is this qualify as a conditional statement?
        (assign, ":party_template",":party_template_a"),
        (else_try),
        (troop_get_slot,0,":leader",slot_lamtuna),
        (assign, ":party_template", ":party_template_b"),
        (else_try),
        (troop_get_slot,0,":leader",slot_zenata),
        (assign, ":party_template",":party_template_c"),
        (try_end),
        (try_begin),
          (lt, ":rand", 50),
          (assign, ":party_template", ":party_template_a"),
        (else_try),
          (lt, ":rand", 75),
          (assign, ":party_template", ":party_template_b"),
        (else_try),
          (assign, ":party_template", ":party_template_c"),
        (try_end),
The bolded try_begin does not has a try_end, so only effect kingdom_1.

For town and castle, I didn't see anything wrong in the above script. However, I have experience the same no garrison or slow garrison build up when towns/castles have no or little income (wealth). Usually happens to castle when it change hand after the bouned village got raided.
 
The troop_get_slot is a conditional statement, by the way i don't know how to deal with it. because what i want to do is set some slot for some lords, and in reinforce party, check if the troops have the slots, and then assign a party template according to the slot.
I'm always confused with those try_begin and try_end, even now, i can't see where to add them.
 
taragoth said:
Guys I'm having an issue with Freelancer script. is there a way to clear the 'Good to see you here Caba'drin, That was a good scrap! No joy blah blah" before it happens, ie I have a menu item that requests a meeting with my commander..
Make a new value for the $talk_context variable, and make a check in module_dialogs for that dialog state. Or go in module_game_menus and check if you are not enlisted before calling script_add_log_entry with the player's participation.
Sayd Ûthman said:
I missed something :p here is the whole script , know bugs : all garrisons have 0 mens and all lord except fac_1 lords doesn't have troops.
Code:
(troop_get_slot,0,":leader",slot_african),
This does absolutely nothing - if you're checking if that slot is set (conditional statement), use (troop_slot_ge, ":leader", slot_african, 1). In this case you can refer to the party templates directly instead of using local variables fetched from faction slots.
Get Notepad++ and a syntax highlighter to collapse try_begins and such. If all of a sudden your file ends, that means you missed a try_end somewhere.
 
(troop_get_slot,0,":leader",slot_african),

Is logically wrong. Since it's a left-hand-side operation, the value of the troop slot would be stored in the variable specified in the left-most parameter. (Actually, all operations that return values to specified variables are left-hand-side operations). If you want to test if a value in a slot is equal to a value, try (troop_slot_eq, <troop>, <slot_number>, <value_to_be_compared>),
 
Hi, is there a way to make a castle surrender ? That option "Surrender, your situation is hopeless!" doesn't work! I had 400 soldiers and they had only 150, and they didn't surrendered! Is there a way to make this works ? Or is there a mod that already does this?(OSP)
 
Anyone have a script for an exploding sceneprop?
I'm working on making land mines. I have the models, but I need to make it so that when stepped on, they explode and kill the agent that walked on them and those within a distance.


If possible, to make a chain reaction, but that would come later. :smile:
 
[anyone,"start", [(eq, "$talk_context", tc_castle_commander)],
  "What do you want?", "player_siege_castle_commander_1", []],
  [anyone|plyr,"player_siege_castle_commander_1", [],
  "Surrender now! Your situation is hopeless!", "player_siege_ask_surrender", []],
  [anyone|plyr,"player_siege_castle_commander_1", [], "Nothing. I'll leave you now.", "close_window", []],

 
  [anyone,"player_siege_ask_surrender", [(lt, "$g_enemy_strength", 100), (store_mul,":required_str","$g_enemy_strength",5),(ge, "$g_ally_strength", ":required_str")],
  "Perhaps... Do you give your word of honour that we'll be treated well?", "player_siege_ask_surrender_treatment", []],
  [anyone,"player_siege_ask_surrender", [(lt, "$g_enemy_strength", 200), (store_mul,":required_str","$g_enemy_strength",3),(ge, "$g_ally_strength", ":required_str")],
  "We are ready to leave this castle to you and march away if you give me your word of honour that you'll let us leave unmolested.", "player_siege_ask_leave_unmolested", []],
  [anyone,"player_siege_ask_surrender", [],
  "Surrender? Hah! We can hold these walls until we all die of old age.", "close_window", []],

 
  [anyone|plyr,"player_siege_ask_surrender_treatment", [],
  "I give you nothing. Surrender now or prepare to die!", "player_siege_ask_surrender_treatment_reject", []],
  [anyone,"player_siege_ask_surrender_treatment_reject", [],
  "Bastard. We will fight you to the last man!", "close_window", []],
  [anyone|plyr,"player_siege_ask_surrender_treatment", [],
  "You will be ransomed and your soldiers will live. I give you my word.", "player_siege_ask_surrender_treatment_accept", []],
  [anyone,"player_siege_ask_surrender_treatment_accept", [],
  "Very well then. Under those terms, I offer you my surrender.", "close_window", [(assign,"$g_enemy_surrenders",1)]],

  [anyone|plyr,"player_siege_ask_leave_unmolested", [],
  "You have my word. You will not come under attack if you leave the castle.", "player_siege_ask_leave_unmolested_accept", []],
  [anyone,"player_siege_ask_leave_unmolested_accept", [],
  "Very well. Then we leave this castle to you. You have won this day. But we'll meet again.", "close_window", [(assign,"$g_castle_left_to_player",1)]],
  [anyone|plyr,"player_siege_ask_leave_unmolested", [],
  "Unacceptable. I want prisoners.", "player_siege_ask_leave_unmolested_reject", []],
  [anyone,"player_siege_ask_leave_unmolested_reject", [],
  "Then we will defend this castle to the death, and this parley is done. Farewell.", "close_window", []],

Can anyone explain this to me, i'm trying to mod it, and i'm new to this. This code does the following: When i ask them to surrender it checks, if their numbers are low than 100 and if they are , it multiplies by 5. So if my force is greater than that, they'll surrender, right ?
If is that, i wish to know if is it possible to check that and add a random chance of surrender, because if what i say is correct, they'll always surrender when the conditions match. Right ?
 
Caba`drin said:
I realize I can check, but if someone knows the answer off hand, I'd appreciate it:
When you disable a party, does that remove its members? When you re-enable it, will it be empty or have its prior membership?

Is that for player party or a Lords party? I know that in my mod the players party is backed up in a mock party, then returned to the player when asked for. Maybe this is possible with Lords as well?  Btw Caba, you have the source :wink: look it up.
 
Ragnadaam IV, You are mistaken, strength of a party is calculated with taking into account level of each non-wounded troop. Formula is next
2 * (lvl+4) * (lvl+4) / 100
if the result less then 1, it becomes = 1 (it works for troops with level 1-3).
So small party of healthy top-units can be stronger then army of weak and wounded ones. But you can make random multiplicator  (not 5 but from 1 to 5 for example).
 
Status
Not open for further replies.
Back
Top Bottom