I'm quite new to modding X and I've been reading about anything I could find on Rebirth modding howtos, but I still have a few question and I hope you can help me out a bit
- I've made a mod which let's the player initate the smalltalk minigame; this is done rather easily via "XML Patching". But, I cannot get rid of the following "warnings" in the debuglog, which I get for every changed .xml:
Ignoring root node 'diff' in XML file
Code for 'npc_itemtrader.xml':Code: Select all
<?xml version="1.0" encoding="UTF-8"?> <!-- MiningSupplier, JunkDealer, SpaceFarmer, ShipTechnician, EquipmentVendor, FoodMerchant, DroneTrader, ArmsDealer, RecruitingOfficer, BlackMarket, HumanResources --> <diff> <replace sel="/mdscript[@name='NPC_Itemtrader']/cues/cue[@name='OnPlatformPopulation_Itemtrader']/cues/cue[@name='DefaultComm']/actions/do_else/do_if[@value='not $actor.$SmalltalkDone? and player.age lt @$actor.$TopicTimeout']"> <do_if value="not $actor.$SmalltalkDone? and player.room == $actor.room"> <add_player_choice_sub text="{1002,900000}" section="gSmalltalk_start" position="top_right" baseparam="event.param2" /> </do_if> </replace> </diff>
- What I haven't figured out is on how to do "the same" (replacing code) in LUA files... like reducing the weapon-mods install price:
"menu_trader_transfer_weaponmods.lua"
I just need to change the "sortwares" variable, but how? I don't think that patching (as in xml) is possible, so it has to be done some other way and that's what I've come up with (which doesn't work by the way^^):Code: Select all
local function init() -- iterate through menus for _, menu in ipairs(Menus) do -- select the corresponding menu if menu.name == "WeaponModTransferMenu" then -- change the variable menu.sortwares = { ["inv_weaponmod_t1"] = { priority = 1, color = { r = 30, g = 255, b = 0, a = 100 }, installfee = 1000, removefee = 500 }, ["inv_weaponmod_t2"] = { priority = 2, color = { r = 64, g = 154, b = 255, a = 100 }, installfee = 5000, removefee = 500 }, ["inv_weaponmod_t3"] = { priority = 3, color = { r = 193, g = 83, b = 238, a = 100 }, installfee = 10000, removefee = 500 }, } break end end end
Hotshot