Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Messages - Purple Gorilla

Pages: 1 2 [3] 4 5 ... 7
31
Curses / Re: Terra Vitae Mod (version 0.5 released!)
« on: November 10, 2015, 05:32:51 pm »
In a traditional makefile, it would be in the linker command, but here you should put it into the LIBS.
The makefile from DEV-C contains that line :
Quote
LIBS =  -L"F:/DEVC/lib" -L"F:/terravitae0.5/src/sdl" pdcurses/pdcurses.lib -lmingw32 -lSDL2main -lSDL2 -lSDL2_mixer  -g3
The bolt text is for SDL, the other things (except curses) are compiler specific.
Your makefile has a LIBS variable, too, so it should go to the linker, if you put it there.
---
I didn't know there is a working makefile, so I added all files, and deleted those that donÄt compile, as usual, thought the FACTIONS.CPP looked important at first.

The message was "You have received an anonymous tip, that the Mafia is planing to attack Vivian Pines house." It was just a random message, that poped up while I was waiting. Now even I got a message, that conservatives have raided it, and nobody was there. I offended only the corporations in this game, but had nothing to do with the Mafia or Terra Vitae.

In SIEGE.CPP, line 1511, the conditions for a raid are checked. Probably contracted_mafia was set. There seems to be no check, whom they can attack. Other raids check the variable numpres, the heat or other variables, so the mafia seems to be able to attack any location, as the functions loops through any location. I wondering, if they can attack everything, like Sweatshop, Vegan Coop and so. If you have a sleeper, you should be spammed with such warnings. I am still not sure what offended them and why nobody was there. As you are using the offended_... flags as counters, and increase and decrease them in some places, maybe, you should check if they go negative.

---
Something else:
SIEGE.CPP, line 133
Code: [Select]
   if (law[LAW_SUPERHUMANS] == 0)
   {
      offended_superheroes = 0;
      offended_supercriminals = 0;
   }
   
Is this supposed to be ==, not >= or <= ? They can't raid you, if the law is moderate, but they can raid you on both extremes ?

32
Curses / Re: Terra Vitae Mod (version 0.5 released!)
« on: November 07, 2015, 02:49:10 pm »
Now, I was now able to compile it without moving any files. You have to add the SRC\SDL directory to the library directories, and the linker finds the libraries there. It is better this way, as you can use different versions of SDL in different projects.

I used Bloodshed DEV-C++, which is based on GCC. If you use Visual-C, the tutorials say, you have to directly link the SDL2.LIB and SDL2main.LIB, and I assume you have to link the SDL2mixer.LIB too. Doing this in DEC-C, the linker doesn't find the symbol winmain@16, which is something Visual-C spezific, and linking the SDL2test.LIB gives me many linker errors. Further, you have to link the PDCURSES.LIB, if you haven't already.

If you still can't compile it, you could try it with DEC-C instead of Visual-C. Further check, that you don't compile any unneeded files.

As I played it a bit, here is a bug report :
* You should update activate() in ACTIVATE.CPP. Some activities are descriped as  "will send bug reports to the dev team." (line 845), so some cases for new activities (and old activities like repairing clothing) are missing.
* The activity "Write for the Liberal Guardian" is not displayed. It however still works, if you know to press 7.
* The file FACTIONS.CPP doesn't compile, as it needs a nonexisting FACTION.H. Leaving it out, however seems to cause no problems.
* There are occasional crashes at the end of the month. After reloading, you can continue.
* There are empty senate election (by conspiracy) , there is a delay, as if the senate were elected  but no alignments are displayed.
* I got warnings, that the Mafia raids the Terra Vitae, without having anything to do with Terra Vitae or the Mafia (at least I think so)

33
I didn't advertize it and am not even inwolved in Thorlak's project, I was just pointing out the importance of stability.

