Fallout 2 mod FO2 Engine Tweaks (Sfall)

I have a question regarding hs_itemdamage.int hook script, specifically: "int arg5 - The type of attack". What type exactly is that?
I've been testing this hook script with sfall version 3.2 with many different weapons (including unarmed) and getting weird results. SOME weapons return either 0 or 1 if I use this weapon attack type 1 or 2 respectively (in PRO format, all weapons have only 2 types of attack), while other weapons return values 2 or 3, and I can't understand the pattern (mostly pistols and SMGs return 2 for single and 3 for burst fire, while rifles and shotguns return 0 for single and 1 for burst). Unarmed attacks may return greater numbers. How should I read treat parameter?

Second thing is function "int get_proto_data(objptr, int offset)".
a) Notes say that I should use offset from PRO file minus 12, but that's not true. Actual offsets from PRO file work (like 0x0030 for item cost).
b) But when I tried to use offsets which are not multiples of 4 (like 2 or 7), I had very strenge result, that does not match appropriate address in PRO file. I think there is some kind of bug.
c) it says "objptr" which likely to be pointer to an item object, but instead it works only on item PIDs.
 
Last edited:
Yes! I finally got it! The type of attack =
If using left-hand weapon ("Item 1"):
0 - primary attack mode
1 - secondary attack mode
If using right-hand weapon ("Item 2"):
2 - primary attack mode
3 - secondary attack mode

So, if I need to check what type of attack was used, I need to get remainder: type % 2 and use it as index in weapon attack types array (2 items of 4 bits)!

@NovaRain
Thanks for the link, it helped. Strange though, those offsets completely different from PRO file format... I just hope these offsets are consistent.
 
Yes! I finally got it! The type of attack =
If using left-hand weapon ("Item 1"):
0 - primary attack mode
1 - secondary attack mode
If using right-hand weapon ("Item 2"):
2 - primary attack mode
3 - secondary attack mode

So, if I need to check what type of attack was used, I need to get remainder: type % 2 and use it as index in weapon attack types array (2 items of 4 bits)!

@NovaRain
Thanks for the link, it helped. Strange though, those offsets completely different from PRO file format... I just hope these offsets are consistent.

Here's the rest of the attack types (I always used to forget to check all the documentation Timeslip added too):

//The attack types returned by get_attack_type
#define ATKTYPE_LWEP1 (0)
#define ATKTYPE_LWEP2 (1)
#define ATKTYPE_RWEP1 (2)
#define ATKTYPE_RWEP2 (3)
#define ATKTYPE_PUNCH (4)
#define ATKTYPE_KICK (5)
#define ATKTYPE_LWEP_RELOAD (6)
#define ATKTYPE_RWEP_RELOAD (7)
#define ATKTYPE_STRONGPUNCH (8)
#define ATKTYPE_HAMMERPUNCH (9)
#define ATKTYPE_HAYMAKER (10)
#define ATKTYPE_JAB (11)
#define ATKTYPE_PALMSTRIKE (12)
#define ATKTYPE_PIERCINGSTRIKE (13)
#define ATKTYPE_STRONGKICK (14)
#define ATKTYPE_SNAPKICK (15)
#define ATKTYPE_POWERKICK (16)
#define ATKTYPE_HIPKICK (17)
#define ATKTYPE_HOOKKICK (18)
#define ATKTYPE_PIERCINGKICK (19)
 
@JimTheDinosaur,
Thanks!

Does anyone knows if it is possible to somehow change (add another hook script) to SELLING prices? I know using hs_barterprice it's not possible, but I still hope there is some solution... Just imagine what possibilities it would give. A real trader roleplay, when mastering Barter skill will enable you to make money on price differences buying and selling to different trader. Currently it's not possible, because all selling prices are always fixed :(

Edit: question #2: is it possible to somehow catch map_enter event inside global script? I need to add some objects in the game without modifying maps in mapper or using global variables. I was thinking on doing it on first enter of each map.
 
Last edited:
[strike]Just found out that the additional DR values from all four combat implant perks are only for show. They do increase DR values displayed in the inventory and character screen (for normal DR), but using F12se to check the character data you'll see there's no real increment on DR. And testing in combat can also verify this.[/strike]

I modified BB gun with 100-100 dmg (other attributes unchanged), gave it to Cassidy, and controlled him to shoot me wearing no armor in combat. My character has Toughness Lv3 (+30 DR), Prizefighter reputation (+5 DR), and Dermal Impact perk (+5 DR). In game it shows my DR is 40, so the damage I received should be 60. But actually I got hit for 65 damage, and checking with F12se shows my normal DR is 35, which is the same as before gaining the implant.

EDIT: OK, it seems the "displayed" DR does work. It's my fault to use NPC control function for testing. If I reverse-pickpocket a NPC the modified BB gun and make him attack me, like purposely getting caught for stealing, I will correctly get hit for 60 points. Sorry for crying wolf. :oops:
 
Last edited:
Edit: question #2: is it possible to somehow catch map_enter event inside global script? I need to add some objects in the game without modifying maps in mapper or using global variables. I was thinking on doing it on first enter of each map.

You probably already have your own workaround by now, but what I always do is set a global var to 1 in the dude script's map_enter and then have a global script check for that.
 
[strike]Just found out that the additional DR values from all four combat implant perks are only for show. They do increase DR values displayed in the inventory and character screen (for normal DR), but using F12se to check the character data you'll see there's no real increment on DR. And testing in combat can also verify this.[/strike]

I modified BB gun with 100-100 dmg (other attributes unchanged), gave it to Cassidy, and controlled him to shoot me wearing no armor in combat. My character has Toughness Lv3 (+30 DR), Prizefighter reputation (+5 DR), and Dermal Impact perk (+5 DR). In game it shows my DR is 40, so the damage I received should be 60. But actually I got hit for 65 damage, and checking with F12se shows my normal DR is 35, which is the same as before gaining the implant.

EDIT: OK, it seems the "displayed" DR does work. It's my fault to use NPC control function for testing. If I reverse-pickpocket a NPC the modified BB gun and make him attack me, like purposely getting caught for stealing, I will correctly get hit for 60 points. Sorry for crying wolf. :oops:
NPCs can't have perks (or at least they don't work on them), I guess the dude is treated as an NPC while you control another character. Also, all perk effects don't show up in F2se as you noticed, so you will have to test them in-game.
 
