EnglishGermanFrenchRussianItalianSpanish
Log inRegister
 
Doing a bit of modding (beginner questions)
Post new topic Reply to topic
View previous topic :: View next topic
Author Message
Hotshot22





Joined: 26 Jul 2004
Posts: 73 on topic

Thank you for registering your game
PostPosted: Thu, 19. Apr 18, 11:51    Post subject: Doing a bit of modding (beginner questions) Reply with quote Print

Hey guys!

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 Smile


  • 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:

    <?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:

    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
       


Thanks a lot! Smile
Hotshot

Back to top
View user's profile Send private message
marceldev89





Joined: 10 Apr 2018



PostPosted: Thu, 19. Apr 18, 14:53    Post subject: Re: Doing a bit of modding (beginner questions) Reply with quote Print

Judging by how some other mods do things, try moving the comment inside the <diff> block. Note that I have 0 experience in XR modding so it might just be nonsense I'm saying. ^^

Back to top
View user's profile Send private message
Marvin Martian





Joined: 08 Apr 2012
Posts: 2530 on topic

Thank you for registering your game
PostPosted: Thu, 19. Apr 18, 15:00    Post subject: Reply with quote Print

the diff stuff is because of name of the file, type all like npc_itemtrader.xml in lowered characters should solve this problem, if you use the name like extracted filenames this <diff> message appiers in debuglog

Back to top
View user's profile Send private message
Hotshot22





Joined: 26 Jul 2004
Posts: 73 on topic

Thank you for registering your game
PostPosted: Fri, 20. Apr 18, 08:36    Post subject: Reply with quote Print

Thanks for the input; I will try the suggestion with the xml being the same file name Smile

Concerning the second part with the lua script I think I figured it out:

although I copied the code from the official Wiki, it seems they forgot to add "init ()" as the last command Rolling Eyes

I have to admit, seeing as the function itself is called "init", I thought that would be it, but nope Smile

So for now I got everything working as intended. Just need to get to work on some other mods^^

Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic Reply to topic
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum
Control Panel
Login Data
The time now is Thu, 19. Jul 18, 03:36

All times are GMT + 2 Hours

[ Disclaimer / Impressum ] | [ Privacy Policy / Datenschutz ]

Board Security

Copyright © EGOSOFT 1989-2018
Powered by phpBB © 2001, 2005 phpBB Group
Template created by Avatar & BurnIt!
Debug: page generation = 0.07127 seconds, sql queries = 19