Code: Select all
<content id=......>
<dependency id="G_Work_Around" version="020" optional="false"/>
<text language=..../>
</content>
Moderators: Moderators for English X Forum, Scripting / Modding Moderators
Code: Select all
<content id=......>
<dependency id="G_Work_Around" version="020" optional="false"/>
<text language=..../>
</content>
You are making things more complicated than other things.Unclejack wrote: ↑Tue, 8. Jan 19, 03:48Hello Again!
I have an important update/message.
Running multiple mods using the G_Work_Around will lead to conflicts if the different mods use the same md template for the work around (with a wait of 1 second).
What happens is that multiple md functions will call G_Work_Around with a param at the exact same time/frame, this will prevent G_work_Around from functioning as it cannot find all params at the same time and thus will not open the targeted lua scripts (it will actually open the same one multiple times as it happens that was the value of param at that time). This can be easily fixed by changing the timing in the md scripts between mods, but this is something to keep in mind!
Currently it is a bit unclear if this happens only when the target lua scripts are targeting the same egosoft.lua script, but it seems to be 100% reproducible with 2 mods targeting the same menu_map.lua script.
Originally reported by Forleyor on discord!
Didn't know there was such a thing, prolly hidden in the X:R documentation. I'll try and squeeze it in, near the text limit. Edit: it fit, I'll put a content.xml file in the templet next update.UniTrader wrote: ↑Tue, 8. Jan 19, 09:55you should also mentoin the dependency node for the content.xml to ensure mod presence and version and load order
Code: Select all
<content id=......> <dependency id="G_Work_Around" version="020" optional="false"/> <text language=..../> </content>
Code: Select all
UJfactionspecific_objectcolours
UJfactionspecific_objectcolours_withG_Work_Around
EHM3_factionObj_and_Sect_Colours
EHM3_factionObj_and_Sect_Colours_withG_Work_Around
Um, yeah, you can't write your own ffi function... those are defined by the devs. You would need access to the source code to add them (or I guess you could try decompling the game or modding in assembly )LegionOfOne wrote: ↑Tue, 8. Jan 19, 18:09Does anyone among you fine folks know how to create our own ffi functions, and where the original ones are located ?
I'm trying to add a new functionnality, specifically to allow us to choose the volume of every buy or sell offer on our stations.
Since that simply doesn't exist yet, I believe I need to create my own ffi functions to handle the logic.
If you can think of another path to the same result, that would also be very helpful.
Thanks in advance !
It's an idea. I haven't looked at those yet. If it works it would get rid of all of the debug spam from opening an empty menu, which would make it worth doing. Going to be a while before I can look into this, unless someone else already has.DeadMor0z wrote: ↑Tue, 8. Jan 19, 21:55What do you think about using (md) <raise_lua_event name="'EventName'" param="'path_to_lua_file'"/> and (lua) RegisterEvent("EventName", eventCallBack) variant, rather than open_menu?
Events should be queued by default, so there will be no problem with multiple extensions raising event. And it will make workaround code much simplier.
I used this technique to pass data back to lua code from md script in my mod - works great.morbideth wrote: ↑Wed, 9. Jan 19, 03:18It's an idea. I haven't looked at those yet. If it works it would get rid of all of the debug spam from opening an empty menu, which would make it worth doing. Going to be a while before I can look into this, unless someone else already has.DeadMor0z wrote: ↑Tue, 8. Jan 19, 21:55What do you think about using (md) <raise_lua_event name="'EventName'" param="'path_to_lua_file'"/> and (lua) RegisterEvent("EventName", eventCallBack) variant, rather than open_menu?
Events should be queued by default, so there will be no problem with multiple extensions raising event. And it will make workaround code much simplier.
I don't know enough to say if the code itself is better or worse than before.
About version - I just forgot to update it.Unclejack wrote: ↑Thu, 10. Jan 19, 04:13Hello again.
Thanks for keeping this updated and working hard on it everyone. I just downloaded the latest package from DeadMorOz (v0.3) and it works with my lua scripts.
@DeadMorOz, I just wanted to let you know the version in the content.xml file is still 0.2 (but I guess this is for the dependency?)
Also, more importantly maybe, a nexusmods user (Te1waz) has reported that when playing the game in a borderless window and pressing alt+enter, which kind of minimizes the window, the mod's lua script he is using fails to work.
I tried repeating his problem and it is reproducible with the v0.1, 0.2 and 0.3 API and two of my lua scripts (one is the Enhanced Holomap 3). In addition, I also tried the command /reloadui in game, which also fails to reinitiliaze the modded lua script/G_Work_Around (maybe as expected). As Alt+Enter from a borderless window seems to fully reset the UI, I tried to call /resetmd before using alt+enter or the /reloadui command. However, this failed to reinitialize the lua script/G_Work_Around as well. I guess it would be difficult to fix and the md scripts would need to keep running. Maybe we can think of something to recall the lua script from the md file when the UI is just reloaded for a given game, although I do not really know. I know the debugging tools "allow" for reloadui, but as Alt+enter in a borderless window is user input that any player (not debugging or using the chat console) might use, it would be nice to find a way to prevent the problem.
Then, when I downloaded the current 0.2 version of the API, I noticed that in every subfolder a hidden folder called: ".tmp.drivedownload" is present.This folder was not present in 0.1 AFAIK and is also not present in the "0.3" version. Is this an oversight when packaging your folder?
Finally, I just saw the updated "user" terms and will update my mod accordingly when possible. However, do you think it would be possible to include a user friendly download link at the top which does not include the hidden folder and the debugging tools and template? It would increase the user friendlyness of the post and would make it easier to send people here, where they find the download link at the top without the extra baggage. Also, maybe it would be possible to include a basic readme within the downloaded package, this will help people that just want to download it quickly without scrolling through the forum post. I understand if you would prefer not to do this, it is just a suggestion.. although having multiple download links is not nice either.
That broke all my mods, that use _G WorkaroundDeadMor0z wrote: ↑Wed, 9. Jan 19, 04:39EDIT: Rewrited latest API to use raise_lua_event and RegisterEvent, checked - all done well. You can get and check it from here:
MUST BE INSTALLED IN YOUR %installdir%\extensions folder! REQUIRES: basic literacy to install.
v0.30 Right Click API, _G Work Around, Modding Templet, and Debugging Tools
[ external image ]
That was not intended to use with mods, which were made for v0.20 of this mod, as it uses different load technique. if you need all your mods to work with this new version - you need to change their md script in accordance with new template.Romz wrote: ↑Fri, 11. Jan 19, 00:53That broke all my mods, that use _G WorkaroundDeadMor0z wrote: ↑Wed, 9. Jan 19, 04:39EDIT: Rewrited latest API to use raise_lua_event and RegisterEvent, checked - all done well. You can get and check it from here:
MUST BE INSTALLED IN YOUR %installdir%\extensions folder! REQUIRES: basic literacy to install.
v0.30 Right Click API, _G Work Around, Modding Templet, and Debugging Tools
[ external image ]
Ok.DeadMor0z wrote: ↑Fri, 11. Jan 19, 01:59That was not intended to use with mods, which were made for v0.20 of this mod, as it uses different load technique. if you need all your mods to work with this new version - you need to change their md script in accordance with new template.
Also, I'm not the author of this mod - I made changes for him (or anyone interested) to CHECK how it works.
In any way, if he accepts these changes, you'll need to update your mods.Romz wrote: ↑Fri, 11. Jan 19, 10:48Ok.DeadMor0z wrote: ↑Fri, 11. Jan 19, 01:59That was not intended to use with mods, which were made for v0.20 of this mod, as it uses different load technique. if you need all your mods to work with this new version - you need to change their md script in accordance with new template.
Also, I'm not the author of this mod - I made changes for him (or anyone interested) to CHECK how it works.
Waiting oficial udate from morbideth.