OK, peterix was indeed unbanned. I wasn't playing dwarf fortress back then, but then I started, I was brownsing loosly through the forums for the legends of the forum (Khazad,<toad-edit: item removed>,Mermaid breeding and buthering,...) and found the thread. No I read it, carefully and did some research on google. The following things seemed to were going on :
* Toady says he released some symbols. This seems to be an *.EXE file for a debugger, so the names of functions and variables can be seen in a debugger. You can gardly call variable names intelectual property, but Toady was enraged about this.
* Peterix made DFHack. He also saw the symbols, but hadn't much use for them. Toady nowadays hasn't anymore problems with DfHack
* Impaler made Khazad, initially a visualizer.
* Peterix ported Khazad to Linux
* Impaler turned Khazad into a clone of Fortress mode. It seems to be written in Java, so there can't be any stolen code even if he had acces to it.
* Impaler encouraged people to stop donating to Toady. Toady looked throught Khazad's history on a code sharing platform and banned both contributors.
* Peterix was unbaned, because he was inwolved before impaler turned against Toady. Toady seems also not to be too enraged at clones in general, only to those that can damage his buisiness model.
---
More memory might not fix the problem in general. When the memory is filled with garbage, it will just take longer to finally crash. And again, such crashes are rare. I tried both vanilla, and vanilla with manually installed Dfhack, but it is if fact more stable with Dfhack, as "clean all" and "tweak fixmigrants" help against most problems. 

34
Curses / Re: Sleepers losing efficiency?
« on: November 06, 2015, 02:04:14 pm »
Every month, a sleeper's efficiency is changed, by a random number between -2% and +5%. If the sleeper promotes liberalism, his efficiences is additionally reduced by 2%.

35
Curses / Re: I'm going to create liberal crime squad in Poland
« on: November 06, 2015, 01:55:36 pm »
Hopefully this isn't too off topic as I couldn't seem to find it elsewhere and it seems like it would be something you would have addressed. How difficult is it to change the flag from the American flag to another countries flag?
*It is generated in SRC\BASEMODE\BASEMODE.CPP, from line 484 on.
It is fairly easy to change, asuming you can compile the game. It is more difficult, to change newspaper pictures, which are in a separate file.
*It is burned in SRC\BASEMODE\BASEACTIONS.CPP, from line 34 on. The flag is first painted, and then burned. Changing the burning algorithm is more nasty, as it makes assumtions about the characters used: '▄'(220),'▀'(223) and ':'. For the polish flag, you need the character '█'(219), but you could try a workaround, and paint the whole flag with the character '▄', and use the same colour for foreground and background, to get full blocks of one colour. For the background, only the first 8 colours are permitted, as the 4th bit means blinking, but 4=dark red and 7=dark white are both in this range.

36
Curses / Re: Terra Vitae Mod (version 0.5 released!)
« on: November 05, 2015, 05:37:33 pm »
What I need is somebody with PC-saaviness to drop by and compile this for Windows (I've tried, but Windows changed its libraries so that they no longer work with the base LCS code, and I don't understand how to fix it).

What about Reelya or Purple Gorilla?

Ok, I got it compiled, thought it is still a clutch.
It is fairly easy to compile without SDL, but getting SDL working with Bloodshed DEC-C was tricky.

After trying various permutaions and looking through some tutorials, this works :
*Copy from %TERRAVITAE BASE%\SRC\SDL\  all *.A and *.LA files into the directory %DEV-C BASE%\LIB\
*Add the following line (no quotationmarks) into the linker parameters (where you added the pdcurses.lib):"-lmingw32 -lSDL2main -lSDL2 -lSDL2_mixer
"
I really hate this solution, because copying files into your compilers directory is nasty. Maybe I find a way to give a directory in this command, thought I am not sure what it is actually doing.

I found a tip at this tutorial : http://lazyfoo.net/SDL_tutorials/lesson03/windows/devcpp/index.php, thought it uses SDL version 1, so I had to add a 2 on some commands, and most important, don't donload any files, use the files from Terra Vitae (which are Version 2). If you downloaded any files from a tutorial you might have get conflicts (thats why I hate installing libraries to the compiler).

Should I distribute the *.EXE File somehow ? My E-mail Provider, Google doesn't permit sending Executables, and blocks also most simple workarounds like normal encryption and compression, but I could try to encrypt it  with a selfmade programe (adding some random bytes at the beginning, or xoring with a constant should work) and you can decrypt it with a own programe.

Uploading a WIN32 Version of Terra Vitae at the DFFD would be also good, but SlatersQuest couldn't acess it if I do this.

37
@miauw62:
Yes, fixed size was indeed misleading, sorry. I meant, allocating a block of a user defined size then loading a game.

If the programe finds a bad pointer, there are of course better ways to handle it than simply a return, like displaying a message or writing to the errorlog.

