Author Topic: Newbe needs info on where to find what in code  (Read 5971 times)

Offline Callahan

  • Captain
  • ***
  • Posts: 61
    • View Profile
Re: Newbe needs info on where to find what in code
« Reply #30 on: April 04, 2018, 11:34:24 am »
I am currently trying to get a PC from one of my friends. I would prefer that over Linux. Nothing against Ubuntu, but I guess it will do both of us well if this old dog does not need to learn a new trick. If that fails, however, brace yourself for a bunch of beginner questions about Linux/Ubuntu.

In the meantime, I did ponder Meridians test results on the reaction fire issue and had an enlightenment.

the difference is NOT in opening doors triggering reaction fire; and most likely also not in mutual surprise... it is very likely something very subtle that has quite big impact

Perfectly on point. Meridian is right.

PS2: that means that my "LuckyLuke experiment" was 100% wrong...

Unfortunately absolutely right, too.

A reaction fire check in vanilla is performed right before an alien does fire a gun/prime a granade. That does explain just everything:
Aliens shot by reaction fire on their tile without moving, fireing or doing something else.
Aliens shot inside UFO when door is blocked when they open it.
Seemingly no mutual surprise for aliens. (They are seen to get shot)

This reaction check does only apply to aliens in vanilla.

So if we would move the "Lucky Luke" experimental reaction code to the spot right before an Alien does fire or prime a grenade, we will have a reaction system identical to vanilla x-com 1 & 2.

Offline Yankes

  • Commander
  • *****
  • Posts: 2095
    • View Profile
Re: Newbe needs info on where to find what in code
« Reply #31 on: April 04, 2018, 10:22:20 pm »
I am currently trying to get a PC from one of my friends. I would prefer that over Linux. Nothing against Ubuntu, but I guess it will do both of us well if this old dog does not need to learn a new trick. If that fails, however, brace yourself for a bunch of beginner questions about Linux/Ubuntu.
You do not need Linux to rung GCC/MinGW there is 5% chance that you already have all tools if you downloaded Git for Windows: https://git-scm.com/download/win
As I said previously it contains minimal compatibility layer to work with linux-based software on Windows (like Git, GCC, bash, OXCE).


Offline Callahan

  • Captain
  • ***
  • Posts: 61
    • View Profile
Re: Newbe needs info on where to find what in code
« Reply #32 on: April 05, 2018, 11:13:54 am »
Git does need Windows Vista minimum. I'll try again as soon as I get a newer PC running. Currently I have got 3 used PCs from my friend, but with all of them my monitor tells me "No input signal". Not even with the onboard graphics. No idea what's wrong with them. I seem to have a streak of bad luck.

But many thanks for all the help. I really appreciate the effort.

And I found another thing to fix in OXC. Group attacks on UFOs lead to the UFO always fireing on the first fighter. Vanilla fires at a random fighter.


Offline Callahan

  • Captain
  • ***
  • Posts: 61
    • View Profile
Re: Newbe needs info on where to find what in code
« Reply #34 on: April 05, 2018, 08:21:30 pm »
Perfect. That went well. The second link worked.
I am now proud owner of "7.3.0 posix dwarf rt v5 rev0 files".

Thanks for the help, Yankes. I was in desperate need of something to work at last. Today afternoon I attempted to get one of my "new" used PCs to work and, unbelievably, it cought fire. More precise the power supply unit cought fire. Now I'm surrounded by the sweet smell of molten capacitors and my mood had hit a new low.

But now I see a silver lining.
What will be the next step/where can I learn how to compile OXCE source code using "mingw-w64" ?

Offline jgatkinsn

  • Colonel
  • ****
  • Posts: 342
  • Squaddie cautiously peering through the breach
    • View Profile
Re: Newbe needs info on where to find what in code
« Reply #35 on: April 05, 2018, 08:58:54 pm »
But now I see a silver lining.
What will be the next step/where can I learn how to compile OXCE source code using "mingw-w64" ?

I don't know how accurate it is, but it should be fairly close...

https://www.ufopaedia.org/index.php/Compiling_with_MinGW_(OpenXcom)

Offline Yankes

  • Commander
  • *****
  • Posts: 2095
    • View Profile
