Can I apply Traits and Perks to NPCs with sfall? If not, could it be possibly added?
Nirran has made mods that add perks for NPC's with the help of sfall. You can download them at his site.
Can I apply Traits and Perks to NPCs with sfall? If not, could it be possibly added?
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.
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.
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.[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.
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.
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?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.
I've added some requests too.
DoneThe cpp file version has been sent to Timeslip to be used to update sfall with.
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.)- Allowing us to know the tile number the mouse is hovering over (either in the hs_movecost hookscript or universally)
Done (I abused CritterInvSizeLimitMode; add 4 to get the weight calculation restricted. Will affect all critters)- An option for limiting the max carry weight calculation to item worn and item carried in active hand.
Done (ini options, and set_inven_ap_cost script function)- 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 (gdialog_get_barter_mod)function to get current barter mod of a critter (the one that is set with gdialog_mod_barter and gdialog_set_barter_mod)