@omega_dwarf: Running out of memory is only one problem. It is however easy to track, as you get a different exeception code, and it crashes much faster as no core dump is created. Toady's C++ library actually detects the problem, then a method can't allocate memory, and calls the processor interupt 03h, which is actually the breakpoint interrupt. If you look at the disassemled code, you see that the part of the code consists of a large block of breakpoints, so this is probably not an actual breakpoint, but the libraries way to display custom errors. If you would run it from an IDE, there would probably be a meaningful error message (derived from the IP of the breakpoint), and installing a custom exception handler would replace the breakpoint.

While my Athlon XP with 1GB of memory is slightly outdated, it could easily handle 4x4 embraks or even larger if this probles would be handled:
* unused memory isn't freed
* Contaminants multiply in water
* Dwarves never clean up
* Every bodypart and item gets its own contaminant
As quitting and restarting, and running clean all, lets the memory drop from 500MB to 50MB, 90% of the resources are appearently used by bugs.

Most problems seam to be actually dangling pointers and memory leaks. If you save the game, and load it again without terminating Dwarf Fortress, loading takes significant longer, so there must be a lot of memory leaks. It is in fact faster to quit after every safe and start it again, instead of loading immedeatly.

Telltale signs of that are also spooky things happening.
In my current fortress, that crashes often, all that did happen:
* weird symbols as quality modifiers (derefered quality level ? Artifact, those name was lost ?)
* The stock screen shows two different types of copper bars (different isotopes ? :D )
* I have rock boulders (the rocktype rock from arena mode)
* I have rock bars (not blocks, "metal" bars)
* The rock bars are stuck in unmined rock. I was able to snatch one, by deconstructing a floor in the same 16x16 block. (fighting bugs with bugs)
* Logs from unknown frozen plant substance (fairly dense, makes good crosbow bolts) This is usually related to snow, but the site never freezes.
* Stuff stuck in mid air (cave in is on)
* The key configuration changes during the game for no obvious reason. After quitting and reloading it returns to normal.
* Moody Dwarves produce items of iron without ever picking up any iron.

In adventure mode, I had also multiple times the situation, where items (like my sword) exploded for no obvious reason.

OK, this is in fact in 34.11, but 40.24 is even worse. Multitile trees and background history often produce deterministic crashes, there you end up with a savefile that crashes a few seconds after unpausing, and there is nothing you can do about it. The only crash that can be prevented is building new buildings in trees, but that is extreme crippling. Lets say, you tap the caverns from above and want to build a platform above the water, but there is a mushroom. You have to build a second stairway to the floor, let some forgotten beasts in, pump the water out (as you can only chop the botommost part of a tree) and chop it. 40.23 (there trees vanish) seems to produce far more corrupted safefiles that 34.11. and 40.24, so there is in fact no version of current release that is playable. In 34.11. it is possible to play epic fortresses were children born here grow up and dwarfs die of old age, with enough patience and 2x2 embraks, but in 40.24 I never got past 5 years or so.

38
@miauw62
You misunderstood me, the problem is not the performance, the problem are solely the crashes and broken safefiles. A mature fortress will crash around twice per real-life hour, and every few days a safefile gets corrupted, and if you safe it may crash too. So the most important thing in your mind while playing is typically, "Should I safe and risk a crash on saving, or should I play on, and risk a random crash", and you have to back up safefiles everyday, and run "tweak fixmigrants" and "clean all" every five minutes. I is also odd, that DFHack is absolutely mandatory to really play the game, and Toady even banned the guy who created DFHack (hireing him would have been better).

Videogames are always more than just art. If you make a graphics heavy game, like a first.-preson-shooter, you should spend a lot of time on performance, writing graphics functions in assembly, and when you make a deep game like dwarf fortress, you should spend a lot of time on stability, writing failsafe funtions in C.

Verifying, if a pointer existst is usually done with NULL pointers, but if a pointer contains garbage, it will still crash. Also I read every single dumplog from Dr. Watson when DF crashes, and most crashes are actual access to NULL pointers. (If you see something like wrtiting to adress 50 it are usually instructions like MOV EBX,[EBP+10], MOV EAX,[EBX+50], there 50 is the offset inside a NULL structure, and EBX the NULL pointer, read from a parameter on the stack, acessed with EBP.) So appearently some functions assume to always get valid pointers.

