Modding Q&A [For Quick Questions and Answers]

Users who are viewing this thread

Status
Not open for further replies.
Why some codes are using the condition operations like 1=1 or 0=1 ? for ex;

("start_mod",[(eq,1,1),],"Quick Character (for mod testing)",
      [
          (troop_set_type,"trp_player",0),
          (assign,"$character_gender",tf_male),
        (troop_raise_attribute, "trp_player",ca_intelligence,-4),       
          (change_screen_return, 0),
      ]
  ),
 
Hey does anyone know why my dialog isnt working?  :???:

[trp_zarbon,"zarbon_5a7", [], "Who told you that?! Only me and a few of the troops escaping Ela by ship where there to see Prince Ariel and his home go down.\
  B-but how can that be?! I was the only survivor in that ship!\
  Oh what am I saying?! Maybe- Ugh! You've wasted enough of time! Please leave me alone.", "close_window", [(assign, "$zarbon_confused_about_player", 1)]],

  [trp_zarbon|plyr,"zarbon_4", [], "It was nothing, really.", "close_window", [(assign, "$wasted_zarbons_time", 1)]],
  [trp_zarbon,"start", [(eq, "$wasted_zarbons_time", 1)], "Please do not waste anymore of my time. My mission demands my full concentration.", "close_window", []],

  [trp_zarbon,"start", [(eq, "$zarbon_confused_about_player", 1)], "Oh...It's you again...", "close_window", [(remove_troop_from_site, "trp_zarbon", "scn_town_1_center")]]
,

I made a some dialogs. after some of the dialog options it assigns a global variable a value. but my problem is ingame it does not use the bottom dialog in red with the conditions. there is 2 closing dialogs, each assigns a global variable but if I try talking to Zarbon again he doesnt use the 2 starting conditioned dialogs ment for the variable that was just assigned moments ago. how do i fix this?
 
CutContent said:
Hey does anyone know why my dialog isnt working?  :???:

[trp_zarbon,"zarbon_5a7", [], "Who told you that?! Only me and a few of the troops escaping Ela by ship where there to see Prince Ariel and his home go down.\
  B-but how can that be?! I was the only survivor in that ship!\
  Oh what am I saying?! Maybe- Ugh! You've wasted enough of time! Please leave me alone.", "close_window", [(assign, "$zarbon_confused_about_player", 1)]],

  [trp_zarbon|plyr,"zarbon_4", [], "It was nothing, really.", "close_window", [(assign, "$wasted_zarbons_time", 1)]],
  [trp_zarbon,"start", [(eq, "$wasted_zarbons_time", 1)], "Please do not waste anymore of my time. My mission demands my full concentration.", "close_window", []],

  [trp_zarbon,"start", [(eq, "$zarbon_confused_about_player", 1)], "Oh...It's you again...", "close_window", [(remove_troop_from_site, "trp_zarbon", "scn_town_1_center")]]
,

I made a some dialogs. after some of the dialog options it assigns a global variable a value. but my problem is ingame it does not use the bottom dialog in red with the conditions. there is 2 closing dialogs, each assigns a global variable but if I try talking to Zarbon again he doesnt use the 2 starting conditioned dialogs ment for the variable that was just assigned moments ago. how do i fix this?
Put those starting dialogs on top of the whole dialog.
 
Anybody knows solution?

Tüfekçi Başı said:
Hello

(agent_get_wielded_item, <destination>, <agent_id>, <hand_no>),

I can get agent's bow in right hand with this code.
(agent_get_wielded_item, ":a_bow", ":agent", 0),

But I couldn't get agent's left hand when he uses arrow with this code.
(agent_get_wielded_item, ":an_arrow", ":agent", 1),

Where is my mistake?  :???:
 
you could try running trought the agents equiped items and use the first non-empty arrow that you find, or maybe the last one, I'm not sure which does WB use
 
Does anyone know how to define animations for itcf/itp tags in module items py? Im trying to make a rifle with its own custom running anims and stuff. But I dont see where itcf/itp tags define what anims it uses. I checked in header items it doesnt seem to reference anything. Anybody know how to do this? I searched for tutorials but i cant find one. please help me
 
Hey guys! Anyone wanna share with me how I can get a dialogue going between two npcs, wherein one npc says something then the other and so on.  Here's what I've tried, needless to say it doesn't work.

Code:
[trp_npc7,"start", [(eq,"$talk_context", tc_compdialog),(eq, "$rezien", 1),], "x","rezien1-1",[(assign, "$rezien", 2),]],
 [trp_npc10,"rezien1-1", [], "y", "rezien1-2",[]],
 [trp_npc7,"rezien1-2", [], "z", "rezien1-3",[]],
 [trp_npc10,"rezien1-3", [], "x", "rezien1-4",[]], ....

Any input is appreciated!
 
Use anyone|other(trp_npc10) instead of trp_npc10 from a dialogue that's started by trp_npc7.
You also need to make sure both troops are visitors in the current scene, and that other conversation globals you take for granted (like $g_talk_troop) are set properly.
 
Somebody said:
Use anyone|other(trp_npc10) instead of trp_npc10 from a dialogue that's started by trp_npc7.
You also need to make sure both troops are visitors in the current scene, and that other conversation globals you take for granted (like $g_talk_troop) are set properly.