NPCs can't have perks (or at least they don't work on them), I guess the dude is treated as an NPC while you control another character. Also, all perk effects don't show up in F2se as you noticed, so you will have to test them in-game.

Really? I never knew that. I just want to be clear here, though: Do you mean they can't have perks ever? Or, that they just can't have them when the player has control of them? I'm just trying to confirm if additions to the MM were just wasted effort in regards to armor for Marcus and Dogmeat. Each of those NPCs has code to add perks if they are wearing their respective armors.
 
NPCs can't have perks (or at least they don't work on them), I guess the dude is treated as an NPC while you control another character. Also, all perk effects don't show up in F2se as you noticed, so you will have to test them in-game.

Really? I never knew that. I just want to be clear here, though: Do you mean they can't have perks ever? Or, that they just can't have them when the player has control of them? I'm just trying to confirm if additions to the MM were just wasted effort in regards to armor for Marcus and Dogmeat. Each of those NPCs has code to add perks if they are wearing their respective armors.
Eh, I remembered wrong. They can, at least some of them. It's not very clear what works though, I mean how do you see it or test it?
I tested with giving Lenny the add strength and agility perks, as that can be easily checked in-game. He got the traits, but they didn't raise his stats (checked with throwing a float if he had the perk). Tried giving him the extra action point perk and that worked, but as soon as he leveled up he lost the extra point while my perk check still claimed he had it (so he didn't lose the perk, just the stat gain). So basically, it's very hard knowing what perks work and how leveling up affects them. Do perks that don't alter stats work at all, and if so, do they stop working at level up? I don't know...
 
@Darek
NPC level up means a new proto file is referenced correct? So is that what might be the problem with perks being lost on level up?
 
Last edited by a moderator:
Since Timeslip hasn't been active for two weeks, I decided to go ahead and compile the updated code of Glovz's ammo mod with current SVN r254: (removed due to newer version)

It'll be probably equal to r255 if Timeslip doesn't update other codes in next revision.
 
Last edited:
Well aware of the negligible chance of any of these request actually being filled, (I'm really just spoiled given all the stuff you've already made possible) but whatever, here's three more requests (also added to the request wiki):

- Allowing us to know the tile number the mouse is hovering over (either in the hs_movecost hookscript or universally)
- An option for limiting the max carry weight calculation to item worn and item carried in active hand.
- An option for raising the AP-cost for the inventory opening during combat (I know I already asked this one, just making it "formal")
 
I've added some requests too.

The dynamic spatial script one Timeslip already confirmed is not going to happen (I also asked before trying my trap setting workaround).

The line of sight one is of course pretty damn crucial (afaik the best workaround is through the hs_hexshootblocking hookscript and then checking for live targets rather than scenery; you might want to check out my simulated burst cone script which plays around with that).
 
eep, the request list is twice as long as when I last looked. O.o

Anyways, I decided tonight was an sfall night, so...

The cpp file version has been sent to Timeslip to be used to update sfall with.
Done
- Allowing us to know the tile number the mouse is hovering over (either in the hs_movecost hookscript or universally)
Done (tile_under_cursor script function. Note that it doesn't clip; i.e. it'll still return a tile number even if the mouse is over the interface bar at the bottom etc.)
- An option for limiting the max carry weight calculation to item worn and item carried in active hand.
Done (I abused CritterInvSizeLimitMode; add 4 to get the weight calculation restricted. Will affect all critters)
- An option for raising the AP-cost for the inventory opening during combat (I know I already asked this one, just making it "formal")
Done (ini options, and set_inven_ap_cost script function)
function to get current barter mod of a critter (the one that is set with gdialog_mod_barter and gdialog_set_barter_mod)
Done (gdialog_get_barter_mod)

Also, from the bar up the top that's glaring at me, it appears that I haven't been getting email notifications of PM's, so sorry everyone I've inadvertantly ignored since I logged in last.
 
Last edited:
Back
Top