Ismoh / NoitaMP

WIP! Not working, atm! NoitaMP, Noita Multiplayer: First synchronous multiplayer mod for Noita!
GNU General Public License v3.0
115 stars 12 forks source link

Update init_package_loading.lua #104

Closed Scrymmery closed 1 year ago

Scrymmery commented 1 year ago

on game start, there was an error "The current directory is not inside the noita-mp". fixed it, io.popen("cd"):read("*a") were return Noita directory, not mod also don't think we need to check for correct directory, it can't be uncorrect now it works(how i think) as it supposed to be.

P.S: there are still error about libs, if i understood correctly, you want to move all libs from \lua_modules to \files\lib\external\ , so i didn't touch it (kinda strange that it's already defined in mod, but still not moved)

Ismoh commented 1 year ago

First of all: Thanks a ton for contributing! I am really happy to see people working on NoitaMP, because I don't find that much time, I would like to work on NoitaMP.

I was working on adding LuaRocks #100 being able to run tests locally with only one command and being able to install/add dependencies easily. Based on #48, because there were strange behaviour on deciding when network messages have to be send. Debugging with two noita instances was exhausting and not really helpful.

Now, as #100 was merged, we are simply able to run tests locally with:

This is the reason, why we need to check in init_package_loading, if we are in mods/noita-mp, when Noita API functions aren't available: This happens, when we run tests locally or on GitHub action workflow.

I am really sorry, that your investigated time, might be unnecessary/obsolete, as I am going to change this to be able to run NoitaMP again inGame!

I will surely take your changes in mind and maybe use some of it.

If you are still interested in contributing, I highly recommend to join my discord server. There is a #developer-chat, where the contributers and me are talking about everything. If you sadly dont have discord or don't want to join, you can ask your questions here.

In #100 you can see that I changed modules, libs and scripts loading to LuaRocks directory structure, thats why you can see old stuff like libs/external, because #48 isn't finished yet.

I am sorry, that CONTRIBUTING.md isn't fully up to date and you might wasted your time!

In addition to this, I recognised that I need to fix/update my workflow being able to use my marketplace action correctly.

Scrymmery commented 1 year ago

First of all: Thanks a ton for contributing! I am really happy to see people working on NoitaMP, because I don't find that much time, I would like to work on NoitaMP.

I was working on adding LuaRocks #100 being able to run tests locally with only one command and being able to install/add dependencies easily. Based on #48, because there were strange behaviour on deciding when network messages have to be send. Debugging with two noita instances was exhausting and not really helpful.

Now, as #100 was merged, we are simply able to run tests locally with:

  • start command line prompt (cmd.exe) on Windows
  • change directory to cd %yourLocalCheckoutRepoDir%/mods/noita-mp
  • and run luarocks test >> result.log

This is the reason, why we need to check in init_package_loading, if we are in mods/noita-mp, when Noita API functions aren't available: This happens, when we run tests locally or on GitHub action workflow.

I am really sorry, that your investigated time, might be unnecessary/obsolete, as I am going to change this to be able to run NoitaMP again inGame!

I will surely take your changes in mind and maybe use some of it.

If you are still interested in contributing, I highly recommend to join my discord server. There is a #developer-chat, where the contributers and me are talking about everything. If you sadly dont have discord or don't want to join, you can ask your questions here.

In #100 you can see that I changed modules, libs and scripts loading to LuaRocks directory structure, thats why you can see old stuff like libs/external, because #48 isn't finished yet.

I am sorry, that CONTRIBUTING.md isn't fully up to date and you might wasted your time!

In addition to this, I recognised that I need to fix/update my workflow being able to use my marketplace action correctly.

oh, i see now. Anyway, if you want to get full path to script, it's better use local currentDirectory = io.popen("cd"):read("*l") .. "/" .. debug.getinfo(1).source , which gives %noiaRootDir%\mods\noita-mp\files\scripts\init\init_package_loading.lua image

Ismoh commented 1 year ago

Thanks a ton! Your screenshot looks promising. I usually try to avoid using debug, because it costs a lot of performance, but on init or start a run, it might be okay. Did you try luarocks test?

Scrymmery commented 1 year ago

Did you try luarocks test?

To be honest, no. I'm on win7, so i just can't use luarocks test

Ismoh commented 1 year ago

You do not need to install LuaRocks and it should work on win7. But I am on Win10. Didnt tested with wind7.

Scrymmery commented 1 year ago

it says Unknown command: test, and a newer version doesn't work too, can't figure out how to fix that. image image

Ismoh commented 1 year ago

Does your branch based of branch-48? There is a README.md inside .building. There should be everything you need to get LuaRocks running!

Yea, I had a look, it's #48. Make sure there is only one rockspec. Then it should work.

There is the test command defined: https://github.com/Scrymmery/NoitaMP/blob/c36baa6231fda162ee7bfd8b910bf30a9b0cb443/mods/noita-mp/noita-mp-2.7.0-3.rockspec#L72

Scrymmery commented 1 year ago

still can't install dependencies, but now i am able to run luarocks test. I don't know if it's supposed to run without dependencies installed, but here it is : result.txt

codecov[bot] commented 1 year ago

Codecov Report

Merging #104 (c36baa6) into 48-developer-want-to-rework-client-and-server-modulesclasses (2386864) will not change coverage. The diff coverage is 100.00%.

Impacted file tree graph

@@                                      Coverage Diff                                      @@
##           48-developer-want-to-rework-client-and-server-modulesclasses     #104   +/-   ##
=============================================================================================
  Coverage                                                         61.60%   61.60%           
=============================================================================================
  Files                                                                30       30           
  Lines                                                              1633     1633           
=============================================================================================
  Hits                                                               1006     1006           
  Misses                                                              627      627           
Flag Coverage Δ
unittesting 61.60% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...ita-mp/files/scripts/init/init_package_loading.lua 80.89% <100.00%> (ø)

Impacted file tree graph

Ismoh commented 1 year ago

still can't install dependencies, [...] I didn't find out yet, why MSYS2/64 isn't working, because for some reason it build/compile some parts in 64bit and some other parts in 32bit.

It's not necessary to install all dependencies at the moment, but if you are interested in, see bleow.

Noita stuff was compiled in Visual Studio, that's why I also used Visual Studio Command Prompt, because MSYS2 didn't work for me either:

call "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\Build\vcvarsall.bat" x86 10.0.22000.0 -vcvars_ver=14
luarocks install --only-deps noita-mp-*.rockspec

Run luarocks install --only-deps noita-mp-.rockspec. Replace with the version number of the rockspec. Simply type in luarocks install --only-deps noita and hit tab to autocomplete the rockspec name.

Thanks for your contributing, I think I'll merge the PR very soon!