Fallout 2 mod FO2 Engine Tweaks (Sfall)

MIB88 said:
If you have already included a feature which does that, I'm sorry for asking again... I am definitely no wiz at using sfall.
Unless the method you use for checking for broken limbs only works in critter_p_proc for some reason, that's nothing that can't be done from a global script instead. (Loop over all critters, check each one for the appropriate flags, etc.)

A better place to do it though might be hs_combatdamage. Check arg5 (the special effect flags for the target,) for the flag that indicates a crippled arm, and if found add the flag for a dropped weapon. (Sorry, I don't seem to have made a note of which flag indicates what effect. You'll have to trail and error it to find the appropriate two.) That would have the advantage that the weapons would drop naturally in the combat round, and be indicated in the combat message, rather than just appearing on the floor the next frame. Of course it would have the disadvantage that only crippled limbs resulting directly from combat would count. You could always add a global script too, but only run it every few seconds instead of every frame.
 
Thanks for the info/advice. Nirran has also just let me know more about how this could be done and, knowing him, he's probably already finished with it! :lol:

Edit: About this part if using it in hs_combatdamage:
Timeslip said:
... Of course it would have the disadvantage that only crippled limbs resulting directly from combat would count...

I don't think that is a problem. It's mainly just to be used as a feature for enemies. And I can't think of any instances in which a critter would be crippled out of combat (except for party NPCs coming out of the john when it is blown up)... Unless you are suggesting that critical misses in which they cripple themselves would somehow not be counted.

Regarding the use_object_on procedure... do you need any amplifying information about that and what I have in mind?
 
MIB88 said:
Regarding the use_object_on procedure... do you need any amplifying information about that and what I have in mind?
Nah, that was only so that I could suggest a better way of doing it. I can't think of any obvious better way to do a universal use_object_on apart from scripting the object itself, with all the too-many-items-bug goodness that that would cause.

Ninja-Edit:
Unless you are suggesting that critical misses in which they cripple themselves would somehow not be counted.
No, they would not.
 
Hiya,

firstly, thanks Timeslip for such an awesome mod and all the work you are putting into it! The possibilties you're giving to scripters are endless..


Inspired by the weapon drop mod and nirran scripts, I made myself one using the combat damage hook to cause weapons to drop on a crippling or knocking hit. Unfortunately this is executed (the weapon drop) BEFORE the actual hitting animation, so it looks kinda weird.
 
pelicano said:
Inspired by the weapon drop mod and nirran scripts, I made myself one using the combat damage hook to cause weapons to drop on a crippling or knocking hit. Unfortunately this is executed (the weapon drop) BEFORE the actual hitting animation, so it looks kinda weird.
hehe, so someone had tried it already. :P

Did you do it via drop_obj rather than setting the combat effect flag? That would cause it to drop before the animation. Using the flag should work, because it will end up using the same mechanism as critical miss weapon drops, which look fine.
 
Timeslip said:
Ninja-Edit:
Unless you are suggesting that critical misses in which they cripple themselves would somehow not be counted.
No, they would not.

Oh. Weird. Well, probably not something to happen with a great enough frequency so as to diminish using the weapon drop feature... even when playing asa Jinxed character. Thanks for the clarification.

@pelicano: I'm sure you'll get it worked out. Is there a way you can insert something to delay the drop 1 round, so that it does not appear to happen before the actual hit?

Edit: Nevermind. Timeslip already addressed it. Too fast for me with those ninja skills!
 
Cool cool stuff. Indeed - thanks Timeslip for making awesome stuff like the weapon-drop mod possible. There was another thread where there was a little squabble over who's idea it was, but really credit to should go to Timeslip, without whom it would be impossible anyway.

I also made 2 requests a while back that probably got lost in the thread, so i'll remake them:

a) when the player picks up an item from the ground, it plays a sound effect unique to the item. But when the player moves items around in the inventory all items just make a generic 'flop' sound.
IMO it would be a fantastic improvement if the game played the soound unique to the item rather this dull 'flop' sound.

b) i'd like the game to call a different animation when the player gets hit for 0 damage, than the regular AP animation. My reason for this is i find it kindof awkward when the game plays the bend-over-backwards animation when the player hardly gets scratched by an attack (i.e. hit for 0)

Whacha think, Timeslip?
 
Timeslip said:
Did you do it via drop_obj rather than setting the combat effect flag? That would cause it to drop before the animation. Using the flag should work, because it will end up using the same mechanism as critical miss weapon drops, which look fine.

I used the same method to drop weapons as the weapon drop mod. It's somewhat similar to using the drop_obj function but with customized placement (get item, calculate tile, remove item from inv, place item on tile).

I tried setting the DAM_DROP flag but it didn't work. Not exactly. I set the combat hook script to get auto cripple right arm hits and drop weapon hits. At every shot I was getting in the combat log the message 'crippled his right arm...and his weapon dropped' or the like but, actually, only the crippling effect was working.

I even set the DROP flag for the Attacker (being this effect usually for critical misses) but didn't work either for my toon.

So far I've been able to force knockdowns, knockouts, crippling effects, ... but 'special' flags like drop weapon, or weapon explode, seem to be hardcoded. Or at least they work differently.

At first I search for a way to force a delay so the anim could play naturally but I didn't find anything useful. And really, maybe it's not a good idea to delay the script from running in such a delicate momment...

I guess we could just use a regular global script, but that's very ugly.. checking every critter in the map every now and then, again and again...


