Fallout 2 mod FO2 Engine Tweaks (Sfall)

Nirran said:
arggggspam. (Saw that before you edited it down a bit. :P)

You mean that the target damage value sfall is giving you is sometimes far too big, or that after the script runs the target is taking massive damage regardless of what return you set? You'll need to stick some display_msg's in to find out exactly where the problem is. If you're set_sfall_return-ing one value but the target is taking another than there might be some critical damage multiplier flags taking effect after the hook script runs if it's a reasonable multiple of what you set. If it's something insanely big then I'm probably treating a 16 bit value like a 32 bit somewhere.
 
it is insanly big,i just tested with this code,it fires and with unarmed it always treturns 1 for min 3 for max and -1 for weapon pid,the actual damage is within coded values but the retunr(that the game doesnt always apply damage to critter) is sometimes a huge number,this is my testing code

Code:
               if(Get_Skill(obj_pid(attack_weapon)) == SKILL_UNARMED_COMBAT) or (Get_Skill(obj_pid(attack_weapon)) == SKILL_MELEE) then
                  begin
                     target_special_flag := 0;
                     attacker_special_flag := 0;
                     random_roll := random(1,100);
                     crit_chance := get_critter_extra_stat(attacker, STAT_crit_chance) + get_critter_base_stat(attacker, STAT_crit_chance) + get_sfall_global_int("critic_4");
                     attacker_special_flag := 256;
                     target_special_flag := 256;
                     attacker_melee_damage := (get_critter_extra_stat(attacker, STAT_melee_dmg) + get_critter_base_stat(attacker, STAT_melee_dmg));
                     maximum := attacker_melee_damage + Get_Max(obj_pid(attack_weapon)) + get_sfall_global_int("melee_04");
                     minimum := Get_Min(obj_pid(attack_weapon)) + get_sfall_global_int("ranged_4");
                     float_msg(dude_obj, "Damage Fired" + " " + obj_pid(attack_weapon) +  " " + Get_Min(obj_pid(attack_weapon)) +  " " + Get_Max(obj_pid(attack_weapon)), 3);
                     random_damage := random(minimum, maximum);
                     if(random(1,100) > (100 - crit_chance)) then
                        begin
                           random_damage := random_damage * 2;
                           attacker_special_flag := attacker_special_flag + 512;
                           target_special_flag := target_special_flag + 512;
                           knockdown_incapacitate := random(1,100);
                           if(knockdown_incapacitate >= 100 - (get_sfall_global_int("knock_04")))then
                              begin
                                 if(obj_pid(target) != MYRON) and (obj_pid(target) != MARCUS) and (obj_pid(target) != CASSIDY) and (obj_pid(target) != SULIK) and (obj_pid(target) != LENNY)and (obj_pid(target) != CYBERDOG) and (obj_pid(target) != GORIS) and (obj_pid(target) != ROBOBRAIN) and (obj_pid(target) != VIC) and (obj_pid(target) != DAVIN) and (obj_pid(target) != MIRIA) and (obj_pid(target) != KLINT) and (obj_pid(target) != DOGMEAT) and (obj_pid(target) != K9) and (obj_pid(target) != DIAGO) and (obj_pid(target) != MERIS) and (obj_pid(target) != LENNY_HUMAN) and (obj_pid(target) != ROBOBRAIN_SKYNET) and (target != dude_obj) then 
                                    begin 
                                       target_special_flag := target_special_flag + 2;
                                       sfall := 1;
                                    end 
                                 else 
                                    if (has_fake_perk(Imoble) != 4) and ((obj_pid(target) == MYRON) or (obj_pid(target) == MARCUS) or (obj_pid(target) == CASSIDY) or (obj_pid(target) == SULIK) or (obj_pid(target) == LENNY)or (obj_pid(target) == CYBERDOG) or (obj_pid(target) == GORIS) or (obj_pid(target) == ROBOBRAIN) or (obj_pid(target) == VIC) or (obj_pid(target) == DAVIN) or (obj_pid(target) == MIRIA) or (obj_pid(target) == KLINT) or (obj_pid(target) == DOGMEAT) or (obj_pid(target) == K9) or (obj_pid(target) == DIAGO) or (obj_pid(target) == MERIS) or (obj_pid(target) == LENNY_HUMAN) or (obj_pid(target) == ROBOBRAIN_SKYNET)) then 
                                       begin
                                          target_special_flag := target_special_flag + 2;
                                          sfall := 1;
                                       end 
                                 else 
                                    if (not(has_fake_perk(Imoble) >= 3)) and (target == dude_obj) then 
                                       begin
                                          target_special_flag := target_special_flag + 2;
                                          sfall := 1;
                                       end
                              end
                        end
                     if(knockdown_incapacitate >= 100 - (get_sfall_global_int("knock_04")))then
                        begin
                           if(obj_pid(target) != MYRON) and (obj_pid(target) != MARCUS) and (obj_pid(target) != CASSIDY) and (obj_pid(target) != SULIK) and (obj_pid(target) != LENNY)and (obj_pid(target) != CYBERDOG) and (obj_pid(target) != GORIS) and (obj_pid(target) != ROBOBRAIN) and (obj_pid(target) != VIC) and (obj_pid(target) != DAVIN) and (obj_pid(target) != MIRIA) and (obj_pid(target) != KLINT) and (obj_pid(target) != DOGMEAT) and (obj_pid(target) != K9) and (obj_pid(target) != DIAGO) and (obj_pid(target) != MERIS) and (obj_pid(target) != LENNY_HUMAN) and (obj_pid(target) != ROBOBRAIN_SKYNET) and (target != dude_obj) then
                              begin
                                 target_special_flag := target_special_flag + 2;
                                 sfall := 1;
                              end
                           else
                              if (has_fake_perk(Imoble) != 2) and ((obj_pid(target) == MYRON) or (obj_pid(target) == MARCUS) or (obj_pid(target) == CASSIDY) or (obj_pid(target) == SULIK) or (obj_pid(target) == LENNY)or (obj_pid(target) == CYBERDOG) or (obj_pid(target) == GORIS) or (obj_pid(target) == ROBOBRAIN) or (obj_pid(target) == VIC) or (obj_pid(target) == DAVIN) or (obj_pid(target) == MIRIA) or (obj_pid(target) == KLINT) or (obj_pid(target) == DOGMEAT) or (obj_pid(target) == K9) or (obj_pid(target) == DIAGO) or (obj_pid(target) == MERIS) or (obj_pid(target) == LENNY_HUMAN) or (obj_pid(target) == ROBOBRAIN_SKYNET)) then
                                 begin
                                    target_special_flag := target_special_flag + 2;
                                    sfall := 1;
                                 end
                           else
                              if (not(has_fake_perk(Imoble) >= 1)) and (target == dude_obj) then
                                 begin
                                    target_special_flag := target_special_flag + 2;
                                    sfall := 1;
                                 end
                        end
                     if(target == dude_obj) then
                        begin
                           random_damage := (random_damage - (get_critter_extra_stat(dude_obj, STAT_dmg_thresh) + get_critter_base_stat(dude_obj, STAT_dmg_thresh)));
                           random_damage := (random_damage - (random_damage * ((get_critter_extra_stat(dude_obj, STAT_dmg_resist) + get_critter_base_stat(dude_obj, STAT_dmg_resist)) / 100)));
                        end
                     else
                        begin
                           random_damage := (random_damage - (get_critter_extra_stat(target, STAT_dmg_thresh) + get_critter_base_stat(target, STAT_dmg_thresh)));
                           random_damage := (random_damage - (random_damage * ((get_critter_extra_stat(target, STAT_dmg_resist) + get_critter_base_stat(target, STAT_dmg_resist)) / 100)));
                        end
                     if(random_damage > 250) then 
                        begin
                           display_msg("Damage Fired" + " " + obj_pid(attack_weapon) +  " " + Get_Min(obj_pid(attack_weapon)) +  " " + Get_Max(obj_pid(attack_weapon)));
                        end
                     set_sfall_return(random_damage);
                     set_sfall_return(0);
                     set_sfall_return(target_special_flag);
                     set_sfall_return(attacker_special_flag);
                  end
            end