Thanks a million! Works like a charm.
 
Hi everyone!

In multiplayer I know you can define the game time length easy enough from the existing UI

However is there a way to increase the duration before the bots spawn? At present I think its 20 seconds and I would like to increase it to say 1 minute.

It always feels a mad rush to choose the gear you want before the bots spawn.. else you either don't get to command the bots.. or mis-click the weapons or armor you wanted.

Any help greatly appreciated :smile:
 
Tüfekçi Başı said:
Anybody knows solution?

Tüfekçi Başı said:
Hello

(agent_get_wielded_item, <destination>, <agent_id>, <hand_no>),

I can get agent's bow in right hand with this code.
(agent_get_wielded_item, ":a_bow", ":agent", 0),

But I couldn't get agent's left hand when he uses arrow with this code.
(agent_get_wielded_item, ":an_arrow", ":agent", 1),

Where is my mistake?  :???:

[quote author=header_operations.py]
Retrieves the item reference that the agent is currently wielding in his right hand (hand_no = 0) or left hand (hand_no = 1). Note that weapons are always wielded in right hand, and shield in left hand. When wielding a two-handed weapon (including bows and crossbows), this operation will return -1 for left hand.
[/quote]

EDIT: This description seems to not be in the original module system, but in the enhanced by Lav version: https://forums.taleworlds.com/index.php?topic=324874.0

You should start using that ASAP, it would have answered your question before you even encountered the problem. Get W.R.E.C.K too if you're not already using it (http://forums.taleworlds.com/index.php/topic,325102.0.html).
 
New complaint from player:
Hides to cities the value was 320 and it went to 200 after several  hides
Is there a way I can decrease the amount each additional trade item depresses the market value at a town market?
It's always been a problem in Brytenwalda. I would like a system where it only decreased about 4-5% max with each item.
 
gdwitt said:
New complaint from player:
Hides to cities the value was 320 and it went to 200 after several  hides
Is there a way I can decrease the amount each additional trade item depresses the market value at a town market?
It's always been a problem in Brytenwalda. I would like a system where it only decreased about 4-5% max with each item.

This is handled in the scripts
"game_get_item_buy_price_factor"
and "game_get_item_sell_price_factor"
as well as "get_trade_penalty"
 
Thank you for pointing that out.
I don't see anything in the scripts that shows the increment that changes price for each consecutive buy or sell.
I am able to modify the penalty_factor to make things less difficult on the players.
("game_get_item_sell_price_factor",
    [
      (store_script_param_1, ":item_kind_id"),
      (assign, ":price_factor", 100),

      (call_script, "script_get_trade_penalty", ":item_kind_id"),
      (assign, ":trade_penalty", reg0),

      (try_begin),
        (is_between, "$g_encountered_party", centers_begin, centers_end),
        (is_between, ":item_kind_id", trade_goods_begin, trade_goods_end),
        (store_sub, ":item_slot_no", ":item_kind_id", trade_goods_begin),
        (val_add, ":item_slot_no", slot_town_trade_good_prices_begin),
        (party_get_slot, ":price_factor", "$g_encountered_party", ":item_slot_no"),
        (val_mul, ":price_factor", 100),#normalize price factor to range 0..100
        (val_div, ":price_factor", average_price_factor),##gdw1000 in module constants
      (else_try),
        #increase trade penalty while selling weapons, armor, and horses
        (val_mul, ":trade_penalty", 3),#gdw from 4 to 3 reduced to ease
      (try_end),
         
      (store_add, ":penalty_divisor", 100, ":trade_penalty"),
            (val_mul, ":price_factor", 100),
      (val_div, ":price_factor", ":penalty_divisor"),
            (assign, reg0, ":price_factor"),
      (set_trigger_result, reg0),
  ]),
But is the increment of 6-8% for consecutive transactions just part of the game engine?
I think I see an increment in game_event_buy_item
("game_event_buy_item",
    [
      (store_script_param_1, ":item_kind_id"),
      (store_script_param_2, ":reclaim_mode"),
      (try_begin),
        (is_between, ":item_kind_id", trade_goods_begin, trade_goods_end),
        (store_sub, ":item_slot_no", ":item_kind_id", trade_goods_begin),
        (val_add, ":item_slot_no", slot_town_trade_good_prices_begin),
        (party_get_slot, ":multiplier", "$g_encountered_party", ":item_slot_no"),
        (try_begin),
          (eq, ":reclaim_mode", 0),
          (val_add, ":multiplier", 16),##gdw was at 20
        (else_try),
          (val_add, ":multiplier", 24),##gdw was at 30
        (try_end),

(store_item_value, ":item_value", ":item_kind_id"),
(try_begin),
  (ge, ":item_value", 100),
  (store_sub, ":item_value_sub_100", ":item_value", 100),
  (store_div, ":item_value_sub_100_div_8", ":item_value_sub_100", :cool:,
  (val_add, ":multiplier", ":item_value_sub_100_div_8"),
(try_end),
        (val_min, ":multiplier", maximum_price_factor),
        (party_set_slot, "$g_encountered_party", ":item_slot_no", ":multiplier"),
      (try_end),
  ]),
But I don't see this script being called anywhere except for buying cattle. Does this script change the increment?
Cheers!
 
Status
Not open for further replies.
Back
Top Bottom