Re: Newbe needs info on where to find what in code
« Reply #36 on: April 06, 2018, 12:20:19 am »
As base you can use this file https://github.com/Yankes/OpenXcom/blob/OpenXcomExtended/src/Makefile.mingw (shroud be included in your src uif you grab code of OXCE).
You need SDL libs data (from jgatkinsn link) and src code of yaml-cpp https://github.com/jbeder/yaml-cpp
You will need adjust paths in makefile to match your mingw config.
Then you call make and you should get new exe in bin folder.

(btw you can remove `SRCS_BOOST = ../../lib/boost/`parts becasue new yaml-cpp do not use boost any more)

Offline Callahan

  • Captain
  • ***
  • Posts: 61
    • View Profile
Re: Newbe needs info on where to find what in code
« Reply #37 on: April 06, 2018, 03:36:57 pm »
I've got a lot of problems getting the MinGW compiler. The mingw-get-setup.exe says the path to stuff to install is wrong, and manual download failed with the message:
The "/MinGW/Base/binutils..mingw32-bin.tar.lzma" file could not be found or is not available. Please select another file.

Other file links failed to download, too.
Only this:
https://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win32/Personal%20Builds/mingw-builds/installer/mingw-w64-install.exe/download
Installed properly, but my C:\MinGW folder is almost empty, executing a makefile does nothing but a Windows dialogue "Choose program to open file with".

How to get MinGW compiler if both the installer and the manual download links are dead?
The SDL and Yaml-cpp stuff is added to my project, but I cannot execute a "Makefile" with the MinGW stuff I got from Yankes second "MinGW-w64" link.

Second question: If I open a makefile in my notepad, it is just a blur of text and squares. What programm is best used to open and edit a "Makefile"?.

Offline Yankes

  • Commander
  • *****
  • Posts: 2095
    • View Profile
Re: Newbe needs info on where to find what in code
« Reply #38 on: April 06, 2018, 04:28:22 pm »
I will prepare exactly steps to compile OXCE using mingw-w64.

Offline Callahan

  • Captain
  • ***
  • Posts: 61
    • View Profile
Re: Newbe needs info on where to find what in code
« Reply #39 on: April 06, 2018, 05:02:32 pm »
Thanks. And sorry for the inconvenience.
I seem to be a fusion of lack of knowledge with lack of luck.
Just ran your MinGW-w64 install link a second time, and now I have some new stuff, including a "mingw32-make.exe". The previous install merely consisted of a "mingw-64.bat" and a "Lib" folder.
I'll now try to use the new -make.exe with the command line instructions from the OXC help page.

Offline jgatkinsn

  • Colonel
  • ****
  • Posts: 342
  • Squaddie cautiously peering through the breach
    • View Profile
Re: Newbe needs info on where to find what in code
« Reply #40 on: April 06, 2018, 05:06:16 pm »
Second question: If I open a makefile in my notepad, it is just a blur of text and squares. What programm is best used to open and edit a "Makefile"?.

Something is wrong with the file you opened, because it sounds like you opened a binary file.  Makefiles are pure text, so any text editor will do.  When the MingGW gets installed properly and your paths are setup correctly, you should have a file called "make"  or "mingw32-make.exe" in the path of your Windows system that is a binary executable.  You call this executable in your directory where the code should have a "Makefile" or "Makefile.XXX"  located for it to read and parse to executed build commands inside it. 

Wait for Yankes instructions though before you go too far.  I thought would at least explain to you what makefiles are and how "make" runs them.

Offline Yankes

  • Commander
  • *****
  • Posts: 2095
    • View Profile
Re: Newbe needs info on where to find what in code
« Reply #41 on: April 06, 2018, 05:09:45 pm »
Thanks. And sorry for the inconvenience.
I seem to be a fusion of lack of knowledge with lack of luck.
Just ran your MinGW-w64 install link a second time, and now I have some new stuff, including a "mingw32-make.exe". The previous install merely consisted of a "mingw-64.bat" and a "Lib" folder.
I'll now try to use the new -make.exe with the command line instructions from the OXC help page.
I installed MinGW long time ago, and when I did this today I find some place that will be hard to you to solve.
I will prepare steps that go from zero to working exe.

