mirror of
https://github.com/fallout2-ce/fallout2-ce.git
synced 2026-07-27 16:47:11 -07:00
Compare commits
63
Commits
heap-fixes
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cd38c82514 | ||
|
|
552505e3f5 | ||
|
|
b9dd399457 | ||
|
|
5f544ca985 | ||
|
|
0c7752fd33 | ||
|
|
0a5364972c | ||
|
|
1db054e47a | ||
|
|
8e60a2fba2 | ||
|
|
ca89abad6c | ||
|
|
21a98bebb1 | ||
|
|
283107bebe | ||
|
|
dd21129464 | ||
|
|
7604061e1c | ||
|
|
f832d78949 | ||
|
|
57b784b8a0 | ||
|
|
d5fd197dd9 | ||
|
|
6375604af8 | ||
|
|
c02c5efcf6 | ||
|
|
94a7e7207c | ||
|
|
b8988b69a8 | ||
|
|
9467f4f778 | ||
|
|
447cf6edff | ||
|
|
c9bcb719ee | ||
|
|
5dc9135689 | ||
|
|
dfe7eeb3a8 | ||
|
|
436ce12022 | ||
|
|
1bc0711327 | ||
|
|
5a87638781 | ||
|
|
10f59c6b45 | ||
|
|
24562f57da | ||
|
|
9711e61f89 | ||
|
|
d8d99fe94a | ||
|
|
1a9211d44d | ||
|
|
d63f293291 | ||
|
|
71eaabc957 | ||
|
|
aac42c162c | ||
|
|
47156d2e45 | ||
|
|
33744ecf2e | ||
|
|
20e80d4bb3 | ||
|
|
a756bc2700 | ||
|
|
de73c90a89 | ||
|
|
aa439efd04 | ||
|
|
41f09fa343 | ||
|
|
44067b1933 | ||
|
|
68d7bd0668 | ||
|
|
799184ab96 | ||
|
|
5774372924 | ||
|
|
e90b68837d | ||
|
|
ceecc3ebdb | ||
|
|
83b6e081b7 | ||
|
|
083bd4a4cc | ||
|
|
27ae59578a | ||
|
|
fdee9914e3 | ||
|
|
258de7c21e | ||
|
|
feb0cd61ff | ||
|
|
cbbe2f00f1 | ||
|
|
bf1d35b2de | ||
|
|
4a9e822e82 | ||
|
|
843803e26a | ||
|
|
ef0085dcca | ||
|
|
9c19d212a6 | ||
|
|
41d908274f | ||
|
|
dafb7b3831 |
@@ -122,6 +122,7 @@ jobs:
|
||||
mkdir -p out/dist/fallout2-ce-android-debug
|
||||
cp os/android/app/build/outputs/apk/debug/app-debug.apk out/dist/fallout2-ce-android-debug/fallout2-ce.apk
|
||||
cp out/dist/ce.dat out/dist/fallout2-ce-android-debug/ce.dat
|
||||
cp files/fallout2.cfg out/dist/fallout2-ce-android-debug/EXAMPLE_fallout2.cfg
|
||||
cd out/dist
|
||||
zip -r fallout2-ce-android-debug.zip fallout2-ce-android-debug
|
||||
|
||||
@@ -178,6 +179,7 @@ jobs:
|
||||
mkdir -p out/dist/fallout2-ce-ios
|
||||
cp out/build/ios/fallout2-ce.ipa out/dist/fallout2-ce-ios/fallout2-ce-ios.ipa
|
||||
cp out/dist/ce.dat out/dist/fallout2-ce-ios/ce.dat
|
||||
cp files/fallout2.cfg out/dist/fallout2-ce-ios/EXAMPLE_fallout2.cfg
|
||||
cd out/dist
|
||||
zip -r fallout2-ce-ios.zip fallout2-ce-ios
|
||||
|
||||
@@ -243,6 +245,7 @@ jobs:
|
||||
mkdir -p out/dist/fallout2-ce-linux-${{ matrix.arch }}
|
||||
cp out/build/linux-${{ matrix.arch }}-debug/fallout2-ce out/dist/fallout2-ce-linux-${{ matrix.arch }}/fallout2-ce
|
||||
cp out/dist/ce.dat out/dist/fallout2-ce-linux-${{ matrix.arch }}/ce.dat
|
||||
cp files/fallout2.cfg out/dist/fallout2-ce-linux-${{ matrix.arch }}/EXAMPLE_fallout2.cfg
|
||||
tar -czvf out/dist/fallout2-ce-linux-${{ matrix.arch }}.tar.gz -C out/dist fallout2-ce-linux-${{ matrix.arch }}
|
||||
|
||||
- name: Upload
|
||||
@@ -252,23 +255,38 @@ jobs:
|
||||
path: out/dist/fallout2-ce-linux-${{ matrix.arch }}.tar.gz
|
||||
retention-days: 7
|
||||
|
||||
linux-armhf:
|
||||
name: Linux (armhf)
|
||||
linux-arm:
|
||||
name: Linux (${{ matrix.arch }})
|
||||
|
||||
runs-on: ubuntu-22.04-arm
|
||||
needs: [ce-dat]
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
arch:
|
||||
- armhf
|
||||
- arm64
|
||||
|
||||
steps:
|
||||
- name: Clone
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Dependencies
|
||||
- name: Dependencies (armhf)
|
||||
if: matrix.arch == 'armhf'
|
||||
run: |
|
||||
sudo dpkg --add-architecture armhf
|
||||
sudo apt update
|
||||
sudo apt install gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf libsdl2-dev:armhf zlib1g-dev:armhf
|
||||
|
||||
- name: Configure
|
||||
- name: Dependencies (arm64)
|
||||
if: matrix.arch == 'arm64'
|
||||
run: |
|
||||
sudo apt update
|
||||
sudo apt install libsdl2-dev zlib1g-dev
|
||||
|
||||
- name: Configure (armhf)
|
||||
if: matrix.arch == 'armhf'
|
||||
run: |
|
||||
cmake \
|
||||
-B build \
|
||||
@@ -279,45 +297,8 @@ jobs:
|
||||
-D CMAKE_CXX_COMPILER=arm-linux-gnueabihf-g++ \
|
||||
# EOL
|
||||
|
||||
- name: Build
|
||||
run: cmake --build build
|
||||
|
||||
- name: Download ce.dat
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: ce-dat
|
||||
path: out/dist
|
||||
|
||||
- name: Package
|
||||
run: |
|
||||
mkdir -p out/dist/fallout2-ce-linux-armhf
|
||||
cp build/fallout2-ce out/dist/fallout2-ce-linux-armhf/fallout2-ce
|
||||
cp out/dist/ce.dat out/dist/fallout2-ce-linux-armhf/ce.dat
|
||||
tar -czvf out/dist/fallout2-ce-linux-armhf.tar.gz -C out/dist fallout2-ce-linux-armhf
|
||||
|
||||
- name: Upload
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: fallout2-ce-linux-armhf
|
||||
path: out/dist/fallout2-ce-linux-armhf.tar.gz
|
||||
retention-days: 7
|
||||
|
||||
linux-arm64:
|
||||
name: Linux (arm64)
|
||||
|
||||
runs-on: ubuntu-22.04-arm
|
||||
needs: [ce-dat]
|
||||
|
||||
steps:
|
||||
- name: Clone
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Dependencies
|
||||
run: |
|
||||
sudo apt update
|
||||
sudo apt install libsdl2-dev zlib1g-dev
|
||||
|
||||
- name: Configure
|
||||
- name: Configure (arm64)
|
||||
if: matrix.arch == 'arm64'
|
||||
run: cmake -B build -D CMAKE_BUILD_TYPE=Debug -D FALLOUT_VENDORED=OFF
|
||||
|
||||
- name: Build
|
||||
@@ -331,16 +312,17 @@ jobs:
|
||||
|
||||
- name: Package
|
||||
run: |
|
||||
mkdir -p out/dist/fallout2-ce-linux-arm64
|
||||
cp build/fallout2-ce out/dist/fallout2-ce-linux-arm64/fallout2-ce
|
||||
cp out/dist/ce.dat out/dist/fallout2-ce-linux-arm64/ce.dat
|
||||
tar -czvf out/dist/fallout2-ce-linux-arm64.tar.gz -C out/dist fallout2-ce-linux-arm64
|
||||
mkdir -p out/dist/fallout2-ce-linux-${{ matrix.arch }}
|
||||
cp build/fallout2-ce out/dist/fallout2-ce-linux-${{ matrix.arch }}/fallout2-ce
|
||||
cp out/dist/ce.dat out/dist/fallout2-ce-linux-${{ matrix.arch }}/ce.dat
|
||||
cp files/fallout2.cfg out/dist/fallout2-ce-linux-${{ matrix.arch }}/EXAMPLE_fallout2.cfg
|
||||
tar -czvf out/dist/fallout2-ce-linux-${{ matrix.arch }}.tar.gz -C out/dist fallout2-ce-linux-${{ matrix.arch }}
|
||||
|
||||
- name: Upload
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: fallout2-ce-linux-arm64
|
||||
path: out/dist/fallout2-ce-linux-arm64.tar.gz
|
||||
name: fallout2-ce-linux-${{ matrix.arch }}
|
||||
path: out/dist/fallout2-ce-linux-${{ matrix.arch }}.tar.gz
|
||||
retention-days: 7
|
||||
|
||||
macos:
|
||||
@@ -431,6 +413,7 @@ jobs:
|
||||
mkdir -p out/dist/fallout2-ce-windows-${{ matrix.arch }}
|
||||
cp out/build/windows-${{ matrix.arch }}/RelWithDebInfo/fallout2-ce.exe out/dist/fallout2-ce-windows-${{ matrix.arch }}/fallout2-ce.exe
|
||||
cp out/dist/ce.dat out/dist/fallout2-ce-windows-${{ matrix.arch }}/ce.dat
|
||||
cp files/fallout2.cfg out/dist/fallout2-ce-windows-${{ matrix.arch }}/EXAMPLE_fallout2.cfg
|
||||
cd out/dist
|
||||
7z a fallout2-ce-windows-${{ matrix.arch }}.zip fallout2-ce-windows-${{ matrix.arch }}
|
||||
|
||||
@@ -445,7 +428,7 @@ jobs:
|
||||
release:
|
||||
name: Release Continuous build
|
||||
runs-on: ubuntu-latest
|
||||
needs: [android, ios, linux, linux-armhf, linux-arm64, macos, windows]
|
||||
needs: [android, ios, linux, linux-arm, macos, windows]
|
||||
permissions:
|
||||
contents: write
|
||||
steps:
|
||||
|
||||
@@ -70,6 +70,7 @@ jobs:
|
||||
mkdir -p out/dist/fallout2-ce-android
|
||||
cp os/android/app/build/outputs/apk/release/app-release.apk out/dist/fallout2-ce-android/fallout2-ce-android.apk
|
||||
cp out/dist/ce.dat out/dist/fallout2-ce-android/ce.dat
|
||||
cp files/fallout2.cfg out/dist/fallout2-ce-android/EXAMPLE_fallout2.cfg
|
||||
cd out/dist
|
||||
zip -r fallout2-ce-android.zip fallout2-ce-android
|
||||
gh release upload ${{ github.event.release.tag_name }} fallout2-ce-android.zip
|
||||
@@ -130,6 +131,7 @@ jobs:
|
||||
mkdir -p out/dist/fallout2-ce-ios
|
||||
cp build/fallout2-ce.ipa out/dist/fallout2-ce-ios/fallout2-ce-ios.ipa
|
||||
cp out/dist/ce.dat out/dist/fallout2-ce-ios/ce.dat
|
||||
cp files/fallout2.cfg out/dist/fallout2-ce-ios/EXAMPLE_fallout2.cfg
|
||||
cd out/dist
|
||||
zip -r fallout2-ce-ios.zip fallout2-ce-ios
|
||||
gh release upload ${{ github.event.release.tag_name }} fallout2-ce-ios.zip
|
||||
@@ -211,6 +213,7 @@ jobs:
|
||||
mkdir -p out/dist/fallout2-ce-linux-${{ matrix.arch }}
|
||||
cp build/fallout2-ce out/dist/fallout2-ce-linux-${{ matrix.arch }}/fallout2-ce
|
||||
cp out/dist/ce.dat out/dist/fallout2-ce-linux-${{ matrix.arch }}/ce.dat
|
||||
cp files/fallout2.cfg out/dist/fallout2-ce-linux-${{ matrix.arch }}/EXAMPLE_fallout2.cfg
|
||||
tar -czvf fallout2-ce-linux-${{ matrix.arch }}.tar.gz -C out/dist fallout2-ce-linux-${{ matrix.arch }}
|
||||
gh release upload ${{ github.event.release.tag_name }} fallout2-ce-linux-${{ matrix.arch }}.tar.gz
|
||||
rm fallout2-ce-linux-${{ matrix.arch }}.tar.gz
|
||||
@@ -341,6 +344,7 @@ jobs:
|
||||
mkdir -p out/dist/fallout2-ce-windows-${{ matrix.arch }}
|
||||
cp out/build/windows-${{ matrix.arch }}/RelWithDebInfo/fallout2-ce.exe out/dist/fallout2-ce-windows-${{ matrix.arch }}/fallout2-ce.exe
|
||||
cp out/dist/ce.dat out/dist/fallout2-ce-windows-${{ matrix.arch }}/ce.dat
|
||||
cp files/fallout2.cfg out/dist/fallout2-ce-windows-${{ matrix.arch }}/EXAMPLE_fallout2.cfg
|
||||
cd out/dist
|
||||
7z a fallout2-ce-windows-${{ matrix.arch }}.zip fallout2-ce-windows-${{ matrix.arch }}
|
||||
gh release upload ${{ github.event.release.tag_name }} fallout2-ce-windows-${{ matrix.arch }}.zip
|
||||
|
||||
@@ -1,18 +1,102 @@
|
||||
# Fallout 2 Community Engine
|
||||
|
||||
Fallout 2 Community Engine is a fully working re-implementation of the Fallout 2 engine, optimized for a hassle-free experience on multiple platforms. It provides high resolution support, quality-of-life improvements, and dozens of bug fixes.
|
||||
Fallout 2 Community Engine is a fully working re-implementation of the Fallout 2 engine, optimized for a hassle-free experience on multiple platforms, including Windows, Mac, iOS, Android, and Linux. It provides high resolution support, quality-of-life improvements, and dozens upon dozens of bug fixes.
|
||||
|
||||
This is a fork of the original Fallout2: CE project, which is no longer getting regular updates.
|
||||
|
||||
Popular Fallout 2 total conversion mods are partially supported. Original versions of Nevada and Sonora (that do not rely on extended features provided by Sfall) work. [Fallout 2 Restoration Project](https://github.com/BGforgeNet/Fallout2_Restoration_Project) is supported (in Beta). [Fallout Et Tu](https://github.com/rotators/Fo1in2) and [Olympus 2207](https://olympus2207.com) are not yet supported. Other mods (particularly Resurrection and Yesterday) are not tested.
|
||||
Popular Fallout 2 total conversion mods are partially supported. Nevada and Sonora work. [Fallout 2 Restoration Project](https://github.com/BGforgeNet/Fallout2_Restoration_Project) is supported (in Beta). [Fallout Et Tu](https://github.com/rotators/Fo1in2) and [Olympus 2207](https://olympus2207.com) are not yet supported. Other mods (particularly Resurrection and Yesterday) are not tested.
|
||||
|
||||
Fallout2: CE has broad (though not total) compatibility with [Sfall](https://github.com/sfall-team/sfall) scripting extensions. Many traditional Fallout mods work out of the box.
|
||||
Fallout2: CE has broad (though not total) compatibility with [Sfall](https://github.com/sfall-team/sfall) scripting extensions. Many traditional Fallout mods work out of the box, including NPC Armor, Party Orders, FO2Tweaks (we recommend v14.5+), Talking Heads, and many others.
|
||||
|
||||
There is also [Fallout 1 Community Edition](https://github.com/alexbatalov/fallout1-ce) (not affiliated with this fork).
|
||||
## Installation — [Download Latest CE Release](https://github.com/fallout2-ce/fallout2-ce/releases)
|
||||
|
||||
## Installation
|
||||
You *must* own the game to play. Purchase your copy on [GOG](https://www.gog.com/game/fallout_2), [Epic Games](https://store.epicgames.com/p/fallout-2) or [Steam](https://store.steampowered.com/app/38410).
|
||||
|
||||
You *must* own the game to play. Purchase your copy on [GOG](https://www.gog.com/game/fallout_2), [Epic Games](https://store.epicgames.com/p/fallout-2) or [Steam](https://store.steampowered.com/app/38410). Download latest [release](https://github.com/fallout2-ce/fallout2-ce/releases) or build from source.
|
||||
Download CE from the link above, then extract the archive into your game folder. Launch `fallout2-ce.exe` on Windows (or the platform-specific executable) to play. CE has a lot of enhancements that require configuration. See [Configuration](#configuration) for examples.
|
||||
|
||||
For detailed instructions on how to play on Mac, Linux, iOS, or Android, see the [Platform-specific instructions](#platform-specific-installation).
|
||||
|
||||
## Quality of life benefits over vanilla Fallout
|
||||
|
||||
* High resolution support
|
||||
* Party members can loot and barter in place of PC
|
||||
* Directly equip party members instead of convincing them to use the right equipment.
|
||||
* Expanded 2-column inventory, loot screens
|
||||
* Expanded 4-row barter screen
|
||||
* Expanded AP bar
|
||||
* Ctrl-click to quickly move items when bartering, looting, or stealing, and auto-balance caps
|
||||
* Music continues playing between maps
|
||||
* Auto open doors
|
||||
* Integrated "HELP" menu
|
||||
* 44.1 kHz stereo sound/music supported, in .ogg and .wav format as well as legacy .acm
|
||||
* Last used save slot is remembered
|
||||
* Item/Corpse/Container/Critter highlighting (configure using [mods/sfall-mods.ini](https://github.com/sfall-team/sfall/blob/master/artifacts/config_files/sfall-mods.ini))
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<td align="center">
|
||||
<img src="docs/images/two-column-inventory.jpg" alt="Expanded 2-column inventory" width="360"><br>
|
||||
<sub>Expanded 2-column inventory</sub>
|
||||
</td>
|
||||
<td align="center">
|
||||
<img src="docs/images/companion-equip.gif" alt="Companion equip screen" width="360"><br>
|
||||
<sub>Companion equip screen</sub>
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center">
|
||||
<img src="docs/images/party-member-loot.gif" alt="Party member loot" width="360"><br>
|
||||
<sub>Party member loot</sub>
|
||||
</td>
|
||||
<td align="center">
|
||||
<img src="docs/images/help-menu.gif" alt="Integrated HELP menu" width="360"><br>
|
||||
<sub>Integrated HELP menu</sub>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
There are also dozens of small things that just work a little better than they did in the original. Better pathfinding, fewer graphics glitches, less finicky weapon stacking, and much more.
|
||||
|
||||
## Configuration
|
||||
|
||||
The main configuration file is `fallout2.cfg`. This contains original game config as well as new CE settings.
|
||||
|
||||
Additional settings for screen resolution, UI customization, and map options are now integrated into the main `fallout2.cfg` file (previously part of `f2_res.ini` from Mash's HRP).
|
||||
|
||||
Here are some important settings in `fallout2.cfg` under the `[screen]` and `[ui]` sections. See [the example config](https://github.com/fallout2-ce/fallout2-ce/tree/refs/heads/main/files/fallout2.cfg) for a full list of settings.
|
||||
|
||||
```ini
|
||||
[screen]
|
||||
resolution_x=1600 ; actual game window size (screen resolution), in pixels
|
||||
resolution_y=1080
|
||||
windowed=1 ; 0 = fullscreen
|
||||
scale=2 ; 1 = original scale, 2 = 2x scale, etc. (e.g. at scale 2 and screen resolution 1920x1080, in-game resolution will be 960x540, thus every pixel is twice as wide and tall)
|
||||
|
||||
[ui]
|
||||
; Maximum number of columns shown in the main inventory and loot/steal windows (valid range: 1..2)
|
||||
inventory_columns=2
|
||||
|
||||
; Set to 1 to expand the barter/trade window vertically, adding a 4th item slot per side (requires ce.dat)
|
||||
expand_barter_window=1
|
||||
|
||||
[qol]
|
||||
; Allow opening party member inventory from the long-press context menu.
|
||||
party_trade_from_menu=1
|
||||
|
||||
; Allow switching to companions' inventories in loot screens (and barter, in the future)
|
||||
party_loot_and_barter=1
|
||||
```
|
||||
|
||||
**Recommendations:**
|
||||
- **Desktops**: Use any size you see fit.
|
||||
- **Tablets**: Set these values to logical resolution of your device, for example iPad Pro 11 is 1668x2388 (pixels), but its logical resolution is 834x1194 (points).
|
||||
- **Mobile phones**: Set height to 480, calculate width according to your device screen (aspect) ratio, for example Samsung S21 is 20:9 device, so the width should be 480 * 20 / 9 = 1067.
|
||||
|
||||
In time this stuff will receive an in-game interface, right now you have to do it manually. To see all currently working fallout2.cfg settings, just run the game once and quit. It will be automatically updated with defaults for every supported setting.
|
||||
*Note*: Use of the IFACE_BAR settings requires the `f2_res.dat` file, which contains graphical assets. Various versions are available, but one compatible with the above settings can be found here: [f2_res.dat](https://github.com/fallout2-ce/fallout2-ce/raw/refs/heads/main/files/f2_res.dat)
|
||||
|
||||
## Platform-specific installation
|
||||
|
||||
### Windows
|
||||
|
||||
@@ -103,57 +187,6 @@ docker run --rm -v $(pwd):/src emscripten/emsdk:3.1.74 sh -c 'git config --globa
|
||||
```
|
||||
- Demo available at https://github.com/ololoken/fallout2-ce-ems.git
|
||||
|
||||
## Configuration
|
||||
|
||||
The main configuration file is `fallout2.cfg`. There are several important settings you might need to adjust for your installation. Depending on your Fallout distribution main game assets `master.dat`, `critter.dat`, `patch000.dat`, and `data` folder might be either all lowercased, or all uppercased. You can either update `master_dat`, `critter_dat`, `master_patches` and `critter_patches` settings to match your file names, or rename files to match entries in your `fallout2.cfg`.
|
||||
|
||||
The `sound` folder (with `music` folder inside) might be located either in `data` folder, or be in the Fallout folder. Update `music_path1` setting to match your hierarchy, usually it's `data/sound/music/` or `sound/music/`. Make sure it matches your path exactly (so it might be `SOUND/MUSIC/` if you've installed Fallout from CD). Music files themselves (with `ACM` extension) should be all uppercased, regardless of `sound` and `music` folders.
|
||||
|
||||
Additional settings for screen resolution, UI customization, and map options are now integrated into the main `fallout2.cfg` file (previously part of `f2_res.ini` from Mash's HRP). When Fallout 2 CE starts, if it detects an existing `f2_res.ini` file, it automatically migrates these settings into `fallout2.cfg`. After migration, `fallout2.cfg` becomes the single source of truth for this configuration.
|
||||
|
||||
Here are some important settings in `fallout2.cfg` under the `[screen]` and `[ui]` sections. See [the example config](https://github.com/fallout2-ce/fallout2-ce/tree/refs/heads/main/files/fallout2.cfg) for a full list of settings.
|
||||
|
||||
```ini
|
||||
[screen]
|
||||
resolution_x=1600 ; actual game window size (screen resolution), in pixels
|
||||
resolution_y=1080
|
||||
windowed=1 ; 0 = fullscreen
|
||||
scale=2 ; 1 = original scale, 2 = 2x scale, etc. (e.g. at scale 2 and screen resolution 1920x1080, in-game resolution will be 960x540, thus every pixel is twice as wide and tall)
|
||||
|
||||
[ui]
|
||||
;Set to 1 to expand the barter/trade window vertically, adding a 4th item slot per side (requires ce.dat)
|
||||
expand_barter_window=1
|
||||
;Maximum number of columns shown in the main inventory and loot/steal windows (valid range: 1..2)
|
||||
inventory_columns=2
|
||||
splash_screen_size=1 ; Splash screen scaling (0=original size, 1=fit preserving aspect, 2=stretch to fill)
|
||||
quick_toolbar_visible=0 ; Skills quick access toolbar visibility (iOS only) (0=hidden, 1=visible)
|
||||
```
|
||||
|
||||
**Recommendations:**
|
||||
- **Desktops**: Use any size you see fit.
|
||||
- **Tablets**: Set these values to logical resolution of your device, for example iPad Pro 11 is 1668x2388 (pixels), but it's logical resolution is 834x1194 (points).
|
||||
- **Mobile phones**: Set height to 480, calculate width according to your device screen (aspect) ratio, for example Samsung S21 is 20:9 device, so the width should be 480 * 20 / 9 = 1067.
|
||||
|
||||
In time this stuff will receive in-game interface, right now you have to do it manually. To see all currently working fallout2.cfg settings, just run the game once and quit. It will be automatically updated with defaults for every supported setting.
|
||||
*Note*: Use of the IFACE_BAR settings requires the `f2_res.dat` file, which contains graphical assets. Various versions are available, but one compatible with the above settings can be found here: [f2_res.dat](https://github.com/fallout2-ce/fallout2-ce/raw/refs/heads/main/files/f2_res.dat)
|
||||
|
||||
## Quality of life benefits over vanilla Fallout
|
||||
|
||||
* High resolution support
|
||||
* Expanded 2-column inventory
|
||||
* Expanded 4-row barter screen
|
||||
* Expanded AP bar
|
||||
* Party members can loot and barter in place of PC
|
||||
* Increased pathfinding nodes 5x for more accurate pathfinding, and use accurate path length for walk vs run
|
||||
* Ctrl-click to quickly move items when bartering, looting, or stealing
|
||||
* _a_ to select "all" when selecting item quantity, and for `Take All` when looting
|
||||
* When bartering, caps default to the right amount to balance the trade
|
||||
* Music continues playing between maps
|
||||
* Auto open doors
|
||||
* Integrated "HELP" menu
|
||||
* 44.1 kHz stereo sound/music supported, in .ogg and .wav format as well as legacy .acm
|
||||
* Last used save slot is remembered
|
||||
* Item/Corpse/Container/Critter highlighting (configure using [mods/sfall-mods.ini](https://github.com/sfall-team/sfall/blob/master/artifacts/config_files/sfall-mods.ini))
|
||||
|
||||
## Contributing
|
||||
|
||||
|
||||
+15
-3
@@ -38,6 +38,18 @@ The following settings were moved into [`fallout2.cfg`](files/fallout2.cfg) inst
|
||||
| `Misc` | `UseWalkDistance` | `qol` | `use_walk_distance` |
|
||||
| `Misc` | `AutoOpenDoors` | `qol` | `auto_open_doors` |
|
||||
|
||||
The following settings were moved into [`<DAT>/config/game.cfg`](files/ce.dat/config/game.cfg):
|
||||
|
||||
| ddraw.ini section | ddraw.ini key | game.cfg section | game.cfg key |
|
||||
| --- | --- | --- | --- |
|
||||
| `Misc` | `StartingMap` | `start` | `map` |
|
||||
| `Misc` | `StartXPos` | `start` | `worldmap_x` |
|
||||
| `Misc` | `StartYPos` | `start` | `worldmap_y` |
|
||||
| `Misc` | `ViewXPos` | `start` | `worldmap_view_x` |
|
||||
| `Misc` | `ViewYPos` | `start` | `worldmap_view_y` |
|
||||
| `Misc` | `StartGDialogFix` | `dialog` | `start_gdialog_fix` |
|
||||
| `Misc` | `DisableSpecialMapIDs` | `maps` | `disable_special_map_ids` |
|
||||
|
||||
## Opcodes / Metarules
|
||||
|
||||
See [`https://sfall-team.github.io/sfall/`](https://sfall-team.github.io/sfall/) for documentation on specific functions.
|
||||
@@ -53,7 +65,7 @@ See [`https://sfall-team.github.io/sfall/`](https://sfall-team.github.io/sfall/)
|
||||
| Perks and traits | set_perk_image<br>set_perk_*<br>set_pyromaniac_mod<br>apply_heaveho_fix<br>set_swiftlearner_mod<br>has/set_fake_perk<br>has/set_fake_trait<br>set_selectable_perk<br>set_perkbox_title<br>show/hide_real_perks<br>perk_add_mode<br>clear_selectable_perks<br>add/remove_trait<br>seq_perk_freq | not implemented | - |
|
||||
| Virtual file system | fs_create<br>fs_copy<br>fs_find<br>fs_read/write_*<br>fs_delete<br>fs_size<br>fs_pos<br>fs_seek<br>fs_resize | đźš« | Open an issue if you have a use case for these |
|
||||
| Combat / Knockback | set_weapon_knockback<br>set_target_knockback<br>set_attacker_knockback<br>remove_weapon_knockback<br>remove_target_knockback<br>remove_attacker_knockback | not implemented | - |
|
||||
| Maps and encounters | in_world_map<br>force_encounter{_with_flags}<br>set_map_time_multi<br>get/set_map_enter_position<br>exec_map_update_scripts<br>get/set_terrain_name<br>set_town_title<br>get/set_can_rest_on_map<br>set_rest_heal_time<br>set_rest_mode<br>set_worldmap_heal_time | implemented: in_world_map, force_encounter, force_encounter_with_flags, set_map_time_multi | - |
|
||||
| Maps and encounters | in_world_map<br>force_encounter{_with_flags}<br>set_map_time_multi<br>get/set_map_enter_position<br>exec_map_update_scripts<br>get/set_terrain_name<br>set_town_title<br>get/set_can_rest_on_map<br>set_rest_heal_time<br>set_rest_mode<br>set_worldmap_heal_time | implemented: in_world_map, force_encounter, force_encounter_with_flags, set_map_time_multi, get_terrain_name, set_terrain_name | - |
|
||||
| Maps and encounters / Worldmap | get_world_map_x/y_pos<br>set_world_map_pos | âś… | - |
|
||||
| Audio | play_sfall_sound<br>stop_sfall_sound | âś… | `play_sfall_sound` currently supports `.acm`, `.wav`, `.ogg` formats, and can load from `.dat` archives. `.mp3` is not yet supported. |
|
||||
| Combat / Weapons and ammo | get/set_weapon_ammo_pid<br>get/set_weapon_ammo_count | âś… | - |
|
||||
@@ -82,7 +94,7 @@ See [`https://sfall-team.github.io/sfall/`](https://sfall-team.github.io/sfall/)
|
||||
| Interface / Cursor | get/set_cursor_mode | âś… | - |
|
||||
| Locks | lock_is_jammed<br>unjam_lock<br>set_unjam_locks_time | not implemented | - |
|
||||
| INI settings | get_ini_setting<br>get_ini_string<br>get_ini_section<br>get_ini_sections<br>get_ini_config<br>get_ini_config_db<br>set_ini_setting | âś… | `modified_ini` is intentionally omitted as deprecated. |
|
||||
| Objects and scripts | set_self<br>set_dude_obj<br>real_dude_obj<br>remove_script<br>get/set_script<br>obj_is_carrying_obj<br>loot_obj<br>dialog_obj<br>obj_under_cursor<br>get/set_object_data<br>get/set_flags<br>set_unique_id<br>set_scr_name<br>obj_is_openable<br>get/set_proto_data<br>get_object_ai_data | implemented: set_self, get/set/remove_script, obj_is_carrying_obj, loot_obj, dialog_obj, obj_under_cursor, get_object_data, get_flags, set_flags, set_unique_id, obj_is_openable, get_proto_data, set_proto_data | - |
|
||||
| Objects and scripts | set_self<br>set_dude_obj<br>real_dude_obj<br>remove_script<br>get/set_script<br>obj_is_carrying_obj<br>loot_obj<br>dialog_obj<br>obj_under_cursor<br>get/set_object_data<br>get/set_flags<br>set_unique_id<br>set_scr_name<br>obj_is_openable<br>get/set_proto_data<br>get_object_ai_data | âś… except set_dude_obj, set_scr_name | `get/set_object_data` maps supported object and `C_ATTACK_*` offsets instead of exposing arbitrary raw memory offsets. |
|
||||
| Other / Game management | set_movie_path<br>stop/resume_game<br>mark_movie_played<br>game_loaded<br>get_game_mode<br>get_uptime<br>signal_close_game | implemented: game_loaded, get_game_mode, get_uptime, signal_close_game | - |
|
||||
| Gameplay tweaks | set_pickpocket_max<br>set_hit_chance_max<br>set_xp_mod<br>set_critter_hit_chance_mod<br>set_base_hit_chance_mod<br>set_hp_per_level_mod<br>gdialog_get_barter_mod<br>get/set_unspent_ap_bonus<br>get/set_unspent_ap_perk_bonus<br>set_base_pickpocket_mod<br>set_critter_pickpocket_mod<br>get/set_inven_ap_cost<br>set_drugs_data<br>get_kill_counter<br>mod_kill_counter<br>set_pipboy_available | implemented: gdialog_get_barter_mod, get/set_unspent_ap{_perk}_bonus, get/set_inven_ap_cost | - |
|
||||
| NPCs | inc_npc_level<br>get_npc_level<br>npc_engine_level_up | not implemented | - |
|
||||
@@ -104,7 +116,7 @@ See [`https://sfall-team.github.io/sfall/`](https://sfall-team.github.io/sfall/)
|
||||
| FindTarget | `HOOK_FINDTARGET` | đźš« | (maybe) |
|
||||
| UseObjOn | `HOOK_USEOBJON` | âś… | - |
|
||||
| UseObj | `HOOK_USEOBJ` | âś… | CE notes an sfall-matching inconsistency around return code `2` behavior between interface contexts. |
|
||||
| RemoveInvenObj | `HOOK_REMOVEINVENOBJ` | đźš« | - |
|
||||
| RemoveInvenObj | `HOOK_REMOVEINVENOBJ` | âś… | - |
|
||||
| BarterPrice | `HOOK_BARTERPRICE` | âś… | - |
|
||||
| ItemDamage | `HOOK_ITEMDAMAGE` | âś… | - |
|
||||
| MoveCost | `HOOK_MOVECOST` | âś… | - |
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 301 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 303 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 381 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 157 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 6.4 KiB |
@@ -11,6 +11,12 @@ month=6
|
||||
day=24
|
||||
; To start a new game somewhere other than artemple.map, set this to the map file name.
|
||||
map=
|
||||
; Starting worldmap marker position. -1 uses the starting map's world area.
|
||||
worldmap_x=-1
|
||||
worldmap_y=-1
|
||||
; Starting worldmap viewport position. -1 uses the default upper-left view.
|
||||
worldmap_view_x=-1
|
||||
worldmap_view_y=-1
|
||||
; Starting (tribal) and default (jumpsuit) player models. Can also be changed in-game via script.
|
||||
model_male=hmwarr
|
||||
model_male_default=hmjmps
|
||||
@@ -20,6 +26,11 @@ model_female_default=hfjmps
|
||||
; Set to 2 to make the pipboy available by only skipping the vault suit movie check.
|
||||
pipboy=0
|
||||
|
||||
[maps]
|
||||
; Set to 1 to apply transition tile, elevation, and rotation overrides on all maps,
|
||||
; including Fallout 2 map IDs 19 and 37.
|
||||
disable_special_map_ids=0
|
||||
|
||||
[karma]
|
||||
; FRM numbers for karma icons on the character screen. Number of points entries should be 1 less than number of frms entries.
|
||||
; Example: frms=47,48,49 points=-100,100
|
||||
@@ -38,6 +49,9 @@ no_exit_hotkey=1
|
||||
; Set to 1 to allow using '^' in dialog msg files to specify gender-based alternative text.
|
||||
; Text must be enclosed in angle brackets, e.g. <MaleText^FemaleText>.
|
||||
gender_words=0
|
||||
; Set to 1 to enable the sfall StartGDialogFix behavior: talking-head dialogs honor the start_gdialog mood argument unless it is -1.
|
||||
; When set to 0, CE still applies sfall's crash fix for calling start_gdialog outside talk_p_proc.
|
||||
start_gdialog_fix=0
|
||||
|
||||
[main_menu]
|
||||
; Custom version string shown on the main menu. Supports up to two %d placeholders for the game version numbers.
|
||||
|
||||
+74
-29
@@ -1,3 +1,6 @@
|
||||
; This is an example configuration for Fallout CE. If you'd like to use the recommended settings without
|
||||
; disturbing your game config, copy everything from [ui] and [qol] into your fallout2.cfg
|
||||
|
||||
[debug]
|
||||
;Set this to a valid path to save a copy of the console contents
|
||||
console_output_path=
|
||||
@@ -48,15 +51,20 @@ text_line_delay=2.000000
|
||||
violence_level=3
|
||||
|
||||
[screen]
|
||||
resolution_x=640
|
||||
; Physical screen resolution of the full screen or window.
|
||||
resolution_x=800
|
||||
resolution_y=480
|
||||
; Scale of physical pixels to logical pixels. For instance, if x/y is 1280 x 960 and scale is 2,
|
||||
; the game will be rendered at 640 x 480 and then scaled up to 1280 x 960. This is useful for windowed mode on high DPI displays.
|
||||
scale=1
|
||||
; Set to 1 to run the game in windowed mode. Set to 0 to run in fullscreen mode.
|
||||
windowed=1
|
||||
|
||||
[sound]
|
||||
cache_size=448
|
||||
debug=1
|
||||
debug_sfxc=1
|
||||
; Set to 1 to avoid restarting music when changing maps when the music is the same track.
|
||||
gapless_music=1
|
||||
initialize=1
|
||||
master_volume=22281
|
||||
@@ -70,7 +78,7 @@ speech=1
|
||||
speech_volume=22281
|
||||
|
||||
[system]
|
||||
art_cache_size=8
|
||||
art_cache_size=32
|
||||
color_cycling=1
|
||||
critter_dat=critter.dat
|
||||
critter_patches=data
|
||||
@@ -87,60 +95,97 @@ scroll_lock=0
|
||||
splash=5
|
||||
|
||||
[ui]
|
||||
;Speed up or slow down all UI animations such as screen fade, dialog window show/hide, AC numbers roll, etc.
|
||||
; Speed up or slow down all UI animations such as screen fade, dialog window show/hide, AC numbers roll, etc.
|
||||
anim_speed=2.000000
|
||||
;To use more than one save slot for quick saving (F6 key) without picking a slot beforehand
|
||||
;Quick save will cyclically overwrite saves from the first slot on the specified page to the last slot on the n-th page
|
||||
;auto_quick_save sets how many pages you want to use for quick saving (valid range: 1..10)
|
||||
;Set to 0 to disable
|
||||
|
||||
; To use more than one save slot for quick saving (F6 key) without picking a slot beforehand
|
||||
; Quick save will cyclically overwrite saves from the first slot on the specified page to the last slot on the n-th page
|
||||
; auto_quick_save sets how many pages you want to use for quick saving (valid range: 1..10)
|
||||
; Set to 0 to disable
|
||||
auto_quick_save=3
|
||||
;Set to 1 to display additional points of damage from Bonus HtH/Ranged Damage perks in the inventory
|
||||
|
||||
; Set to 1 to display additional points of damage from Bonus HtH/Ranged Damage perks in the inventory
|
||||
display_bonus_damage=1
|
||||
;Set to 1 to get notification of karma changes in the notification window
|
||||
|
||||
; Set to 1 to get notification of karma changes in the notification window
|
||||
display_karma_changes=0
|
||||
;Set to 1 to use the hi-res dialog border/background at resolutions above 640x480. Requires art\intrface\HR_ALLTLK.FRM (for example from f2_res.dat)
|
||||
|
||||
; Set to 1 to use the hi-res dialog border/background at resolutions above 640x480. Requires art\intrface\HR_ALLTLK.FRM (for example from f2_res.dat)
|
||||
dialog_border=1
|
||||
;Set to one to hide areas outside map bounds when using higher than 640x480 resolution, and to zero to disable
|
||||
|
||||
; Set to one to hide areas outside map bounds when using higher than 640x480 resolution, and to zero to disable
|
||||
enable_high_resolution_stencil=1
|
||||
;Set to 1 to extend the action points bar to show up to 16 AP instead of 10 (requires iface_apbar_e.frm)
|
||||
extend_ap_bar=0
|
||||
;Set to 1 to expand the barter/trade window vertically, adding a 4th item slot per side (requires barter_e.frm, trade_e.frm, and a screen height of at least 528 pixels)
|
||||
expand_barter_window=0
|
||||
|
||||
; Set to 1 to extend the action points bar to show up to 16 AP instead of 10 (requires iface_apbar_e.frm)
|
||||
extend_ap_bar=1
|
||||
|
||||
; Set to 1 to expand the barter/trade window vertically, adding a 4th item slot per side (requires barter_e.frm, trade_e.frm, and a screen height of at least 528 pixels)
|
||||
expand_barter_window=1
|
||||
|
||||
; if iface_bar_mode=0 - the bottom of the map view window sits at the top of the IFACE Bar.
|
||||
; if iface_bar_mode=1 - the bottom of the map view window extends to the base of the screen and is overlapped by the IFACE Bar.
|
||||
iface_bar_mode=0
|
||||
; 0 = no side art, 1 = metal, 2 = leather, 3-6 = alternative metal, 7 = alternative leather, 8 = brown metal
|
||||
iface_bar_side_art=2
|
||||
; 0 = Iface-bar side graphics extend from the Iface-Bar to the Screen edges.
|
||||
; 1 = Iface-bar side graphics extend from the Screen edges to the Iface-Bar
|
||||
iface_bar_sides_ori=0
|
||||
; Set to 640 to use the original interface bar width, or 800 to use the 800pix wide asset from f2_res.dat.
|
||||
iface_bar_width=800
|
||||
;Whether to load EDG files (HRP format) when loading maps. If loaded, they override default edge clipping and scroll blocking behavior.
|
||||
|
||||
; Whether to load EDG files (HRP format) when loading maps. If loaded, they override default edge clipping and scroll blocking behavior.
|
||||
edg_support=1
|
||||
ignore_map_edges=0
|
||||
;Set to 1 to display numbered dialogue options
|
||||
|
||||
; Set to 1 to display numbered dialogue options
|
||||
numbers_in_dialogue=0
|
||||
;Set to 1 to skip the 3 opening movies
|
||||
;Set to 2 to also skip the splash screen
|
||||
|
||||
; Set to 1 to skip the 3 opening movies
|
||||
; Set to 2 to also skip the splash screen
|
||||
skip_opening_movies=0
|
||||
|
||||
; Set to 1 to scale the splash screen to fit the screen while preserving aspect ratio.
|
||||
; Set to 2 to fill the screen
|
||||
splash_screen_size=1
|
||||
;Set to 1 to scale movies to fit the screen while preserving aspect ratio.
|
||||
;Set to 0 to keep movies at their native size, centered on screen.
|
||||
|
||||
; Set to 1 to scale movies to fit the screen while preserving aspect ratio.
|
||||
; Set to 0 to keep movies at their native size, centered on screen.
|
||||
movie_aspect_fit=1
|
||||
;Maximum number of columns shown in the main inventory and loot/steal windows (valid range: 1..2)
|
||||
;2-column Loot/steal window requires minimum screen width of 673px
|
||||
|
||||
; Maximum number of columns shown in the main inventory and loot/steal windows (valid range: 1..2)
|
||||
; 2-column Loot/steal window requires minimum screen width of 673px.
|
||||
; This also enables npc equipment management on the loot screen
|
||||
inventory_columns=2
|
||||
|
||||
;Set to 0 to keep the main menu art and controls at native size.
|
||||
;Set to 1 to scale only the main menu background image to fit the screen while maintaining aspect ratio.
|
||||
;Set to 2 to also scale the main menu button panel, red buttons, and button labels with the menu art.
|
||||
; Set to 0 to keep the main menu art and controls at native size.
|
||||
; Set to 1 to scale only the main menu background image to fit the screen while maintaining aspect ratio.
|
||||
; Set to 2 to also scale the main menu button panel, red buttons, and button labels with the menu art.
|
||||
main_menu_scale_mode=1
|
||||
;Set to 1 to show a Help option in the in-game options menu which opens the F1 help screen.
|
||||
|
||||
; Set to 1 to show a Help option in the in-game options menu which opens the F1 help screen.
|
||||
in_game_menu_help=1
|
||||
|
||||
; Weight/size indicator for PC, critters and containers
|
||||
; Set to 0 for vanilla behavior (no weight indicator)
|
||||
; Set to 1 to show a simple weight indicator; works with all inventory_columns values
|
||||
; Set to 2 to show a detailed weight indicator; works with inventory_columns > 1 only
|
||||
loot_weight_indicator=1
|
||||
|
||||
; Set to 0 to show container indicator at all times
|
||||
; Set to XX to show container indicator when size reaches XX%
|
||||
; Set to 100 to show container indicator when full
|
||||
loot_container_size_indicator_threshold=50
|
||||
|
||||
[qol]
|
||||
; Automatically open doors that are unlocked and has no script attached.
|
||||
auto_open_doors=0
|
||||
|
||||
; Overrides distance at which walk animation is used when using an object. 0 disables walking
|
||||
; This is the number of empty tiles between the player and the target
|
||||
; This is the number of empty tiles between the player and the target. 3 is the default
|
||||
use_walk_distance=3
|
||||
; Allow opening party member inventory from the long-press world menu.
|
||||
|
||||
; Allow opening party member inventory from the long-press context menu.
|
||||
party_trade_from_menu=1
|
||||
|
||||
; Allow switching to companions' inventories in loot screens (and barter, in the future)
|
||||
party_loot_and_barter=1
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
#include "test_utils.h"
|
||||
#include "sfall.h"
|
||||
|
||||
procedure start begin
|
||||
variable defaultName;
|
||||
|
||||
display_msg("Testing terrain name metarules...");
|
||||
|
||||
call assertEquals("get metarule exists", metarule_exist("get_terrain_name"), 1);
|
||||
call assertEquals("set metarule exists", metarule_exist("set_terrain_name"), 1);
|
||||
|
||||
defaultName := get_terrain_name(0, 0);
|
||||
call assertNotEquals("default terrain name is not error", defaultName, "Error");
|
||||
call assertNotEquals("default terrain name is not empty", defaultName, "");
|
||||
|
||||
set_terrain_name(0, 0, "CE Terrain Override");
|
||||
call assertEquals("terrain override is returned", get_terrain_name(0, 0), "CE Terrain Override");
|
||||
|
||||
set_terrain_name(0, 0, "CE Terrain Override 2");
|
||||
call assertEquals("latest terrain override wins", get_terrain_name(0, 0), "CE Terrain Override 2");
|
||||
call assertEquals("one argument get returns error", sfall_func1("get_terrain_name", 0), -1);
|
||||
call assertEquals("invalid get returns error", get_terrain_name(-1, 0), "Error");
|
||||
call assertNotEquals("current terrain name is available", get_current_terrain_name, "Error");
|
||||
|
||||
call report_test_results("terrain_name");
|
||||
signal_close_game;
|
||||
end
|
||||
@@ -1,5 +1,6 @@
|
||||
#include "lib.arrays.h" // For arrays_equal, len_array, etc.
|
||||
#include "test_utils.h" // For assertEquals, VALTYPE_STR, report_test_results
|
||||
#include "sfall.h"
|
||||
|
||||
// To test: copy test.ini into the game folder before running
|
||||
procedure ini_test_suite begin
|
||||
@@ -29,6 +30,15 @@ procedure ini_test_suite begin
|
||||
call assertEquals("TC2 get_ini_setting empty int", get_ini_setting("test.ini|ValidSection|EmptyValue"), 0);
|
||||
call assertEquals("TC2 get_ini_string empty string", get_ini_string("test.ini|ValidSection|EmptyValue"), "");
|
||||
|
||||
// Regression: sfall resolves leading-backslash paths relative to the game root.
|
||||
result_array := get_ini_section("\\test.ini", "ValidSection");
|
||||
call assertEquals("TC2B Size", len_array(result_array), 3);
|
||||
call assertEquals("TC2B Key1", result_array["Key1"], "Value1");
|
||||
call assertEquals("TC2B get_ini_setting int", get_ini_setting("\\test.ini|ValidSection|Key2"), 2);
|
||||
call assertEquals("TC2B get_ini_string string", get_ini_string("\\test.ini|ValidSection|Key1"), "Value1");
|
||||
result_array := get_ini_sections("\\test.ini");
|
||||
call assertEquals("TC2B get_ini_sections size", len_array(result_array), 3);
|
||||
|
||||
// INI file not found
|
||||
result_array := get_ini_section("nonexistent.ini", "AnySection");
|
||||
call assertEquals("TC3 Size", len_array(result_array), 0);
|
||||
|
||||
@@ -21,10 +21,11 @@ procedure start begin
|
||||
call assertEquals("opcode_exists OP_NOOP", opcode_exists(OP_NOOP), 1);
|
||||
// Probably will never be implemented on fallout2-ce
|
||||
call assertEquals("opcode_exists OP_WRITE_INT", opcode_exists(OP_WRITE_INT), 0);
|
||||
call assertEquals("opcode_exists bare index", opcode_exists(0x1B3), 0);
|
||||
call assertEquals("opcode_exists 0xFFFF", opcode_exists(0xFFFF), 0);
|
||||
end else begin
|
||||
display_msg("Opcode exists metarule is not available, skipping tests.");
|
||||
end
|
||||
|
||||
call report_test_results("metarule_exist");
|
||||
end
|
||||
end
|
||||
|
||||
@@ -0,0 +1,96 @@
|
||||
#include "sfall.h"
|
||||
#include "dik.h"
|
||||
#include "define_lite.h"
|
||||
#include "define_extra.h"
|
||||
#include "../test_utils.h"
|
||||
|
||||
#define DAMAGE_TARGET_OVERRIDE 13
|
||||
#define DAMAGE_SOURCE_OVERRIDE 7
|
||||
#define FLAGS_SOURCE_OVERRIDE DAM_HIT
|
||||
#define KNOCKBACK_OVERRIDE 2
|
||||
#define TEST_LIGHT_DISTANCE 3
|
||||
#define TEST_LIGHT_INTENSITY 0x10000
|
||||
|
||||
variable object_data_attack_hook_seen := false;
|
||||
variable object_data_attack_reported := false;
|
||||
|
||||
procedure object_data_roundtrip_test begin
|
||||
variable old_light_distance := get_object_data(dude_obj, OBJ_DATA_LIGHT_DISTANCE);
|
||||
variable old_light_intensity := get_object_data(dude_obj, OBJ_DATA_LIGHT_INTENSITY);
|
||||
|
||||
set_object_data(dude_obj, OBJ_DATA_LIGHT_DISTANCE, TEST_LIGHT_DISTANCE);
|
||||
set_object_data(dude_obj, OBJ_DATA_LIGHT_INTENSITY, TEST_LIGHT_INTENSITY);
|
||||
|
||||
call assertEquals("object light distance set", get_object_data(dude_obj, OBJ_DATA_LIGHT_DISTANCE), TEST_LIGHT_DISTANCE);
|
||||
call assertEquals("object light intensity set", get_object_data(dude_obj, OBJ_DATA_LIGHT_INTENSITY), TEST_LIGHT_INTENSITY);
|
||||
|
||||
set_object_data(dude_obj, OBJ_DATA_LIGHT_DISTANCE, old_light_distance);
|
||||
set_object_data(dude_obj, OBJ_DATA_LIGHT_INTENSITY, old_light_intensity);
|
||||
|
||||
call assertEquals("object light distance restored", get_object_data(dude_obj, OBJ_DATA_LIGHT_DISTANCE), old_light_distance);
|
||||
call assertEquals("object light intensity restored", get_object_data(dude_obj, OBJ_DATA_LIGHT_INTENSITY), old_light_intensity);
|
||||
end
|
||||
|
||||
procedure report_object_data_attack_results begin
|
||||
if (object_data_attack_reported) then return;
|
||||
object_data_attack_reported := true;
|
||||
|
||||
call report_test_results("object_data_attack");
|
||||
end
|
||||
|
||||
procedure combatdamage_handler begin
|
||||
variable target := get_sfall_arg_at(0);
|
||||
variable attacker := get_sfall_arg_at(1);
|
||||
variable attack_data := get_sfall_arg_at(12);
|
||||
|
||||
object_data_attack_hook_seen := true;
|
||||
|
||||
call assertTrue("attack data pointer exists", attack_data != 0);
|
||||
call assertEquals("attack source matches hook attacker", get_object_data(attack_data, C_ATTACK_SOURCE), attacker);
|
||||
call assertEquals("attack target matches hook target", get_object_data(attack_data, C_ATTACK_TARGET), target);
|
||||
call assertEquals("combat_data returns same attack data", combat_data, attack_data);
|
||||
|
||||
set_object_data(attack_data, C_ATTACK_DAMAGE_TARGET, DAMAGE_TARGET_OVERRIDE);
|
||||
set_object_data(attack_data, C_ATTACK_DAMAGE_SOURCE, DAMAGE_SOURCE_OVERRIDE);
|
||||
set_object_data(attack_data, C_ATTACK_FLAGS_SOURCE, FLAGS_SOURCE_OVERRIDE);
|
||||
set_object_data(attack_data, C_ATTACK_KNOCKBACK_VALUE, KNOCKBACK_OVERRIDE);
|
||||
|
||||
call assertEquals("attack target damage set", get_object_data(attack_data, C_ATTACK_DAMAGE_TARGET), DAMAGE_TARGET_OVERRIDE);
|
||||
call assertEquals("attack source damage set", get_object_data(attack_data, C_ATTACK_DAMAGE_SOURCE), DAMAGE_SOURCE_OVERRIDE);
|
||||
call assertEquals("attack source flags set", get_object_data(attack_data, C_ATTACK_FLAGS_SOURCE), FLAGS_SOURCE_OVERRIDE);
|
||||
call assertEquals("attack knockback set", get_object_data(attack_data, C_ATTACK_KNOCKBACK_VALUE), KNOCKBACK_OVERRIDE);
|
||||
|
||||
set_sfall_return(DAMAGE_TARGET_OVERRIDE);
|
||||
set_sfall_return(DAMAGE_SOURCE_OVERRIDE);
|
||||
set_sfall_return(get_object_data(attack_data, C_ATTACK_FLAGS_TARGET));
|
||||
set_sfall_return(FLAGS_SOURCE_OVERRIDE);
|
||||
set_sfall_return(KNOCKBACK_OVERRIDE);
|
||||
|
||||
call report_object_data_attack_results();
|
||||
end
|
||||
|
||||
procedure keypress_handler begin
|
||||
variable
|
||||
pressed := get_sfall_arg_at(0),
|
||||
key := get_sfall_arg_at(1);
|
||||
|
||||
if (not pressed) then return;
|
||||
if (key != DIK_J) then return;
|
||||
|
||||
if (not object_data_attack_hook_seen) then begin
|
||||
display_msg("object_data_attack: enter combat and hit something to trigger HOOK_COMBATDAMAGE.");
|
||||
end else begin
|
||||
call report_object_data_attack_results();
|
||||
end
|
||||
end
|
||||
|
||||
procedure start begin
|
||||
if (not game_loaded) then return;
|
||||
|
||||
display_msg("Testing get/set_object_data object fields...");
|
||||
call object_data_roundtrip_test();
|
||||
|
||||
display_msg("object_data_attack ready: enter combat and hit something. Press J to repeat instructions.");
|
||||
register_hook_proc(HOOK_KEYPRESS, keypress_handler);
|
||||
register_hook_proc(HOOK_COMBATDAMAGE, combatdamage_handler);
|
||||
end
|
||||
+9
-9
@@ -97,7 +97,7 @@ static int _compute_explosion_damage(int min, int max, Object* defender, int* kn
|
||||
static int _can_talk_to(Object* obj, Object* critter);
|
||||
static int _talk_to(Object* _, Object* critter);
|
||||
static int _report_dmg(Attack* attack, Object* _);
|
||||
static int _compute_dmg_damage(int min, int max, Object* obj, int* knockbackDistancePtr, int damageType);
|
||||
static int _compute_dmg_damage(int min, int max, Object* obj, int* knockbackDistancePtr, DamageType damageType);
|
||||
|
||||
static int hideProjectile(void* _, void* projectile);
|
||||
|
||||
@@ -200,7 +200,7 @@ int pickDeathAnim(Object* attacker, Object* defender, Object* weapon, int damage
|
||||
int normalViolenceLevelDamageThreshold = 15;
|
||||
int maximumBloodViolenceLevelDamageThreshold = 45;
|
||||
|
||||
int damageType = weaponGetDamageType(attacker, weapon);
|
||||
DamageType damageType = weaponGetDamageType(attacker, weapon);
|
||||
|
||||
if (weapon != nullptr && weapon->pid == PROTO_ID_MOLOTOV_COCKTAIL) {
|
||||
normalViolenceLevelDamageThreshold = 5;
|
||||
@@ -729,7 +729,7 @@ int _action_ranged(Attack* attack, int anim)
|
||||
|
||||
weaponGetRange(attack->attacker, attack->hitMode);
|
||||
|
||||
int damageType = weaponGetDamageType(attack->attacker, attack->weapon);
|
||||
DamageType damageType = weaponGetDamageType(attack->attacker, attack->weapon);
|
||||
|
||||
tileGetTileInDirection(attack->attacker->tile, attack->attacker->rotation, 1);
|
||||
|
||||
@@ -773,7 +773,7 @@ int _action_ranged(Attack* attack, int anim)
|
||||
int rightItemAction;
|
||||
interfaceGetItemActions(&leftItemAction, &rightItemAction);
|
||||
|
||||
itemRemove(attack->attacker, weapon, 1);
|
||||
itemRemoveWithReason(attack->attacker, weapon, 1, RemoveInventoryObjectHookReason::Throw);
|
||||
replacedWeapon = itemReplace(attack->attacker, weapon, weaponFlags & OBJECT_IN_ANY_HAND);
|
||||
objectSetFid(projectile, projectileProto->fid, nullptr);
|
||||
_cAIPrepWeaponItem(attack->attacker, weapon);
|
||||
@@ -1306,7 +1306,7 @@ int actionLootCritter(Object* critter, Object* target)
|
||||
}
|
||||
|
||||
// 0x4124E0
|
||||
int _action_skill_use(int skill)
|
||||
int _action_skill_use(Skill skill)
|
||||
{
|
||||
if (skill == SKILL_SNEAK) {
|
||||
reg_anim_clear(gDude);
|
||||
@@ -1336,7 +1336,7 @@ static int _action_use_skill_in_combat_error(Object* critter)
|
||||
|
||||
// skill_use
|
||||
// 0x41255C
|
||||
int actionUseSkill(Object* user, Object* target, int skill)
|
||||
int actionUseSkill(Object* user, Object* target, Skill skill)
|
||||
{
|
||||
UseSkillOnHookResult hookResult = scriptHooks_UseSkillOn(&user, target, skill);
|
||||
if (!hookResult.shouldContinue) {
|
||||
@@ -1477,7 +1477,7 @@ int actionUseSkill(Object* user, Object* target, int skill)
|
||||
char* msg = skillsGetGenericResponse(partyMember, isDude);
|
||||
|
||||
Rect rect;
|
||||
if (textObjectAdd(partyMember, msg, 101, _colorTable[32747], _colorTable[0], &rect) == 0) {
|
||||
if (textObjectAdd(partyMember, msg, 101, COLOR_LIGHT_YELLOW, COLOR_BLACK, &rect) == 0) {
|
||||
tileWindowRefreshRect(&rect, gElevation);
|
||||
}
|
||||
|
||||
@@ -1907,7 +1907,7 @@ int _talk_to(Object* _, Object* critter)
|
||||
}
|
||||
|
||||
// 0x413494
|
||||
void actionDamage(int tile, int elevation, int minDamage, int maxDamage, int damageType, bool animated, bool bypassArmor)
|
||||
void actionDamage(int tile, int elevation, int minDamage, int maxDamage, DamageType damageType, bool animated, bool bypassArmor)
|
||||
{
|
||||
Attack* attack = (Attack*)internal_malloc(sizeof(*attack));
|
||||
if (attack == nullptr) {
|
||||
@@ -1988,7 +1988,7 @@ int _report_dmg(Attack* attack, Object* _)
|
||||
// Calculate damage by applying threshold and resistances.
|
||||
//
|
||||
// 0x413660
|
||||
int _compute_dmg_damage(int min, int max, Object* obj, int* knockbackDistancePtr, int damageType)
|
||||
int _compute_dmg_damage(int min, int max, Object* obj, int* knockbackDistancePtr, DamageType damageType)
|
||||
{
|
||||
if (!critterFlagCheck(obj->pid, CRITTER_NO_KNOCKBACK)) {
|
||||
knockbackDistancePtr = nullptr;
|
||||
|
||||
+5
-3
@@ -3,6 +3,8 @@
|
||||
|
||||
#include "combat_defs.h"
|
||||
#include "obj_types.h"
|
||||
#include "proto_types.h"
|
||||
#include "skill_defs.h"
|
||||
|
||||
namespace fallout {
|
||||
|
||||
@@ -13,14 +15,14 @@ int _action_use_an_item_on_object(Object* user, Object* targetObj, Object* item)
|
||||
int _action_use_an_object(Object* user, Object* targetObj);
|
||||
int actionPickUp(Object* critter, Object* item);
|
||||
int actionLootCritter(Object* critter, Object* target);
|
||||
int _action_skill_use(int skill);
|
||||
int actionUseSkill(Object* user, Object* target, int skill);
|
||||
int _action_skill_use(Skill skill);
|
||||
int actionUseSkill(Object* user, Object* target, Skill skill);
|
||||
bool _is_hit_from_front(const Object* attacker, const Object* defender);
|
||||
bool _can_see(Object* source, Object* target);
|
||||
bool _action_explode_running();
|
||||
int actionExplode(int tile, int elevation, int minDamage, int maxDamage, Object* sourceObj, bool animate);
|
||||
int actionTalk(Object* obj, Object* critter);
|
||||
void actionDamage(int tile, int elevation, int minDamage, int maxDamage, int damageType, bool animated, bool bypassArmor);
|
||||
void actionDamage(int tile, int elevation, int minDamage, int maxDamage, DamageType damageType, bool animated, bool bypassArmor);
|
||||
bool actionCheckPush(Object* obj, Object* target);
|
||||
int actionPush(Object* obj, Object* target);
|
||||
int _action_can_talk_to(Object* obj, Object* critter);
|
||||
|
||||
+42
-13
@@ -1,6 +1,8 @@
|
||||
#include "animation.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include <array>
|
||||
#include <cstddef>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
@@ -38,9 +40,13 @@
|
||||
|
||||
namespace fallout {
|
||||
|
||||
#define ANIMATION_SEQUENCE_LIST_CAPACITY 32
|
||||
// sfall exposes this as [Misc] AnimationsAtOnceLimit. Keep CE aligned with
|
||||
// sfall's default 64 total / 52 non-reserved slots for now; this can become
|
||||
// configurable later.
|
||||
#define ANIMATION_SEQUENCE_LIST_CAPACITY 64
|
||||
#define ANIMATION_DESCRIPTION_LIST_CAPACITY 55
|
||||
#define ANIMATION_SAD_LIST_CAPACITY 24
|
||||
#define ANIMATION_SAD_LIST_CAPACITY 64
|
||||
#define ANIMATION_NON_RESERVED_LIST_CAPACITY 52
|
||||
|
||||
#define ANIMATION_SEQUENCE_FORCED 0x01
|
||||
|
||||
@@ -76,6 +82,11 @@ typedef enum AnimationKind {
|
||||
ANIM_KIND_SET_LIGHT_INTENSITY,
|
||||
} AnimationKind;
|
||||
|
||||
static bool animationKindIsCallback(int kind)
|
||||
{
|
||||
return kind == ANIM_KIND_CALLBACK || kind == ANIM_KIND_CALLBACK3;
|
||||
}
|
||||
|
||||
typedef enum AnimationSequenceFlags {
|
||||
// Specifies that the animation sequence has high priority, it cannot be
|
||||
// cleared.
|
||||
@@ -334,7 +345,7 @@ static AnimationSad gAnimationSads[ANIMATION_SAD_LIST_CAPACITY];
|
||||
static PathNode gClosedPathNodeList[PATH_NODE_CAPACITY];
|
||||
|
||||
// 0x54CC14 anim_set
|
||||
static AnimationSequence gAnimationSequences[32];
|
||||
static AnimationSequence gAnimationSequences[ANIMATION_SEQUENCE_LIST_CAPACITY];
|
||||
|
||||
// 0x561814 seen_tile
|
||||
static unsigned char gPathfinderProcessedTiles[5000];
|
||||
@@ -438,7 +449,7 @@ static int _anim_free_slot(int requestOptions)
|
||||
}
|
||||
|
||||
return -1;
|
||||
} else if ((requestOptions & ANIMATION_REQUEST_RESERVED) != 0 || v2 < 20) {
|
||||
} else if ((requestOptions & ANIMATION_REQUEST_RESERVED) != 0 || v2 < ANIMATION_NON_RESERVED_LIST_CAPACITY) {
|
||||
return v1;
|
||||
}
|
||||
|
||||
@@ -473,7 +484,7 @@ int reg_anim_clear(Object* a1)
|
||||
int animationDescriptionIndex;
|
||||
for (animationDescriptionIndex = 0; animationDescriptionIndex < animationSequence->length; animationDescriptionIndex++) {
|
||||
AnimationDescription* animationDescription = &(animationSequence->animations[animationDescriptionIndex]);
|
||||
if (a1 != animationDescription->owner || animationDescription->kind == 11) {
|
||||
if (a1 != animationDescription->owner || animationKindIsCallback(animationDescription->kind)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -587,7 +598,7 @@ static int _check_registry(Object* obj)
|
||||
if (animationSequenceIndex != gAnimationSequenceCurrentIndex && animationSequence->step != ANIM_COMPLETE) {
|
||||
for (int animationDescriptionIndex = 0; animationDescriptionIndex < animationSequence->length; animationDescriptionIndex++) {
|
||||
AnimationDescription* animationDescription = &(animationSequence->animations[animationDescriptionIndex]);
|
||||
if (obj == animationDescription->owner && animationDescription->kind != 11) {
|
||||
if (obj == animationDescription->owner && !animationKindIsCallback(animationDescription->kind)) {
|
||||
if ((animationSequence->flags & ANIM_SEQ_INSIGNIFICANT) == 0) {
|
||||
return -1;
|
||||
}
|
||||
@@ -619,7 +630,7 @@ int animationIsBusy(Object* a1)
|
||||
continue;
|
||||
}
|
||||
|
||||
if (animationDescription->kind == ANIM_KIND_CALLBACK) {
|
||||
if (animationKindIsCallback(animationDescription->kind)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -1609,12 +1620,25 @@ static int _anim_set_end(int animationSequenceIndex)
|
||||
}
|
||||
}
|
||||
|
||||
std::array<Object*, ANIMATION_DESCRIPTION_LIST_CAPACITY> destroyedOwners = {};
|
||||
std::size_t destroyedOwnersLength = 0;
|
||||
auto ownerWasDestroyed = [&destroyedOwners, &destroyedOwnersLength](Object* owner) {
|
||||
return std::find(destroyedOwners.begin(), destroyedOwners.begin() + destroyedOwnersLength, owner) != destroyedOwners.begin() + destroyedOwnersLength;
|
||||
};
|
||||
|
||||
for (i = 0; i < animationSequence->length; i++) {
|
||||
animationDescription = &(animationSequence->animations[i]);
|
||||
if (animationDescription->kind == ANIM_KIND_HIDE && ((i < animationSequence->animationIndex) || (animationDescription->extendedFlags & ANIMATION_SEQUENCE_FORCED))) {
|
||||
Object* owner = animationDescription->owner;
|
||||
if (ownerWasDestroyed(owner)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
destroyedOwners[destroyedOwnersLength++] = owner;
|
||||
|
||||
Rect rect;
|
||||
int elevation = animationDescription->owner->elevation;
|
||||
objectDestroy(animationDescription->owner, &rect);
|
||||
int elevation = owner->elevation;
|
||||
objectDestroy(owner, &rect);
|
||||
tileWindowRefreshRect(&rect, elevation);
|
||||
}
|
||||
}
|
||||
@@ -1623,18 +1647,23 @@ static int _anim_set_end(int animationSequenceIndex)
|
||||
animationDescription = &(animationSequence->animations[i]);
|
||||
if (animationDescription->artCacheKey) {
|
||||
artUnlock(animationDescription->artCacheKey);
|
||||
animationDescription->artCacheKey = nullptr;
|
||||
}
|
||||
|
||||
if (animationDescription->kind != 11 && animationDescription->kind != 12) {
|
||||
if (!animationKindIsCallback(animationDescription->kind)) {
|
||||
// TODO: Check.
|
||||
if (animationDescription->kind != ANIM_KIND_PING) {
|
||||
Object* owner = animationDescription->owner;
|
||||
if (ownerWasDestroyed(owner)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (FID_TYPE(owner->fid) == OBJ_TYPE_CRITTER) {
|
||||
int j = 0;
|
||||
for (; j < i; j++) {
|
||||
AnimationDescription* ad = &(animationSequence->animations[j]);
|
||||
if (owner == ad->owner) {
|
||||
if (ad->kind != ANIM_KIND_CALLBACK && ad->kind != ANIM_KIND_CALLBACK3) {
|
||||
if (!animationKindIsCallback(ad->kind)) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -1707,7 +1736,7 @@ static bool canUseDoor(Object* critter, Object* door)
|
||||
return false;
|
||||
}
|
||||
|
||||
int bodyType = critterGetBodyType(critter);
|
||||
BodyType bodyType = critterGetBodyType(critter);
|
||||
if (bodyType != BODY_TYPE_BIPED && bodyType != BODY_TYPE_ROBOTIC) {
|
||||
return false;
|
||||
}
|
||||
@@ -2990,7 +3019,7 @@ int _check_move(int* actionPointsPtr)
|
||||
if (isInCombat()) {
|
||||
if (*actionPointsPtr != -1) {
|
||||
if (gPressedPhysicalKeys[SDL_SCANCODE_RCTRL] || gPressedPhysicalKeys[SDL_SCANCODE_LCTRL]) {
|
||||
int hitMode;
|
||||
HitMode hitMode;
|
||||
bool aiming;
|
||||
interfaceGetCurrentHitMode(&hitMode, &aiming);
|
||||
|
||||
|
||||
+27
-4
@@ -47,6 +47,7 @@ static int artReadFrameData(unsigned char* data, File* stream, int count, int* p
|
||||
static int artReadHeader(Art* art, File* stream);
|
||||
static int artGetDataSize(const Art* art);
|
||||
static int paddingForSize(int size);
|
||||
static char artGetCritterWeaponCode(int weaponType);
|
||||
|
||||
// A frame is laid out like [ArtFrame header][pixel bytes][padding].
|
||||
// These functions return a pointer to the pixel bytes, but must be given a pointer to a frame header,
|
||||
@@ -583,7 +584,7 @@ int _art_get_code(int animation, int weaponType, char* weaponCodePtr, char* anim
|
||||
return -1;
|
||||
}
|
||||
|
||||
*weaponCodePtr = 'd' + (weaponType - 1);
|
||||
*weaponCodePtr = artGetCritterWeaponCode(weaponType);
|
||||
return 0;
|
||||
} else if (animation == ANIM_PRONE_TO_STANDING) {
|
||||
*animationCodePtr = 'h';
|
||||
@@ -625,7 +626,7 @@ int _art_get_code(int animation, int weaponType, char* weaponCodePtr, char* anim
|
||||
*weaponCodePtr = 'a';
|
||||
*animationCodePtr = 'n';
|
||||
} else {
|
||||
*weaponCodePtr = 'd' + (weaponType - 1);
|
||||
*weaponCodePtr = artGetCritterWeaponCode(weaponType);
|
||||
*animationCodePtr = 'e';
|
||||
}
|
||||
return 0;
|
||||
@@ -633,7 +634,7 @@ int _art_get_code(int animation, int weaponType, char* weaponCodePtr, char* anim
|
||||
|
||||
*animationCodePtr = 'a' + animation;
|
||||
if (animation <= ANIM_WALK && weaponType > 0) {
|
||||
*weaponCodePtr = 'd' + (weaponType - 1);
|
||||
*weaponCodePtr = artGetCritterWeaponCode(weaponType);
|
||||
return 0;
|
||||
}
|
||||
*weaponCodePtr = 'a';
|
||||
@@ -641,6 +642,24 @@ int _art_get_code(int animation, int weaponType, char* weaponCodePtr, char* anim
|
||||
return 0;
|
||||
}
|
||||
|
||||
static char artGetCritterWeaponCode(int weaponType)
|
||||
{
|
||||
switch (weaponType) {
|
||||
case WEAPON_ANIMATION_SFALL_S:
|
||||
return 's';
|
||||
case WEAPON_ANIMATION_SFALL_O:
|
||||
return 'o';
|
||||
case WEAPON_ANIMATION_SFALL_P:
|
||||
return 'p';
|
||||
case WEAPON_ANIMATION_SFALL_Q:
|
||||
return 'q';
|
||||
case WEAPON_ANIMATION_SFALL_T:
|
||||
return 't';
|
||||
default:
|
||||
return 'd' + (weaponType - 1);
|
||||
}
|
||||
}
|
||||
|
||||
// 0x419428
|
||||
char* artBuildFilePath(int fid)
|
||||
{
|
||||
@@ -957,9 +976,11 @@ int artAliasFid(int fid)
|
||||
int anim = FID_ANIM_TYPE(fid);
|
||||
if (type == OBJ_TYPE_CRITTER) {
|
||||
if (anim == ANIM_ELECTRIFY
|
||||
|| anim == ANIM_CHARRED_BODY
|
||||
|| anim == ANIM_BURNED_TO_NOTHING
|
||||
|| anim == ANIM_ELECTRIFIED_TO_NOTHING
|
||||
|| anim == ANIM_ELECTRIFY_SF
|
||||
|| anim == ANIM_CHARRED_BODY_SF
|
||||
|| anim == ANIM_BURNED_TO_NOTHING_SF
|
||||
|| anim == ANIM_ELECTRIFIED_TO_NOTHING_SF
|
||||
|| anim == ANIM_FIRE_DANCE
|
||||
@@ -1768,11 +1789,13 @@ void FrmImage::resetInternal()
|
||||
|
||||
bool FrmImage::setFrame(const Art* art, int frame, int direction)
|
||||
{
|
||||
unsigned char* data = artGetFrameData(art, frame, direction, &_width, &_height, &_xOffset, &_yOffset);
|
||||
unsigned char* data = artGetFrameData(art, frame, direction, &_width, &_height, nullptr, nullptr);
|
||||
if (data == nullptr) {
|
||||
return false;
|
||||
}
|
||||
|
||||
_xOffset = art->xOffsets[direction];
|
||||
_yOffset = art->yOffsets[direction];
|
||||
_data = data;
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -100,6 +100,11 @@ typedef enum WeaponAnimation {
|
||||
WEAPON_ANIMATION_LASER_RIFLE, // k
|
||||
WEAPON_ANIMATION_MINIGUN, // l
|
||||
WEAPON_ANIMATION_LAUNCHER, // m
|
||||
WEAPON_ANIMATION_SFALL_S, // s
|
||||
WEAPON_ANIMATION_SFALL_O, // o
|
||||
WEAPON_ANIMATION_SFALL_P, // p
|
||||
WEAPON_ANIMATION_SFALL_Q, // q
|
||||
WEAPON_ANIMATION_SFALL_T, // t
|
||||
WEAPON_ANIMATION_COUNT,
|
||||
} WeaponAnimation;
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user