Skip to content
Snippets Groups Projects
README.md 5.03 KiB
Newer Older
  • Learn to ignore specific revisions
  • # Free Cities - pregmod
    
    Pregmodder's avatar
    Pregmodder committed
    
    
    Arkerthan's avatar
    Arkerthan committed
    Pregmod is a modification of the original [Free Cities](https://freecitiesblog.blogspot.com/) created by FCdev.
    
    Pregmodder's avatar
    Pregmodder committed
    
    
    Arkerthan's avatar
    Arkerthan committed
    ## Play the game
    
    Pregmodder's avatar
    Pregmodder committed
    
    
    You can download compiled files and source archives from the [Releases page](https://gitgud.io/pregmodfan/fc-pregmod/-/releases), and the [build](https://gitgud.io/pregmodfan/fc-pregmod/-/jobs/artifacts/pregmod-master/download?job=build) from the latest commit to the master branch.
    
    Pregmodder's avatar
    Pregmodder committed
    
    
    Alternatively, you can build the game yourself:
    
    First, clone the git repository:
    
    Pregmodder's avatar
    Pregmodder committed
    
    
    Arkerthan's avatar
    Arkerthan committed
    1. [Install Git for terminal](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git) or a Git GUI of your choice.
    2. Clone the repo
        * Via terminal: `git clone --single-branch https://gitgud.io/pregmodfan/fc-pregmod.git`
    3. Get updates
        * Via terminal: `git pull`
    
    Pregmodder's avatar
    Pregmodder committed
    
    
    Arkerthan's avatar
    Arkerthan committed
    Compile the game:
    
    Pregmodder's avatar
    Pregmodder committed
    
    
    Arkerthan's avatar
    Arkerthan committed
    * Windows
        * Run compile.bat
        * Second run of compile.bat will overwrite without prompt
    
    Pregmodder's avatar
    Pregmodder committed
    
    
    * Linux/Mac
    
    Arkerthan's avatar
    Arkerthan committed
        1. Ensure executable permission on file `devTools/tweeGo/tweego` (not tweego.exe!)
        2. Ensure executable permission on file `compile.sh`
    
    bcy603's avatar
    bcy603 committed
        3. In the root dir of sources (where you see src, devTools, bin...) run command `./compile.sh` from console.
    
    Arkerthan's avatar
    Arkerthan committed
            Alternatively, if you have make installed, run `make all` in the root directory.
    
    Pregmodder's avatar
    Pregmodder committed
    
    
    Arkerthan's avatar
    Arkerthan committed
    To play open FCpregmod.html in bin/ (Recommendation: Drag it into incognito mode)
    
    Pregmodder's avatar
    Pregmodder committed
    
    
    Arkerthan's avatar
    Arkerthan committed
    ## Common problems
    
    Pregmodder's avatar
    Pregmodder committed
    
    
    bcy603's avatar
    bcy603 committed
    * I get an error on gamestart reading `Apologies! A fatal error has occurred. Aborting. Error: Unexpected token @ in
    
    Arkerthan's avatar
    Arkerthan committed
        JSON at position 0. Stack Trace: SyntaxError: Unexpected token @ in JSON at position 0 at JSON.parse (<anonymous>)
        at JSON.value` or some variant
        - clear cookies
    
    Blank_Alt's avatar
    Blank_Alt committed
    	
    	- Use FCHost (Recommended)
    		In addition to not having to deal with browser cache limits or browser cookies being killed and losing save data,
    		Sugarcube storage is stored onto your disk as more easily editable files,
    		can also be noticably faster.
    		
    		A pre-compiled Windows x64 version along 
    		with pre-compiled versions of Pregmod FC designed to support browsers that 
    		do not recognize globalThis can be found [here](https://mega.nz/folder/vzxgwKwL#L4V4JEk1YfWcvC7EG76TMg).
    		For more details please refer to [FCHost/Documentation_FCHost.md](FCHost/Documentation_FCHost.md)
    	
    	- If you are using Firefox the cache quota can be increased by typing about:config in the address bar and then modifing dom.storage.default_quota's value. Default value is 5120 kilobytes/ 5 MB.
    
    	- If you don't have or want to use Firefox or FCHost:
    		1. download and unzip NW.js SDK (https://nwjs.io/ ) for your operative system
    		2. copy the game file (FC_pregmod.html) into the "nwjs-sdk-v0.XX.Y-YOUR_OS" folder
    		3. in the same folder, create a text file with the following content:
    		{
    		"name": "Free Cities pregmod edition",
    		"main": "FC_pregmod.html",
    		"dom_storage_quota":30
    		}
    		and save it as package.json (it must be a UTF-8 file). See the attached file
    		4. double click nw.exe to launch the game
    		In this example, 30 is the limit (in MB) that is set for the storage quota, but you can replace it with any number. Google Chrome has the same default value as Firefox.
    
    		According to the official docs, the path where the cache files are stored depends on the "name" field in the manifest (in this example: "Free Cities pregmod edition"):
    		- on Windows: %LOCALAPPDATA%/<name-in-manifest>/
    		- on Mac: ~/Library/Application Support/<name-in-manifest>/
    		- on Linux: ~/.config/<name-in-manifest>/
    		You can customize the path by adding another parameter to package.json:
    		```
    		{
    		"dom_storage_quota":30,
    		"chromium-args": "--user-data-dir='PUT_YOUR_PATH_HERE'"
    		}
    		```
    
    Pregmodder's avatar
    Pregmodder committed
    
    
    Arkerthan's avatar
    Arkerthan committed
    * Everything is broken!
    
    Blank_Alt's avatar
    Blank_Alt committed
        - **Do not copy over your existing download** as it may leave old files behind, replace it entirely
    
    Pregmodder's avatar
    Pregmodder committed
    
    
    Arkerthan's avatar
    Arkerthan committed
    * I can't save more than once or twice.
    
    lowercasedonkey's avatar
    lowercasedonkey committed
        - Known issue caused by SugarCube level changes. Save to file doesn't have this problem and will likely avoid the first problem as well.
    
    Arkerthan's avatar
    Arkerthan committed
        - It is possible to increase the memory utilized by your browser to delay this
    
    Pregmodder's avatar
    Pregmodder committed
    
    
    Arkerthan's avatar
    Arkerthan committed
    * I wish to report a sanityCheck issue.
        - Great, however a large majority of the results are false positives coming from those specific sections being split
    
    bcy603's avatar
    bcy603 committed
          over several lines in the name of readability and git grep's
    
    Arkerthan's avatar
    Arkerthan committed
          [intentionally](http://git.661346.n2.nabble.com/bug-git-grep-P-and-multiline-mode-td7613900.html ) lacking support
    
    bcy603's avatar
    bcy603 committed
           for multiline. An Attempt to add -Pzl (https://gitgud.io/pregmodfan/fc-pregmod/merge_requests/2108 ) created a
    
    Arkerthan's avatar
    Arkerthan committed
           sub condition black hole. What follows are examples of common false positives that can safely be ignored:
    ```
    [MissingClosingAngleBracket]src/art/vector/Generate_Stylesheet.tw:11:<<print "<style>."+_art_display_class+" {
    	<<print "<style>."+_art_display_class+" {
    position: absolute;
    height: 100%;
    margin-left: auto;
    margin-right: auto;
    left: 0;
    right: 0;
    }
    ```
    
    Pregmodder's avatar
    Pregmodder committed
    
    
    Arkerthan's avatar
    Arkerthan committed
    ## Contribute
    
    
    Arkerthan's avatar
    Arkerthan committed
    New Contributors are always welcome. Basic information before you start can be found [here](CONTRIBUTING.md)
    
    ## Submodules
    
    FC uses a modified version of SugarCube 2. More information can be found [here](devNotes/sugarcube stuff/building SugarCube.md).