It is possible to intercept garbage pointers with arrays :
Code: [Select]
struct dwarf{
bla; bla; bla;
};

struct dwarf *dwarves; /* Array allocated at load time */
int max_dwarves;         /* Maximum number of Dwarves, set at load time */

void build_consturction( struct job *j, blabla)
{
 struct dwarf *worker;
 blabla;
 blabla;
 worker=job->worker;  /* load a pointer from the job */
 if(worker<dwarves) return; /* pointer too small */
 if(worker>=(dwarves+sizeof(struct dwarf)*max_dwarves)) return; /* pointer too large*/
 blablabla(worker);
 blabla;
}

If job was thrashed by a growing tree, or watever, we load an invalid pointer in worker. Accessing this pointer with blablabla() will cause a segfault or damage data, but the two lines before using it check if the pointer is out of range, so you wont get a segfault.
For extra proofing, you can even check, if the pointer is misaligned with "if((worker-dwarves)%sizeof(struct dwarf)) return;"

If you use a storage-class from the C++ library istead of an array, you don't have acces at this low level, and the library functions will happyly crash. The only workaround is, to rewrite all the strorage classes yourself, and even then the functions using the classes must handle the error, so you have even more work, than in standart-C.

The Key is defensive programming. If you look at the source code at NetHack, you see haw it works. Problems that can be fixed, call the function impossible() that displays a "Programe in disorder" message, and if it can't be fixed, it is at least anounced with panic(), before trying to safe, and aborting. This shows, that the Dev Team thought about the problem.
---
Limits don't mean, what the limits are fixed for everybody. You just set the number in an init file.
Lets say your session has slots for 200 dwarves, and you have 200 dwarves. A birth times out, you get a Message :

THE CHEESE MAKER URIST BLABLA IS PREGNANT : ABORT (G)AME  ABORT (B)ABY

You pick ABORT (G)AME, and your game IS SAFED normally. You edit the init file and set the Dwarf limit to 201. You restart. During loading, the game shows, that it is actually loading in the moment (instead of freezing with a black screen), and suddendly you see the message OUT OF MEMORY, LOADING FAILED (good programmers actually check if alloc() returns a NULL pointer).  You now see, that the game can't handle the baby, set the limit back to 200 and choose (A)BORT BABY.
Another player in the same situation might have enough memory and can continue with the limit of 201.

There is nothing bad abouts limits. Other videogames have limits, CAD programes have limits and file systems have limits. The only important thing is, to know the limits and safely fail if the limit is hit, instead of crashing for the sake of freedom.

39
*Make it translatable. The best way would be open-source. While most people confuse open-source with freeware, you can actually release proprietary open-source programes. If you really don't want that, you can put the engine into a DLL, and make the EXE file with the high-level stuff open source. In this scenario, you could even sell the DLL without loosing translatability. Please don't bother with text in XML or that, because you can't translate blobs of text, without knowing context like gender and case.

*Make it actually work. Seriously. Use defenesive programming. Put hard limits on everything, especially dwarves, objects and contaminants. Put all (yes ALL) data in arrays of fixed size, only call alloc() while embarking or loading. Write functions, to verify if pointers what are suposed to point into an array of a type actually point to the array, and intercept dangling pointers. Don't use object-oriented programming, to ensure memory allocation, and function pointers exist only in places, you definitly want them and took measures to do it safe. Don't be creative, stay at fixed features that definitly will be in the game, and don't add new stuff. Judging the code from LCS, DF's code is probably [beyond quality], so it is about time, that somebody with formal programming education helps to make it actually work.

40
Curses / Re: Adding More Buildings?
« on: November 03, 2015, 02:39:19 pm »
Adding new buildings needs recompiling it. If the buildings use a complety new layout, you have to create new entries in the art directory.

What you have to modify in the sourcecode :
* SRC\INCLUDES.H : add a new constant to the enumerated list, (like SITE_RESIDENTIAL_SHELTER)
* SRC\TITLE\LOCATIONS.CPP : add a case to the function initlocation() to give the location a name.
* SRC\TITLE\NEWGAME.CPP : create the new location. Here, you can also duplicate locations, and set if its a safehouse or hidden.
* SRC\SITEMODE\SITEMAP.CPP : give a file, to load a map from, or generate a map with parameters from a file.

