Skip to content

Commit 707ced4

Browse files
committed
Release 4.3.3. Fixed movie scale pitch size (for CPU conversion).
1 parent 8e100ae commit 707ced4

5 files changed

Lines changed: 44 additions & 39 deletions

File tree

artifacts/ddraw.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
[Main]
55
;Enables built-in a High Resolution Patch mode that is similar to Hi-Res Patch by Mash
6+
;The required settings and files will be used from the f2_res.ini configuration file of the original Hi-Res patch
67
HiResMode=1
78

89
;Set to 1 if you want to use command line args to tell sfall to use another ini file

artifacts/ddraw_ru.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
[Main]
55
;Включает режим встроенного патча высокого разрешения, аналогичный Hi-Res Patch by Mash.
6+
;Требуемые настройки и файлы будут использоваться из конфигурационого файла f2_res.ini исходного Hi-Res патча.
67
HiResMode=1
78

89
;Установите значение 1, если требуется использовать другой файл ini указанный в аргументе командной строки.

artifacts/scripting/HookScripts.md

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,8 @@ Critter arg1 - The attacker
109109
Critter arg2 - The target of the attack
110110
int arg3 - The targeted bodypart
111111
int arg4 - Source tile (may differ from attacker's tile, when AI is considering potential fire position)
112-
int arg5 - Attack Type (one of ATKTYPE_*)
113-
int arg6 - Ranged flag. 1 means the hit chance is calculated by taking into account the bonuses/penalties of the distance to the target
112+
int arg5 - Attack Type (see ATKTYPE_* constants)
113+
int arg6 - Ranged flag. 1 if the hit chance calculation takes into account the distance to the target. This does not mean the attack is a ranged attack
114114
int arg7 - The raw hit chance before applying the cap
115115
116116
int ret0 - the new hit chance
@@ -119,7 +119,7 @@ int ret0 - the new hit chance
119119

120120
#### `HOOK_AFTERHITROLL (hs_afterhitroll.int)`
121121

122-
Runs after Fallout has decided if an attack will hit or miss
122+
Runs after Fallout has decided if an attack will hit or miss.
123123

124124
```
125125
int arg0 - If the attack will hit: 0 - critical miss, 1 - miss, 2 - hit, 3 - critical hit
@@ -169,8 +169,8 @@ int ret0 - The pid of an object to override the attacking weapon with
169169

170170
#### `HOOK_DEATHANIM2 (hs_deathanim2.int)`
171171

172-
Runs after Fallout has calculated the death animation. Lets you set your own custom frame id, so more powerful than `HOOK_DEATHANIM2`, but performs no validation.
173-
When using critter_dmg function, this script will also run. In that case weapon pid will be -1 and attacker will point to an object with `obj_art_fid == 0x20001F5`.
172+
Runs after Fallout has calculated the death animation. Lets you set your own custom frame id, so more powerful than `HOOK_DEATHANIM1`, but performs no validation.
173+
When using `critter_dmg` function, this script will also run. In that case weapon pid will be -1 and attacker will point to an object with `obj_art_fid == 0x20001F5`.
174174
Does not run for critters in the knockdown/out state.
175175

176176
```
@@ -344,10 +344,10 @@ __DEPRECATED HOOKS:__
344344
###### `HOOK_HEXSHOOTBLOCKING (hs_hexshootblocking.int)`
345345
###### `HOOK_HEXSIGHTBLOCKING (hs_hexsightblocking.int)`
346346

347-
Runs when checking to see if a hex blocks movement or shooting. (or ai-ing, presumably...)
347+
Run when checking to see if a hex blocks movement or shooting. (or ai-ing, presumably...)
348348

349349
__NOTE:__ These hook scripts can become very CPU-intensive and you should avoid using them.
350-
For this reason, these hooks are not properly supported in sfall, and may be removed in future versions.
350+
For this reason, these hooks are not thoroughly supported in sfall, and may be removed in future versions.
351351
If you want to check if some tile or path is blocked, use functions: `obj_blocking_tile`, `obj_blocking_line`, `path_find_to`.
352352
If you want script to be called every time NPC moves by hex in combat, use `HOOK_MOVECOST` hook.
353353

@@ -368,7 +368,7 @@ Runs when retrieving the damage rating of the player's used weapon. (Which may b
368368
```
369369
int arg0 - The default min damage
370370
int arg1 - The default max damage
371-
Item arg2 - The weapon used. (0 if unarmed)
371+
Item arg2 - The weapon used (0 if unarmed)
372372
Critter arg3 - The critter doing the attacking
373373
int arg4 - The type of attack
374374
int arg5 - non-zero if this is an attack using a melee weapon
@@ -387,22 +387,22 @@ To add proper check for ammo before attacking and proper calculation of the numb
387387
```
388388
Item arg0 - The weapon
389389
int arg1 - Number of bullets in burst or 1 for single shots
390-
int arg2 - The amount of ammo that will be consumed, calculated by cost of the original function (this is basically 2 for Super Cattle Prod and Mega Power Fist)
391-
Note: for hook type 2, this value is the cost of ammo (default is always 1)
390+
int arg2 - The amount of ammo that will be consumed, calculated by the original ammo cost function (this is basically 2 for Super Cattle Prod and Mega Power Fist)
391+
NOTE: for hook type 2, this value is the ammo cost per round (default is always 1)
392392
int arg3 - Type of hook:
393393
0 - when subtracting ammo after single shot attack
394394
1 - when checking for "out of ammo" before attack
395395
2 - when calculating number of burst rounds
396-
3 - when subtracting ammo after burst attack)
396+
3 - when subtracting ammo after burst attack
397397
398-
int ret0 - The new amount of ammo, or ammo cost value for hook type 2 (set to 0 for unlimited ammo)
398+
int ret0 - The new amount of ammo to be consumed, or ammo cost per round for hook type 2 (set to 0 for unlimited ammo)
399399
```
400400
-------------------------------------------
401401

402402
#### `HOOK_KEYPRESS (hs_keypress.int)`
403403

404404
Runs once every time when any key was pressed or released.
405-
- DX codes: see __dik.h__ header or https://kippykip.com/b3ddocs/commands/scancodes.htm
405+
- DX codes: see **dik.h** header or https://kippykip.com/b3ddocs/commands/scancodes.htm
406406
- VK codes: http://msdn.microsoft.com/en-us/library/windows/desktop/dd375731%28v=vs.85%29.aspx
407407

408408
__NOTE:__ If you want to override a key, the new key DX scancode should be the same for both pressed and released events.
@@ -418,7 +418,7 @@ int ret0 - overrides the pressed key (a new key DX scancode or 0 for no over
418418

419419
#### `HOOK_MOUSECLICK (hs_mouseclick.int)`
420420

421-
Runs once every time when a mouse button was pressed or release.
421+
Runs once every time when a mouse button was pressed or released.
422422

423423
```
424424
int arg0 - event type: 1 - pressed, 0 - released
@@ -430,7 +430,7 @@ int arg1 - button number (0 - left, 1 - right, up to 7)
430430