By the way, is there some way to get/set the amount of Experience Points a critter gives to the player when it dies? I've been rewarding the player with xp here and there within combat and I'd like to lower the amount of xp rewarded by critter killing without having to mess with proto files.
 
pelicano said:
By the way, is there some way to get/set the amount of Experience Points a critter gives to the player when it dies? I've been rewarding the player with xp here and there within combat and I'd like to lower the amount of xp rewarded by critter killing without having to mess with proto files.
Adding the "script_overrides" command to the "destroy_p_proc" procedure of a critter's script will prevent the player from getting XP for the kill.
 
timeslip - would it be hard to return the ammo used in hs_combatdamage hook script?if you are able to Do it,it would be possible to totaly re-write the damage formula,and be able to get rid of the jhp is better then ap against armored critters

awesome mod,i use the ever loving **** out of it:)

Nirran
 
Josan12 said:
I intend to look at (a), because theoretically it should be quite simple to do, once I find two relevant bits of code that I'm missing. As for (b), what do you intend replacing the animation with? There's not really any sufficiently better existing options available that I can think of to justify the work. (The miss animation is a possibility, but that's more of a dodging thing, whereas 0 damage hits are an armour thing.)

pelicano said:
I tried setting the DAM_DROP flag but it didn't work. Not exactly. I set the combat hook script to get auto cripple right arm hits and drop weapon hits. At every shot I was getting in the combat log the message 'crippled his right arm...and his weapon dropped' or the like but, actually, only the crippling effect was working.
oh, pity. It must only check that flag on the critical miss code path then. :(

The only way to introduce a delay would be to have the hs_ondamage script communicating with a normal global script, and do the droppage from the global script instead. I don't really think that's an improvement over the loop-over-all-critters thing though.

pelicano said:
By the way, is there some way to get/set the amount of Experience Points a critter gives to the player when it dies? I've been rewarding the player with xp here and there within combat and I'd like to lower the amount of xp rewarded by critter killing without having to mess with proto files.
Use set_proto_data, if you want to avoid modifying the proto on disk. The only other xp modifying functions that sfall offers are global, and will effect all other sources of xp rather than just kill xp.

Nirran said:
timeslip - would it be hard to return the ammo used in hs_combatdamage hook script?if you are able to Do it,it would be possible to totaly re-write the damage formula,and be able to get rid of the jhp is better then ap against armored critters
Will adding a weapon_ammo_pid(item) function that returns the pid of the ammo loaded into a weapon suffice? That would be easy enough to do.
 
yes that would be perfect Timeslip !
though it needs to be ammo id rather then pid file name(prolly the only way to do it anyway).

Love this freaking mod!

Nirran
 
Nirran said:
though it needs to be ammo id rather then pid file name(prolly the only way to do it anyway).
umm, pid file name? Don't worry, I certainly wont be returning any file names. :P I meant pid as in ItemPID.h, and all the defines that being with PID_xxx. They're just numbers.
 
Timeslip said:
Use set_proto_data, if you want to avoid modifying the proto on disk. The only other xp modifying functions that sfall offers are global, and will effect all other sources of xp rather than just kill xp.

You mean these, right?
Code:
0x8204 - int  get_proto_data(objptr, int element) 
0x8205 - void set_proto_data(objptr, int element)

I can't seem to make it return any meaningful value, so I'm failing at something. What is exactly int element? I've seen in define.h possible values for data_member, which is used by the fuction proto_data, but I haven't seen any more info about proto elements or similar.

Thanks.
 
pelicano said:
I can't seem to make it return any meaningful value, so I'm failing at something. What is exactly int element? I've seen in define.h possible values for data_member, which is used by the fuction proto_data, but I haven't seen any more info about proto elements or similar.
It's not in any of the headers, it's a raw offset into the proto file. The format is here. You'd want 404 for the xp.

Edit: Actually, I can't remember if the game does something to the proto header when it's loaded into memory. The offsets might shift slightly to where they are in the file. It'll be pretty close to 404 anyway.
 
Timeslip said:
It's not in any of the headers, it's a raw offset into the proto file. The format is here. You'd want 404 for the xp.

Ok, then definitely I'm doing something wrong because that's the value I've been trying all the time, among others for testing. Maybe my problem is in objptr usage?

I tested this code and I'm guessing the first one is the correct (being oCritter a valid critter object):

Code:
display_msg("Obj: "+obj_pid(oCritter)+" EXP: "+get_proto_data(obj_pid(oCritter),404)); 
 
display_msg("Obj: "+oCritter+" EXP: "+get_proto_data(oCritter,404));

Anyway, in both of these get_proto_data() returns -1. I use the v1.49a compiler, if that matters.

Edit:
Edit: Actually, I can't remember if the game does something to the proto header when it's loaded into memory. The offsets might shift slightly to where they are in the file. It'll be pretty close to 404 anyway.

Ahh, ok. Yes, that would make sense. I'll try different values then and see if I get the right one.

Edit2: The value for the exp is 392. All is good again. :)

Thanks.
 
evidentaly i missunderstood what proto data did,the recent convo cleared it up in my mind,thnx :)

Nirran
 
Right, that was an interesting diversion. sfall now has get/set_weapon_ammo_pid/count functions, and hs_findtarget and hs_useobjon hook scripts. Now time to go back to those bloody tiles again.

pelicano said:
Edit2: The value for the exp is 392. All is good again. :)
Ah, great, so it's -12. I'll make a note of that in the readme.
 
Back
Top