The comments in the file SITEMAP.CPP explain, that you need a programe called "Deadly Alien Map Editor" found here : http://dambots.com/dame-editor/
I never added maps, so someone else might help you how to use it.

The first step, is to get the programe compiled (this takes some time). Get a C++ compiler, and the source code from LCS, and compile it. As there is no working MAKEFILE, you have to create your own makefile, or a IDE-project. Use this to compile every CPP file EXCEPT the files in SRC\SANDBOX\ and the DUMPCAPS.CPP. You have also to set the include paths to the SRC\ directory and all its subdirectories. Then, you have to finally link it to the library SRC\CURSES\PDCURSES.LIB.

If the version, you use has sound, you also have to link it to the SDL library. I have never managed to get this work, so good luck. If it doesn't work, you can disable sound by adding "#define DONT_INCLUDE_SDL" to the SRC\INCLUDES.H.

41
Curses / Re: i need help trying to run lcs on android dosbox
« on: November 03, 2015, 02:17:19 pm »
LCS is a WIN32 programe and won't run directly under DOS. You have two options :
* Download the sourcecode and compile it for DOS  (good abandonedware compilers are Turbo-C for real-mode or Watcom-C for protected mode)
* Use the Windows-emulator Wine

If you compile it for DOS, there are three things to remember:
* LCS uses Curses as video driver. To make that work, you can try to get curses for DOS or write wrappers for Borland's conio.h. Further you can write directly into the video memory, if everything fails.
* LCS has no hard limits for items and creatures. To avoid running out of memory in real mode you must set hard limits, or check the free memory with coreleft() before creating new objects.
* some places asume int is 32 bit (like long), but in real-mode, int is 16 bit (like short)

If you have a C++ compiler for Android, you can even try to compile a proper Android version. I have no experience with cellphones, but the biggest problem is probably getting it running without a keyboard. Compilers for Cellphones most likely have library-functions for a virtual keyboard, so a quick and dirty approach might be possible. For a good solution like a gui that displays only possible keys, you will have a lot of work to do. You should probably try to merge the interface functions of the old android version, with the current engine.

42
Curses / Re: I'm going to create liberal crime squad in Poland
« on: October 29, 2015, 05:52:24 pm »
Do you wan't to only set it in Poland, or translate it to polish ?

If you want to translate it, the source code of the german translation can help you.
http://dffd.bay12games.com/file.php?id=10985

Interesting stuff :
* Support for grammatical sex (including XML tags). The GERMAN.C contains all the grammar stuff, like a matrix for 'the' in different cases, sexes and numbers. You probably have to adjust this a bit. According to Wikipedia, German and Polish have the same Sexes and Numbers (Do you have sex in plural (like french) ? This is not clear from the article), thought polish has more cases. . The functions for 'the' and 'his'/'her' (each 16 permutations in german) are called in the important places, so changing the function gets a lot of work done.
* Removal of all gender-neutral stuff, hermaphrodites and in-game homosexuality. This makes transaltion a lot of easier.
* The main funktion makes a system-call to CHCP to force the correct codepage. As polish seems to have a lot of umlaute this is very important. Note, this seems only to work in fullscreen, that is also the reason, why the screenshots of the german LCS look crappy. If you wan't to edit text in source or XML files, it is important to use the correct editor. Windows has 2 text-editors, EDIT.COM and NOTEPAD.EXE . You must use EDIT.COM to get the correct codepage.
* Translation-friendly overwork of the code. Code duplication in the politics code removed, and most of the strings are now found only once.
* Suport of sex for people, who haven't a sex in the english version (like the President). It is encoded behind the terminator of their name.
* Suport of sex and preposition for locations. It is encoded in the first letter of the name of a location.
* A clutch to generate umlaute from C, without modifing the font file.
* some bugfixes

43
Curses / Re: [LCS]Tips for newbies?
« on: October 29, 2015, 04:30:53 pm »
Its is important to know the basics about heat and raids: Then a liberal commits certain crimes, he gets heat attached, that will slowly transfer to the safehouse. You can see the heat in the "Go forth to stop evil" Menu.
Then a liberal has 100 or more heat, he will transfer the heat to the safehouse, and loose it in the process, up to a minimum of 100. Then liberal does communtity services, his heat is reduced by 1 per day. Heat below 100 is only relevant, if you are working in public, while heat above 100 gets you raided. (To work safely in public as a criminal, you must do 100 days of community services)