431431
Runs when using any skill on any object.
432432

433-
This is fired before the default handlers are called, which you can override. In this case you should write your own skill use handler entirely, or otherwise nothing will happen (this includes fade in/fade out, time lapsing and messages - all of this can be scripted; to get vanilla text messages - use `message_str_game` along with `sprintf()`).
433+
This is fired before the default handlers are called, which you can override. In this case you should write your own skill use handler entirely, or otherwise nothing will happen (this includes fade in/fade out, time lapsing and messages - all of this can be scripted; to get vanilla text messages - use `message_str_game` along with `sprintf`).
434434
Suggested use - override first aid/doctor skills to buff/nerf them, override steal skill to disallow observing NPCs inventories in some cases.
435435
Doesn't seem to run when lock picking.
436436

@@ -488,7 +488,7 @@ int arg3 - Type of hook:
488488
int ret0 - overrides the returned result of the function:
489489
0 - not in range (can't see)
490490
1 - in range (will see if not blocked)
491-
2 - forced detection (will see regardless, only used in "obj_can_see_obj" scripting function which is called by every critter in the game)
491+
2 - forced detection (will see regardless, only used in "obj_can_see_obj" script function which is called by every critter in the game)
492492
```
493493
-------------------------------------------
494494

@@ -545,7 +545,7 @@ int ret0 - overrides hard-coded handler (-1 - use engine handler, any other
545545
Runs after calculating character figure FID on the inventory screen, whenever the game decides that character appearance might change.
546546
Also happens on other screens, like barter.
547547

548-
__NOTE:__ FID has following format: `0x0ABBCDDD`, where: `A` - is object type, `BB` - animation code (always 0 in this case), `C` - weapon code, `DDD` - FRM index in LST file.
548+
__NOTE:__ FID has following format: `0x0ABBCDDD`, where: `A` - object type, `BB` - animation code (always 0 in this case), `C` - weapon code, `DDD` - FRM index in LST file.
549549

550550
```
551551
int arg0 - the vanilla FID calculated by the engine according to critter base FID and armor/weapon being used
@@ -650,10 +650,10 @@ int ret1 - overrides the result of engine calculation: 0/1 - failure, 2/3 -
650650

651651
#### `HOOK_DESCRIPTIONOBJ (hs_descriptionobj.int)`
652652

653-
Runs when using the examine action icon to display object description. You can override the description of the object.
653+
Runs when using the examine action icon to display the description of an object. You can override the description text.
654654
An example usage would be to add an additional description to the item based on player's stats/skills.
655655

656-
__NOTE:__ Not runs if the script of the object overrides the description.
656+
__NOTE:__ Does not run if the script of the object overrides the description.
657657

658658
```
659659
Obj arg0 - the object
@@ -800,28 +800,28 @@ int ret1 - pass 1 to cancel the encounter and load the specified map from th
800800

801801
#### `HOOK_ADJUSTPOISON (hs_adjustpoison.int)`
802802

803-
Runs when the critter's poison level is changed or damage is caused by the poison effect.
803+
Runs when a critter's poison level is changed, or when the player takes damage from the poison.
804804

805805
```
806-
Critter arg0 - critter
807-
int arg1 - amount of the increase/decrease of the poisoning level
808-
int arg2 - damage value at the time of applying poison effect
809-
(damage the poison effect is implemented only for the player's character, for other critters this value will always be 0)
806+
Critter arg0 - the critter
807+
int arg1 - the amount of poison being added/removed
808+
int arg2 - the damage value at the time of applying the poison effect
809+
(damage from the poison effect is implemented only for the player character; for other critters, this value will always be 0)
810810
811-
int ret0 - the new value of the amount poisoning level
812-
int ret1 - the new damage value, only negative values are allowed (will only be valid at the time of the poison damage)
811+
int ret0 - the new amount of poison being added/removed
812+
int ret1 - the new damage value, only negative values are allowed (will only be valid at the time of taking damage from the poison)
813813
```
814814
-------------------------------------------
815815

816-
#### `HOOK_ADJUSTRADIATION (hs_adjustradiation.int)`
816+
#### `HOOK_ADJUSTRADS (hs_adjustrads.int)`
817817

818-
Runs when the critter's rads level is changed.
818+
Runs when a critter's radiation level is changed.
819819

820820
```
821-
Critter arg0 - critter (usual dude_obj)
822-
int arg1 - amount of the increase/decrease of the rads level
821+
Critter arg0 - the critter (usually dude_obj)
822+
int arg1 - the amount of radiation being added/removed
823823
824-
int ret0 - the new value of the amount rads level
824+
int ret0 - the new amount of radiation being added/removed
825825
```
826826
-------------------------------------------
827827

@@ -836,7 +836,7 @@ int arg0 - event type:
836836
3 - checks the chance when using skills (not listed below)
837837
4 - check the chance of using Repair skill
838838
5 - check the chance of using Doctor skill
839-
6 - check the chance of using Steal skill for the thief (player's)
839+
6 - check the chance of using Steal skill for the thief (usually the player's)
840840
7 - the second Steal skill chance check for the target to catch the thief, in which the target's failure is the thief's success result
841841
int arg1 - the value of roll result (see ROLL_* constants), which is calculated as:
842842
- for ROLL_CRITICAL_SUCCESS: random(1, 100) <= (random_chance / 10) + bonus
@@ -845,14 +845,14 @@ int arg2 - the chance value
845845
int arg3 - the bonus value, used when checking critical success
846846
int arg4 - random chance, calculated as: (chance - random(1, 100)), where a negative value is a failure check (ROLL_FAILURE)
847847
848-
int ret0 - override the roll result
848+
int ret0 - overrides the roll result
849849
```
850850
-------------------------------------------
851851

852852
#### `HOOK_BESTWEAPON (hs_bestweapon.int)`
853853

854854
Runs when the AI decides which weapon is the best while searching the inventory for a weapon to equip in combat.
855-
This is also runs when the player presses the "Use Best Weapon" button on the party member control panel.
855+
This also runs when the player presses the "Use Best Weapon" button on the party member control panel.
856856

857857
```
858858
Critter arg0 - the critter searching for a weapon
@@ -867,9 +867,9 @@ Item ret0 - overrides the chosen best weapon
867867

868868
#### `HOOK_CANUSEWEAPON (hs_canuseweapon.int)`
869869

870-
Run when the AI checks whether it can use a weapon, or when the game checks whether the player can use a item (weapon) in hand slot.
870+
Run when the AI checks whether it can use a weapon, or when the game checks whether the player can use an item (weapon) in hand slot.
871871
For AI, this mostly happens when NPCs try to find weapons in their inventory or on the map.
872-
For the player, this happens when the game updates the item data for the main slot of the interface bar.
872+
For the player, this happens when the game updates the item data for active item slots on the interface bar.
873873

874874
```
875875
Critter arg0 - the critter doing the check

artifacts/scripting/arrays.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -245,8 +245,8 @@ For those who used arrays in their mods before sfall 3.4:
245245

246246
1. There is an INI parameter **ArraysBehavior** in **Misc** section of "ddraw.ini". If set to 0, all scripts which used sfall arrays before should work. This basically changes that `create_array` will create permanent arrays which are "saved" by default and their ID is also permanent. It is 1 by default.
247247

248+
__NOTE:__ Starting from sfall 4.3.3/3.8.33, the **ArraysBehavior** option is removed, and arrays always work in **ArraysBehavior=1** mode. Make sure to review your scripts if you need to save arrays into savegames.
249+
248250
2. How savegame compatibility is handled?. Saved arrays are stored in sfallgv.sav file (in savegame) in new (more flexible) format, just after the old arrays. So basically, when you load older savegame, sfall will load arrays from old format and save them to new format on next game save. If you load savegame made with sfall 3.4 using sfall 3.3 (for example), game shouldn't crash, but all arrays will be lost.
249251

250252
3. Previously you had to specify size in bytes for array elements. This parameter is now ignored and you can store strings of arbitrary length in arrays.
251-
252-
The **ArraysBehavior** option has been removed from sfall 4.3.3/3.8.33, now arrays always work in **ArraysBehavior=1** mode.

sfall/Modules/Graphics.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -647,6 +647,7 @@ class FakeDirectDrawSurface : IDirectDrawSurface {
647647
fo::func::buf_to_buf(mveSurface, width, mveDesc.dwHeight, width, (BYTE*)dRect.pBits, dRect.Pitch);
648648
}
649649
} else {
650+
int sPitch = width;
650651
int height = mveDesc.dwHeight;
651652

652653
if (d != 0) { // scale
@@ -655,7 +656,9 @@ class FakeDirectDrawSurface : IDirectDrawSurface {
655656
height = dst->bottom - dst->top;
656657

657658
HRP::Image::Scale(mveSurface, mveDesc.lPitch, mveDesc.dwHeight, mveScaleSurface, width, height, ResWidth);
659+
658660
mveSurface = mveScaleSurface;
661+
sPitch = ResWidth;
659662
}
660663

661664
int pitch = dRect.Pitch / 4;
@@ -665,7 +668,7 @@ class FakeDirectDrawSurface : IDirectDrawSurface {
665668
{
666669
int x = width;
667670
while (x--) pBits[x] = palette[mveSurface[x]].xRGB;
668-
mveSurface += width;
671+
mveSurface += sPitch;
669672
pBits += pitch;
670673
}
671674
}

0 commit comments

Comments
 (0)