Modding Q&A [For Quick Questions and Answers]

正在查看此主题的用户

状态
不接受进一步回复。
Ok so, I've added and replaced itp_type_bolts with itp_type_pistol, And it still is not appearing in game.

My script for the weapons merchant refresh is:
# Refresh Weapon sellers
  (0.0, 0, 24.0, [], [
                      (reset_item_probabilities,100),
                      (set_merchandise_modifier_quality,150),
                      (try_for_range,reg(2),weapon_merchants_begin,weapon_merchants_end),
                        (store_sub, ":cur_town", reg2, weapon_merchants_begin),
                        (val_add, ":cur_town", towns_begin),
                        (party_get_slot, ":cur_faction", ":cur_town", slot_center_original_faction),
(troop_add_merchandise_with_faction,reg(2), ":cur_faction",itp_type_one_handed_wpn,5),
                        (troop_add_merchandise_with_faction,reg(2), ":cur_faction",itp_type_two_handed_wpn,5),
                        (troop_add_merchandise_with_faction,reg(2), ":cur_faction",itp_type_polearm,5),
                        (troop_add_merchandise_with_faction,reg(2), ":cur_faction",itp_type_shield,6),
                        (troop_add_merchandise_with_faction,reg(2), ":cur_faction",itp_type_bow,4),
                        (troop_add_merchandise_with_faction,reg(2), ":cur_faction",itp_type_crossbow,3),
                        (troop_add_merchandise_with_faction,reg(2), ":cur_faction",itp_type_thrown,5),
                        (troop_add_merchandise_with_faction,reg(2), ":cur_faction",itp_type_arrows,2),
                        (troop_add_merchandise_with_faction,reg(2), ":cur_faction",itp_type_bolts,2),
(troop_add_merchandise_with_faction,reg(2), ":cur_faction",itp_type_pistol,2),
                        (troop_ensure_inventory_space,reg(2),merchant_inventory_space),
                        (troop_ensure_inventory_space,reg(2),merchant_inventory_space),
                        (troop_sort_inventory, reg(2)),
                        (store_troop_gold, reg(6),reg(2)),
                        (lt,reg(6),900),
                        (store_random_in_range,":new_gold",200,400),
                      (call_script, "script_troop_add_gold", reg(2), ":new_gold"),
                      (end_try,0),
                    ]),

Im not sure why reg(2) replaces cur_merchant, But it was like that when i downloaded this ver of the module system. I've made the Abundance 200, Just so i can make sure i'll see it in shops, and it is already ticked as merchandise.

Am i doing anything wrong? Or is there something i've overlooked?
 
1. changing to :cur_merchant just makes it more readable. It is basically the same as saving it to reg2, but it is safer to change it to ":cur_merchant" imo.

2. Did you start a new game when you checked? This script is fired via a trigger and maybe you'd have to start a new game for the changes to propagate.
 
1) did you wait for 24+ hours in the world map (Ctrl+space) before checking the vendor?

2) check your items, as they need to have the flags for this to work (like pistol flag)

3) make sure the vendor inventory is not too small, otherwise it won't get any guns

What modsys are you using? Original M&B? That is not Warband. Maybe a mod?
 
Did you start a new game when you checked? This script is fired via a trigger and maybe you'd have to start a new game for the changes to propagate.

I start a new game every time i modify any of the scripts

3) make sure the vendor inventory is not too small, otherwise it won't get any guns

I'm fairly certain that the inventory is big enough, But ill admit im not too sure

The weapon is flagged as a pistol, and i waited several in-game days for it to appear in vendors. I am using a copy of the Native Warband module, Since i'm new to modding warband, and am simply trying things in a copy of Native, But I'm using an older ver of the module system (1.1.3.2) Unless i've missed out anything i need to do in any other scripts, I'm fairly certain i've done everything correctly so far, Although i havent worked with the module system before, so i could have made mistakes somewhere
 
So why aren't you using 1.17x modsys? Old modsys = old bugs, and it is missing engine updates (header files).

About your issue: put pistol first (not last) to avoid issues with full inventory. Add a log message to make sure your code is being executed.
 