* The types of raids are *
* Police Siege : The probability of a Police siege is proportional to your heat. After some days of sieging, they will raid you. If you fought of a siege, they will besiege the location a few days later, no matter if there is still somebody there. You can surrender to the police, and criminals get arrestet, others will be released. There is no "FINDING A BUG" charge, and in fact it isn't a bug. Killing the raiding Policemen is considered murder, so you get even more heat. Police sieges escalate from level 1 up to level 4.
* CCS raid : The CCS attacks locations with heat, and prefere locations with a printing preess. In 4.7.4 They can also attack a press, without heat, and in 4.7.0 you are completely safe if you haven't heat. The strength depends on the Endgame_state variable.
* CIA raid : The CIA attacks, if the location has heat, and the offended_CIA flag is set. offended_CIA is set if you publish their files or ANYBODY commited treason. It is reset after the raid.
* Corporate raid : The corporations attack, if the locations has heat, and the offended_corps flag is set. offended_corps is set if you publish their files. It is reset after the raid.
* Firemen raid : The Firemen attack locations with a printing press, if the offended_firemen flag is set. offended_Firemen is set, if you publish any files, or ANYBODY commited free speech. It is reset after the raid. They let you surrender.
* Redneck raid : The Rednecks attack, if the offended_AM_radio or offended_cable_news flag is set and the view on the media is below 30%. The flags are set, if you publish files of a media, or take a news anchor or radio moderator as a hostage in a way, that gives you a kidnapping charge. The flag of the raiding faction is reset after after the raid.

*Raiders*
* Police level 1: SWAT Teams with MP5s and M4s.
* Police level 2: Marines with M16s.
* Police level 3: Marines with M16s and M1 Abrams Tanks.
* Police level 4: Navy Seals with M4s, M1 Abrams Tanks and Bombers.
* CCS level 1: Civilians with .44, AR15 and Molotov Cocktails
* CCS level 2: Types from level 1 plus Soldiers and Mercenaries with M16 and AR15, and armour.
* CCS level 3: Types from level 1 and 2 plus Team Leaders with AA-12s and Ceramic armour.
* CIA : Agents with Various automatic Weapons.
* Corporations : Mercenaries with AR15 or M16 depending on gun control.
* Firemen : Firemen with Flamethrowers. They always set the site on fire, and the damage is permanent. If enough of the site is burned down, you get some glitches on the map borders, and items may spawn in inaccessible holes.
* Rednecks : Rednecks with torches, pitchforks and shotguns. The probability of a given redneck, to have a shotgun depends on gun control.

*How to publish Files*
Then a file is published, you may be charged with treason or free speech. To avoid this, station the files at the press (R->Move Equipment) and make sure, at the end of the month there is nobody there. You can still publish the file, but nobody gets a charge. This will however still offend the factions, so the press may be attacked by firemen, if you commit free speech and rednecks may attack any locations if the view drops.

*How to surrender*
In general you should never surrender to anybody other than the police or the firemen, because this gets anybody killed. If you surrender to the police, anybody at the locations gets arrested. There is however an abusive workaround: If you chose to fight off the raid and wlak into a siege unit, you can (T)alk to them and surrender. This gets only the currents squad (=six guys) arrested. During the raid, you can press (R)eorganize, and put some Hippies and Prostitutes with a clean rapsheet on the frontline, and prevent your high profile liberals from getting arrested.

*Known Bugs*
* Sometimes the game will crash during elections. This happens, then a proposition tries to change the prison law, in a year without a president election. To work around : 1. Retry a few times 2. raid the courthouse, to give other laws more priority. 3. restore from a backed up safegame.
* You cannot reconquer abandoned factories conquered by the CCS. They are lost forever. Better not let that happen.
* If you kill multiple tanks during a raid, the raid becomes unwinnible. To avoid this make sure, you kill 10 Navy Seals before taking on the tanks. Killing 10 or more Seals and EXACTLY one Tank ends the raid, no matter how many tanks were spawned.
* If you buy a gun from a conservative (Gangmember at the Crack-House) he shoots at you for wielding the gun, you just bought. To work arround, Press (E)quipment while you are still in the shop menu, and unwield the weapon (buy pressing the number of the liberal).
* You can assign ANYBODY to a squad, including prisoners and sleepers. This can be abused to walk out of prison, or train your sleeper lawyer by vandalizing the sweatshop.