also the display msg never fires,even tho damage is way over 250

edit : when it is a mob with massive damage the number is always 7696217,if that helps,when it is dude it is some other number,ill try to catch it,normly diude dies tho when that happens

edit : 968884473 is the other number,sulik was killed :(

Nirran
 
every once in a while(doesnt always happen) combat damage hook script will fail to be triggered,once it happens to cure it you have to completely exit the game and reload,always fixes it,it may be happening with other hs_ scripts,megamod tech thread has a bug that armor doesnt drop,may be related to hs_ondeath not firing

edit : a couple things that have limited uses but would be realy convinient - auto save,on map enter(maybe a hook script for map enter and an auto save function)save alot of headaches with the random crashes and endless saves for the player,also a hook script for push_p_proc,that would save editing hundreds of scripts and be able to push any critter

Nirran
 
eep, that's not good. I've never seen that happen before, but if it's happening with all the hook scripts then there's probably something wrong with the code I use to load them.

I've haven't been able to find anything wrong with the damage script either. These problems which don't have any reliable way of triggering are a pita. :(

It's been a while since I last made an sfall release. I think I'm going to try and get something out by the end of the week, and then try and do a spot of bug squishing for the next one.
 
to clarify a little bit - at first my damage script was a global script using register_hook and i never seen it not fire,since i switched to hs_ it happens every once in a while(not often) maybe help a little

edit : come to think of it,i never seen that massive damage when using a global sfall script either,i renamed my hook script and am using register_hook,ill know in a few hours if the massive damage is still happening with that method

Nirran
 
hmm, it could be. The hs_* scripts are all loaded on sfall init, rather than at game load, and aren't destroyed and recreated when the player reloads, so there's room for different behaviour. I don't see why they should only break sometimes though, I'd have expected more of a complete and utter fail if it was going to break at all.
 
apparently the script was missing from the guys data folder for the lootable armor mod in the megamod tech thread,no sense in chasing a bug that doesnt exist

Nirran
 
it is odd tho, it worked untill I loaded 2.35.4 patch and it doesn't change anything in source code folder. so for some reason GL_ondeath.ssl worked for 1/2 a game then quit and I had to put hs_ondeath.ssl in there to fix it.

ether that or GL_ondeath.ssl never worked and I did have hs_ondeath.ssl in the folder before my bug but somehow it got deleated (I never cheacked for it before because armor was droping and I was happy).

I'm Tottaly confused as to what realy happend because after 2 or 3 days of troubleshoooting I tottaly removed all traces of Fallout 2 and patches and mods from my pc even the RAR and ZIP files and did a tottal fresh instal of everything and still couldn't get armor to drop till I too those 2 files out of your armor drop mod Nirran and put them in the source code folder. (I meen it doesn't add up 10+10 = 20 before but after it messed up even a compleat reinstall culdn't make 10+10 = 20 without me adding 2). at first I thought my Norton antiviruse curupted the code or something but after a compleat fresh reinstall I should have been fine till next scan. witch wuld have been a few days without me telling it to scan now. now all I can do is wonder how I had armor droping in my game in the first place without the right files in the things I downloaded.
 
source code folder has the code written for the scripts and is provided to allow people to learn how to mod,the game doesnt actualy use those files,the files you need are either gl_ondeath.int or hs_ondeath.int,one or the other,delete one of them,they should be in you data\scripts folder
 
Nirran said:
source code folder has the code written for the scripts and is provided to allow people to learn how to mod,the game doesnt actualy use those files,the files you need are either gl_ondeath.int or hs_ondeath.int,one or the other,delete one of them,they should be in you data\scripts folder

I curently have both and first encounter after lading hs_ondeath.ssl a slaver droped a leather armor. but like I said in other thread I thought carie weight was what origanaly made my armor stop droping. well what do you know but that slaver that had that leather armor had ALOT of slaves with him that I took for my own and with all the strong back perks from haveing the slaves I now have a weight limit of 450 and encountered robers 2 times with no armor drops out of over 10 robers that looked like they have leather jakets on. odd thing is I fought both the rober encounters at dusk and after I changed time to daytime to recharge my solar scorcher and the lighting stayed at dusk lvl even turning the time to noon. well the short story is ether weight limit busted the armor drop AGIN and or rober encounter is buged.
I will remove GL_ondeath.ssl tho if I didn't I would think all that would go wrong would be me getting 2 armor drops per person that drops armor (but out of hs and GL I have had GL in the longest with it not working so I will remove it.).
 
New version is up. Given that quite a lot has changed, and that 49 was already a big enough number, I've called it 2.0 instead of going on to 1.50.

>Added new hook scripts hs_findtarget and hs_useobjon
>Added an option to skip the opening movies
>Made a fix to the line of fire fix
>Added an option to give npcs a second chance to spend left over ap at the end of their combat round
>Added new script functions to manipulate weapon ammo
>Added an option to allow the use of tiles larger than 80x36
>Added an option to directly control party members in combat (buggy)
>Multiplayer support (buggier)
>New script function: write_string
>Added an option to replace the mouse cursor used when using skills. (From Helios)
>Added new window related script functions. (From Helios)
I haven't uploaded the client part of the multiplayer bit yet. It's still suffering from a crash problem when the mouse gets moved over the in game interface that I want to fix first.
 
Timeslip said:
New version is up. Given that quite a lot has changed, and that 49 was already a big enough number, I've called it 2.0 instead of going on to 1.50.

>Added new hook scripts hs_findtarget and hs_useobjon
>Added an option to skip the opening movies
>Made a fix to the line of fire fix
>Added an option to give npcs a second chance to spend left over ap at the end of their combat round
>Added new script functions to manipulate weapon ammo
>Added an option to allow the use of tiles larger than 80x36
>Added an option to directly control party members in combat (buggy)
>Multiplayer support (buggier)
>New script function: write_string
>Added an option to replace the mouse cursor used when using skills. (From Helios)
>Added new window related script functions. (From Helios)
I haven't uploaded the client part of the multiplayer bit yet. It's still suffering from a crash problem when the mouse gets moved over the in game interface that I want to fix first.

Wow timeslip great job!

Really love some of the fixes especially the option to give npcs a second chance to spend left over ap at the end of their combat round.

Looking forward to see the NPC control and multiplayer fuctions working well!
anyways great job as always Timeslip
 
Oracle said:
Looking forward to see the NPC control and multiplayer fuctions working well!
The NPC control mostly works already. Just avoid trying to enter any menu screens while controlling anyone other than the player.

I don't mind the character editor etc not working properly, but the fact that the inventory menu doesn't work is why I've tagged it as buggy. It means you can't do things like use stimpacks.

Edit: meh, actually it seems I left some debug code in there which means that if you turn it on you'll end up taking control of every critter, whether they're in your party or not. Might want to avoid using it for a bit. :P
 
What is the biggest possible tile size now? (Did I asked this already? Can't remember. Huh) And: Would it be possible to deactivate the size limit of scenery graphics too?
 
Lexx said:
What is the biggest possible tile size now? (Did I asked this already? Can't remember. Huh) And: Would it be possible to deactivate the size limit of scenery graphics too?
There is none. The only limit is that there's a maximum of 65535 different tiles, and that the large tiles still count towards it as if they were split up. (Obviously, since sfall does in fact split them up...)

I probably wont do the same thing for scenary. It would have to be split in a similar way, which I couldn't do in the same was as tiles because there's no regular size and grid.
 
Hey Timeslip,

have you finally figured out the level 6 NPC bug? It's still a pain in the butt for us party maniacs and we still have to switch protos every time we install F2, which is annoying at best.

I recall you did manage to make level 6 happen like a year ago, but the game refused to load the appropriate stats and loaded 999 HP for Sulik instead.
 
DForge said:
My answer hasn't changed since the last time it was asked. Trying to fix it in the engine caused too many other problems, so just do it via script instead.
 
You mean, by the classical rename proto 315 to proto 314 and put in data folder and so on?

Or something else? Sorry, I'm really poor in modding. Do you have any particular script in mind?
 
Back
Top