Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 [2] 3 4

Author Topic: [LCS]Modding questions(CIA Raids without heat), compiling latest nightly  (Read 9918 times)

Purple Gorilla

  • Bay Watcher
    • View Profile
Re: [LCS]Modifying game messages + Compiling LCS Nightly?
« Reply #15 on: July 31, 2015, 03:54:31 pm »

Headers are the Files, ending on ".h". If "nullptr" were a macro, it would be found in one.

I tried to download it, but github apperently doesn't work with internet explorer... I will try firefox soon...

However, some research shows, that "nullptr" is mostly the same as NULL, so replacing it with NULL in all places should work. The only situation where it would matter, is if two functions with the same name take one a pointer and one a integer as a parameter. It is generally bad style to use different funktions with the same name (and standard C doesn't allow it), so it probably works.

If it doesn't work, try "(void*) NULL", to emphatise, that it is a pointer.

-------
EDIT:
OK, I checked the source code. You can safely replace nullptr with NULL.
« Last Edit: July 31, 2015, 04:18:31 pm by Purple Gorilla »
Logged

Taberone

  • Bay Watcher
    • View Profile
Re: [LCS]Modifying game messages + Compiling LCS Nightly?
« Reply #16 on: July 31, 2015, 04:37:03 pm »



Didn't work at first, so I tried adding the " and this happened:



Won't be able to continue trying to install the LCS Nightly until sunday night since I'll be visiting somewhere for the weekend.
Logged

Purple Gorilla

  • Bay Watcher
    • View Profile
Re: [LCS]Modifying game messages + Compiling LCS Nightly?
« Reply #17 on: July 31, 2015, 05:11:26 pm »

Didn't just "NULL" without "(*void)" work ? (without Quotation Mark !)

Otherwise, give the exact type with "(AugmentType*) NULL".

As far I understand the code, removing the command "selected_aug=nullptr;" completely should work, too, as the code checks nowhere for NULL pointers anyway.

Carlos Gustavos

  • Bay Watcher
    • View Profile
Re: [LCS]Modifying game messages + Compiling LCS Nightly?
« Reply #18 on: August 01, 2015, 06:41:36 am »

NULL is used in LCS's code. nullptr is from C++11 and with gnu's compiler you have to add compiler flag -std=c++11 if you want to use it. But since you're using Dev-C++ you probably have a too old version of the compiler to do that.

If you're compiling on Windows then you could try the Visual Studio 2010 or Codeblocks project files available. I believe both of them are up to date.
Logged

Taberone

  • Bay Watcher
    • View Profile
Re: [LCS]Modifying game messages + Compiling LCS Nightly?
« Reply #19 on: August 04, 2015, 03:22:20 pm »

Noticed something interesting:



Whats the makefile for?
Logged

Carlos Gustavos

  • Bay Watcher
    • View Profile
Re: [LCS]Modifying game messages + Compiling LCS Nightly?
« Reply #20 on: August 05, 2015, 07:52:07 am »

It's for compiling on Linux. Maybe OSX too.
Logged

SlatersQuest

  • Bay Watcher
    • View Profile
Re: [LCS]Modifying game messages + Compiling LCS Nightly?
« Reply #21 on: August 05, 2015, 01:17:14 pm »

The makefile is for compiling on any Unix-based system, including Mac
Logged

Taberone

  • Bay Watcher
    • View Profile
Re: [LCS]Modifying game messages + Compiling LCS Nightly?
« Reply #22 on: August 05, 2015, 04:21:26 pm »

It's for compiling on Linux. Maybe OSX too.
The makefile is for compiling on any Unix-based system, including Mac

Aw. Was hoping it was a magic "one step compile" thing.

Didn't just "NULL" without "(*void)" work ? (without Quotation Mark !)

Otherwise, give the exact type with "(AugmentType*) NULL".

As far I understand the code, removing the command "selected_aug=nullptr;" completely should work, too, as the code checks nowhere for NULL pointers anyway.

Will try this and see how it goes.

EDIT: So far this didn't work:



So I tried it without the "" marks and another thing got highlighted in red:




NULL is used in LCS's code. nullptr is from C++11 and with gnu's compiler you have to add compiler flag -std=c++11 if you want to use it. But since you're using Dev-C++ you probably have a too old version of the compiler to do that.

If you're compiling on Windows then you could try the Visual Studio 2010 or Codeblocks project files available. I believe both of them are up to date.

Will try this later.
« Last Edit: August 06, 2015, 09:32:58 am by Taberone »
Logged

IsaacG

  • Bay Watcher
  • Mad Engineer
    • View Profile
    • JJoseph on Deviantart
Re: [LCS]Modifying game messages + Compiling LCS Nightly?
« Reply #23 on: August 18, 2015, 05:57:55 pm »

Is it possible to modify(or view, I'm fine with that too.) the game's messages itself, such as combat messages(Liberal hits the head three times BLOWING IT APART! Conservative gasps a last breath and soils the floor), pick-up lines/responses, or anything else?
This is actually exactly what I'm working on.  I'm moving most of that stuff into external XML files, that way it won't be necessary to recompile every time you want a few new death messages.
Logged
LCS 4.12 Thread
https://discord.gg/HYbss8eswM
Quote
Many people, meeting Aziraphale for the first time, formed three impressions: that he was English, that he was intelligent, and that he was gayer than a tree full of monkeys on nitrous oxide.
Constitution of the Confederate States
Article I Sec. 9 4
No bill of attainder, ex post facto law, or law denying or impairing the right of property in negro slaves shall be passe

Taberone

  • Bay Watcher
    • View Profile
Re: [LCS]Modifying game messages + Compiling LCS Nightly?
« Reply #24 on: August 20, 2015, 07:04:02 pm »

By any chance, does anyone have a .zip of the latest LCS Nightly with it already compiled? Also, how would I make more melee weapons able to sneak attack, and give more weapons to various Conservatives? (M249's and AA-12's to Soldiers, for example.)
Logged

Purple Gorilla

  • Bay Watcher
    • View Profile
Re: [LCS]Modifying game messages + Compiling LCS Nightly?
« Reply #25 on: August 21, 2015, 02:25:40 pm »

By any chance, does anyone have a .zip of the latest LCS Nightly with it already compiled?
Didn't replacing nullptr with NULL work ?
Also, how would I make more melee weapons able to sneak attack, and give more weapons to various Conservatives? (M249's and AA-12's to Soldiers, for example.)
The sneak attacks are in the WEAPONS.XML. Just add <can_backstab>true</can_backstab> to the weapon.
Creatures get their weapons in the CREATURETYPE.CPP . The commands are cr.give_weapon and cr.take_clips.

If you want to add completely new weapons :
* Create an entry for the weapon in WEAPONS.XML
* If it uses a new type of ammo create an entry in the CLIPS.XML
* If it should be sold in a shop an entry for the weapon (and one for new ammo) in the XML of the shop.
* If Gangmembers and Mercenaries should sell it, similar entries in the ARMSDEALER.XML
* To make creatures spawn with it, add code in CREATURETYPES.CPP .

Note, that items are referenced in the source code by a string with their name (like "WEAPON_SEMIPISTOL_9MM"). This means, that typos (like "WEAPON_SEIMPISTOL_9MM") won't generate a compiler error (as opposed to enumerated constants).

Taberone

  • Bay Watcher
    • View Profile
Re: [LCS]Modifying game messages + Compiling LCS Nightly?
« Reply #26 on: August 21, 2015, 11:21:52 pm »

By any chance, does anyone have a .zip of the latest LCS Nightly with it already compiled?
Didn't replacing nullptr with NULL work ?

Yes, but then it stopped and gave these new errors:


Logged

Purple Gorilla

  • Bay Watcher
    • View Profile
Re: [LCS]Modifying game messages + Compiling LCS Nightly?
« Reply #27 on: August 22, 2015, 02:55:30 pm »

Hmmm.... I can't reproduce the Error, assuming I am looking in the right place (activate.cpp, line 1857  ?).

The many errors, you get seem to be related to a syntax error, or missing punctuation.

Did it happen, before you changed nullptr to NULL ?
* If no, you probably made a mistake there, the line (1867) should now look like that :
 
Code: [Select]
       else if(c=='x'||c==SPACEBAR||c==ENTER||c=='n') {cur_step=1;selected_aug=NULL;}Check especially the punctuation.

* If yes, it might be related to the object oriented strings that are used in the marked line. So check :
** There is somethere above a line with "blabla has been brutally murdered", that uses such strings too - did it compile ?
** Are there any errors, about missing headers, or something about STD:string not being found ?
** Did you rename the file-extension in *.c instead of *.cpp ? (Standard C doesn't permit adding strings like that, thought it should instead add the adresses, that shouldn't cause syntax errors)

* If you modified other code, check, if you missed a semicolon or curvy bracket somethere.

Taberone

  • Bay Watcher
    • View Profile
Re: [LCS]Modifying game messages + Compiling LCS Nightly?
« Reply #28 on: August 22, 2015, 07:21:26 pm »

Hmmm.... I can't reproduce the Error, assuming I am looking in the right place (activate.cpp, line 1857  ?).

The many errors, you get seem to be related to a syntax error, or missing punctuation.

Did it happen, before you changed nullptr to NULL ?
* If no, you probably made a mistake there, the line (1867) should now look like that :
 
Code: [Select]
       else if(c=='x'||c==SPACEBAR||c==ENTER||c=='n') {cur_step=1;selected_aug=NULL;}Check especially the punctuation.

* If yes, it might be related to the object oriented strings that are used in the marked line. So check :
** There is somethere above a line with "blabla has been brutally murdered", that uses such strings too - did it compile ?
** Are there any errors, about missing headers, or something about STD:string not being found ?
** Did you rename the file-extension in *.c instead of *.cpp ? (Standard C doesn't permit adding strings like that, thought it should instead add the adresses, that shouldn't cause syntax errors)

* If you modified other code, check, if you missed a semicolon or curvy bracket somethere.

Renaming in *.c? How do I do that? Also didn't modify any other code. Fixed line 1867 and now theres this

« Last Edit: August 22, 2015, 07:47:36 pm by Taberone »
Logged

Purple Gorilla

  • Bay Watcher
    • View Profile
Re: [LCS]Modifying game messages + Compiling LCS Nightly?
« Reply #29 on: August 23, 2015, 01:31:12 pm »

I have never seen this syntax. Appearently, the Modder used any new feature, his compilers has to offer, that wouldn't be bad for a new project, but breaks compatibility with a mod.
----
The Good news are, it is easy to fix:

To fix it :
 Replace this :
Code: [Select]
   for(const auto &aug:augmentations)
      xml.AddSubDoc(aug.showXml());

With that :
 
Code: [Select]
  for(int i=0;i<AUGMENTATIONNUM;i++)
    xml.AddSubDoc(augmentations[i].showXml());

I compiled LCS Nightly with it, and it seemed to work. I Implanted a Gorilla Heart into a Hippie, and quit. On reloding he still had the Gorilla Heart. (The line is used for saving the augementations)

After this all files should be able to be compiled. If you have further trouble, with compilation, check, if you linked any files from the sandbox directory, and remove them from the list.

---
The bad news are, I didn't manage to get it properly linked to SDL. To compile it without SDL, got to the includes.h and add at the begining the line
Code: [Select]
#define DONT_INCLUDE_SDLThen click "refresh all" to recompile everything without SDL, and it compiles and links.

For now, you should propably get it compiled and running so far. Maybe someone can help you with SDL or I will find it out in some time.

---
One thing I forget is the Icon. Got to Projekt settings, and there you can select an icon. It is found in the workspace directory.
Note also, that the executable must be in the "Liberal-Crime-Squad-Nightly" directory, to find the curses.dll in its directory and the XML files under art\... .
Pages: 1 [2] 3 4