44
Curses / Re: Trying to compile on VS 2013 Community
« on: September 13, 2015, 02:49:29 pm »
Other problems are also some unfortunate macros and the interface methods.

The macros GIVE_WEAPON_CIVILLIAN, GIVE_GENDER_MALE and GIVE_GENDER_FEMALE in creaturetypes.cpp insert big chunks of code, and should be repaced with functions. If you use compiler optimisation, the compiler chokes on this file, probably trying to find it out itself.

The other problems are the interface methods, that do nothing than returning a value. Declaring everything public will make a lot of things easier. I am pretty sure, the compiler will resolve interface methods itself, but it still increases readability. Another problem with interface methods is, that it is more difficult to write "cheats" for debugging, as changing a variable in an object from outside isn't possible without another interface method.

Further, should it be avoided to use features that the unmodded game didn't use. In the LCS-nightly Mod, the modder used nullptr instead of NULL, and Java-style for loops, breaking the downward compatiblity with no gain at all. This is easy to fix for an experienced programmer, but Taberone now tried two months to compile it -> http://www.bay12forums.com/smf/index.php?topic=152165.0 .

45
Curses / Re: [LCS]Modifying game messages + Compiling LCS Nightly?
« on: September 06, 2015, 01:06:08 pm »
Congratulation, you just found a bug.

According to the source code, both fullscreen and halfscreen shops support multiple pages. The half screen shop, you are seeing,  has code to display multiple pages, and code for buying from them, but there is no code, to change the page.

The fullscreen shop however has code for turning the pages with arrow keys. In older versions, gangmembers and mercenaries used the fullscreen shop, so what you are doing, would work there.

If you can compile it, it should also be possible to mod it in yourself. The function is void Shop::browse_halfscreen(squadst& customers, int& buyer) const in SHOP.CPP


This is the code for parsing a keypress :
Code: [Select]
     if(c=='e' && customers.squad[0]->base!=-1)
         equip(location[customers.squad[0]->base]->loot,-1);
      else if(c=='s'&&allow_selling_&&len(location[customers.squad[0]->base]->loot))
         sell_loot(customers);
      else if(c=='m'&&sell_masks_&&ledger.get_funds()>=15)
         maskselect(*customers.squad[buyer]);
      else if(c=='b') choose_buyer(customers,buyer);
      else if(c=='0') party_status=-1;
      else if(c>='1'&&c<='6')
      {
         if(customers.squad[c-'1']!=NULL)
         {
            if(party_status==c-'1')
               fullstatus(party_status);
            else party_status=c-'1';
         }
      }
      else if(c=='x'||c==ENTER||c==ESC||c==SPACEBAR) break;


This should work :
Code: [Select]
      if(c=='e' && customers.squad[0]->base!=-1)
         equip(location[customers.squad[0]->base]->loot,-1);
      else if(c=='s'&&allow_selling_&&len(location[customers.squad[0]->base]->loot))
         sell_loot(customers);
      else if(c=='m'&&sell_masks_&&ledger.get_funds()>=15)
         maskselect(*customers.squad[buyer]);
      else if(c=='b') choose_buyer(customers,buyer);
      else if(c=='0') party_status=-1;
      else if(c>='1'&&c<='6')
      {
         if(customers.squad[c-'1']!=NULL)
         {
            if(party_status==c-'1')
               fullstatus(party_status);
            else party_status=c-'1';
         }
      }
      else if(c=='x'||c==ENTER||c==ESC||c==SPACEBAR) break;
      //PAGE UP
      else if((c==interface_pgup||c==KEY_UP||c==KEY_LEFT)&&page>0) page--;
      //PAGE DOWN
      else if((c==interface_pgdn||c==KEY_DOWN||c==KEY_RIGHT)&&(page+1)*19<len(available_options)) page++;
I copied the lines from the fullscreen shop, and replaced the 'if' with 'else if'. It compiles, but I can't try it out so far, as it needs many items to work.

Pages: 1 2 [3] 4 5 ... 7