Ok, I put the pistol at the top of the list (And downloaded the latest modsys).
I added a log message on the next line to itp_type_pistol, And it didn't appear in the log screen, So i don't think it's actually running the code. Or maybe it is, and i didn't put in a log message properly

Heres how it looks now
    (reset_item_probabilities, 100),
    (set_merchandise_modifier_quality, 150),
    (try_for_range, ":cur_merchant", weapon_merchants_begin, weapon_merchants_end),
  (store_sub, ":cur_town", ":cur_merchant", weapon_merchants_begin),
      (val_add, ":cur_town", towns_begin),
  (troop_clear_inventory, ":cur_merchant"),
      (party_get_slot, ":cur_faction", ":cur_town", slot_center_original_faction),
  (troop_add_merchandise_with_faction, ":cur_merchant", ":cur_faction", itp_type_pistol, 3),
  (display_message,"yo you got guns now")

I feel like i'm overlooking something really simple and not realizing it  :ohdear:
 
(display_message, "@xxxxxxxxx"),

Don't forget the @ in there for a quick string

Enable Edit Mode on your launcher if you want the message on rgl_log.txt
 
Ok, I added the @, and still nothing. So i don't think the code is actually being run. I'm not sure if this is an issue with the module system, or if im doing something wrong...
 
Make sure you are saving your file (people tend to forget that on Notepad++), and that your mod files are being updated (check creation date for your .txt files like triggers.txt after you compile the code)
 
Ok so, I just found that my Mod files aren't actually being updated, even when they're compiled. How can i fix this? I keep setting the files to not be read only, but when i check the properties again it resets back to Read-Only.
 
Ok so, The Files are actually being created now, But they're being created in the "Modules" folder, with names like "Native1sounds , Native1Scripts" (i named my module native1 as a temp name), Do i just move them into my module folder? Or do i need to rename them so they replace the ones already there?
 
Hello, anyone knows how to remove these warnings i've found the codes of the warnings in notepad++ first of all these are the warnings that i get
WARNING: Usage of unassigned global variable: $g_presentation_marshall_selection
_max_renown_3
WARNING: Usage of unassigned global variable: $g_presentation_marshall_selection
_max_renown_3_troop
WARNING: Usage of unassigned global variable: $g_presentation_marshall_selection
_max_renown_3
WARNING: Usage of unassigned global variable: $g_presentation_marshall_selection
_max_renown_3_troop
exporting simple triggers...
exporting triggers...
exporting dialogs...
Checking global variable usages...
WARNING: Global variable never used: $g_presentation_marshall_selection_max_reno
wn_3
WARNING: Global variable never used: $g_presentation_marshall_selection_max_reno
wn_3_troop
WARNING: Global variable never used: $g_presentation_marshall_selection_max_reno
wn_3
WARNING: Global variable never used: $g_presentation_marshall_selection_max_reno
wn_3_troop
Exporting postfx_params...
and these are the codes http://prntscr.com/it4bwi
 
Hi all,

Is there a way to force a key press? For example, if X-key is pressed, do Y-key instead? I want to override certain game keys with another game key, but experimenting on something like (set_trigger_result) does not work.
 
Khamukkamu 说:
Hi all,

Is there a way to force a key press? For example, if X-key is pressed, do Y-key instead? I want to override certain game keys with another game key, but experimenting on something like (set_trigger_result) does not work.

(omit_key_once, <key_code>),

You can simulate the affect of the key you want to force after - forcing the interacted key to be ignored totally via this operation.
 
I've experimented with that before, and that doesn't work, unfortunately.

Also, the key i'm trying to simulate is gk_zoom / shift key. Which means that it is engine-related. Using custom cam will lead to clipping issues that I'd like to avoid.
 
Khamukkamu 说:
I've experimented with that before, and that doesn't work, unfortunately.

Also, the key i'm trying to simulate is gk_zoom / shift key. Which means that it is engine-related. Using custom cam will lead to clipping issues that I'd like to avoid.
Just use;
插入代码块:
set_zoom_amount                              = 2221  # (set_zoom_amount, <value_fixed_point>),
                                                     # Version 1.153+. Sets new zoom rate.
Requires disable_zoom = 1 in module.ini though.
 
状态
不接受进一步回复。
后退
顶部 底部