Offline Callahan

  • Captain
  • ***
  • Posts: 61
    • View Profile
Re: Newbe needs info on where to find what in code
« Reply #42 on: April 06, 2018, 05:42:16 pm »
Something is wrong with the file you opened, because it sounds like you opened a binary file.  Makefiles are pure text, so any text editor will do.

Something was wrong with my notepad editor. Notepad++ opens the file readable.

You call this executable in your directory where the code should have a "Makefile" or "Makefile.XXX"  located for it to read and parse to executed build commands inside it. 

I assume I would use the dos prompt for navigating there ? , as my Windows "Run" command does only allow me to choose the program, but not the location. Or do I best use a shortcut to the -make.exe with command line parameters?

P.S. Just read that on creating the yaml-cpp thing I shall execute:
cmake -G "MinGW Makefiles" -DBUILD_SHARED_LIBS=OFF -DBoost_INCLUDE_DIR=<project>\boost_1_54_0 ..
But my MinGW/Bin does lack a cmake file or .exe. Is that another file missing during install, or is the instruction invalid for using MinGW-w64?

PPS. On building "mingw32-make SDL_gfx.dll" I get an error *** no rule to make target SDL_gfx.dll.
What did I screw up this time?
At least I seem to have gotten MinGW32-make.exe to do something.
« Last Edit: April 06, 2018, 06:16:10 pm by Callahan »

Offline Yankes

  • Commander
  • *****
  • Posts: 2095
    • View Profile
Re: Newbe needs info on where to find what in code
« Reply #43 on: April 06, 2018, 06:09:52 pm »
Install MinGW from:
https://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win32/Personal%20Builds/mingw-builds/installer/mingw-w64-install.exe/download
To folder `C:\MinGW\`

Download `make` and it dependencies from:
https://sourceforge.net/projects/gnuwin32/files/make/3.81/make-3.81-bin.zip/download?use_mirror=kent&download=
https://sourceforge.net/projects/gnuwin32/files/make/3.81/make-3.81-dep.zip/download?use_mirror=netcologne&download=
And extract both to folder `C:\MinGW\mingw32\`

Download https://github.com/jbeder/yaml-cpp/archive/master.zip
And extract folder `yaml-cpp-master` from it to `C:\work\yaml-cpp`

Download http://bumba.net/~hmaon/oxc/OXC-mingw32-cross-tools.tar.xz
And extract folder `usr\local\cross-tools\i386-mingw32\` from it to `C:\MinGW\mingw32\`

After this open `C:\MinGW\` and run `mingw-w64.bat`.
Navigate in console to folder with openxcom or download new one using:
Code: [Select]
cd C:\
#name of folder where you want have openxcom folder, you can skip this step and move to other localization
mkdir work
cd work
#you can choose Meridian repo too if you want
git clone https://github.com/Yankes/OpenXcom.git openxcom
cd openxcom\src
Now copy file from this post attachment to `C:\work\openxcom\src` and rename it to `Makefile` (without any extension!)
And when you did this run
Code: [Select]
mkdir ..\obj\yaml
make
Now after everything is compiled you will get exe in `C:\work\openxcom\bin`
Now you only need place UFO data in correct place.

[PS]
If you use diffrent folders you need alter `Makefile` becasue it have hardcoded paths, they need match with what you have.
« Last Edit: April 06, 2018, 06:12:36 pm by Yankes »

Offline jgatkinsn

  • Colonel
  • ****
  • Posts: 342
  • Squaddie cautiously peering through the breach
    • View Profile
Re: Newbe needs info on where to find what in code
« Reply #44 on: April 06, 2018, 06:32:38 pm »
Something was wrong with my notepad editor. Notepad++ opens the file readable.

Not surprised, Notepad is probably the worst text editor ever created :)

Quote
I assume I would use the dos prompt for navigating there ? , as my Windows "Run" command does only allow me to choose the program, but not the location. Or do I best use a shortcut to the -make.exe with command line parameters?

Dos prompt.

« Last Edit: April 06, 2018, 07:09:51 pm by jgatkinsn »