Fallout 2 mod FO2 Engine Tweaks (Sfall)

Timeslip said:
16 bit would imply a limit of 65535, not 1024, but there's no hard limit in sfall; as long as you can keep supplying it with different strings it should keep going. You may be hitting a different limit. Is there a limit on the number of strings you can include in one script? If you take your perk script up to the point of crashing, and then start using more globals from other scripts does it still crash?

"16 bit would imply a limit of 65535, not 1024"
my bad

"Is there a limit on the number of strings you can include in one script? "
not sure

it actually doesn't crash,it causes another script to not set a global,my perk_per script triggers if the player level is not the same as a global,and it displays "you have a perk waiting to be chosen" then sets a global to prevent spam(and other things) with that many globals it spams the message over and over

edit : this is the format of the different strings i've been using,i am up to almost 2k "perk0001" as far as i know i haven't duplicated any strings,and that format is used in 2 scripts,i've been careful not not duplicate any

edit : those that want to know get_attack_type returns are
Code:
Left Weapon Mode 1        0
Left Weapon Mode 2        1
Right Weapon Mode 1       2
Right Weapon Mode 2       3
Punch                     4
kick                      5 
donno 6 or 7
Strong Punch              8
Hammer Punch              9
Haymaker                  10
Jab                       11
Palm Strike               12
Piercing Strike           13
Strong Kick               14
Snap Kick                 15
Power Kick                16
Hip Kick                  17
Hook Kick                 18
Piercing Kick             19

edit : kudos Timeslip,the Megamod problem with on death weapon drop is fixed,i just did the tyler fight in the den with it enabled,no crashes or problems

edit : narrowed the problem somewhat,slowdown happens when a list_critter or list_item is fired,with multiple running it slows to unplayable,tho previous versions of sfall i had the same exact lists without slowdown,hope that helps

edit : assuming that the amount of strings has a limit per script,i separated the set_global function into 5 separate scripts,then tested it,it still didn't set the global in my perk_per script,boo hoo

edit : i am assuming arg2 or arg3 is the action type ,no idea what the table would be tho(the numbers)
Code:
hs_calcapcost.int

critter arg1 - The critter performing the action
int     arg2 - No idea
int     arg3 - Still no idea
int     arg4 - The normal ap cost

int     ret1 - The new ap cost

edit : pretty sure ive either not reached the max string amount(tho one script had almost 3k) or the game/sfall does not limit it,ive seperated much of my custom perks mod into a few smaller mods,and now a different sfall global is not setting

Nirran
 
Nirran said:
edit : narrowed the problem somewhat,slowdown happens when a list_critter or list_item is fired,with multiple running it slows to unplayable,tho previous versions of sfall i had the same exact lists without slowdown,hope that helps
looping through critters/items has always been slow; I believe I warn in the function comments against doing so every frame. I haven't touched that code for ages though, and you said that you still had slowdown even with all the global scripts removed, so that doesn't sound like the cause. That it's become slower than 2.2 is more likely another symptom of whatever is really causing the slowdown. (i.e. when sfall builds the list it calls into fallout code, which is presumably calling back into sfall at some other point.) In any case, I should have some free time tonight, so I'll do a bit of experimenting of my own. (Been at dwmud febmeet this weekend, so haven't been working on anything.)

I still think your global problem is due to some internal fallout limit that you're hitting. If not in one script, there may still be a limit on the total number of strings across all loaded scripts or something. It may be worth me making a get/set global function that uses an integer argument instead of a string, and seeing what happens. I'll do so the same time I hashmapify it.
 
Timeslip said:
I still think your global problem is due to some internal fallout limit that you're hitting. If not in one script, there may still be a limit on the total number of strings across all loaded scripts or something. It may be worth me making a get/set global function that uses an integer argument instead of a string, and seeing what happens. I'll do so the same time I hashmapify it.

ok then,would it be possible to use a msg file for the strings?

edit : definitely strings,changing to a msg file for the strings in multiple sfall globals allowed the setting of a global that previously wouldn't set with close to the exact same mods,possible to add msg file support for global scripts?kind of want my sfall mods to be usable by any mod setup

edit : belay my last,integers would be better

edit : did another test without any globals active and tho the player speed running didn't seem to change much between 350% and 1000%,in combat it was obvious that the speed did increase(because the combat looks flashed faster) i think i may have made an erroneous post when i said the speed didn't change,sorry about that if you spent any time trying to find a cause,i think all of it is related to the amount of global vars i have running

edit :
Timeslip said:
That it's become slower than 2.2 is more likely another symptom of whatever is really causing the slowdown.
this is actually true,but it didn't happen for half of a game i played,was a little slower to begin with(difference between run speed and combat was slightly slower)then once i was about to head to modoc(6th town for MM the way i play it) i had severe slowdown when on random encounter maps,tho i believe that it was due to globals being set,the mods running were slightly different then the mods i used for 2.2(same mods but code was different)i will test right now with a save that has the slowdown with 2.2

edit : 2.2 with the same mods had extreme slowdown,i still believe it was the global vars

Nirran
 
Looks like I was completely wrong. I was just adding the integer global id thingy, and came across a check in sfall to prevent any more than 1024 globals being added at once... I don't remember putting that in; it must have been something I did to keep the slowdown problem in check. I'll do something about it for the next release.

I've left the option to use integers in anyway. I prefered strings because you could add a prefix to them all (I used "TS_") to separate them from other peoples, and you could make them meaningful. Integers will be faster if you're doing a lot with them though.
 
Timeslip said:
Looks like I was completely wrong. I was just adding the integer global id thingy, and came across a check in sfall to prevent any more than 1024 globals being added at once... I don't remember putting that in; it must have been something I did to keep the slowdown problem in check. I'll do something about it for the next release.

in that case i wonder why using a msg file for the global strings canceled the 1024 limit?anyway thnx Timeslip

Nirran
 
Nirran said:
when the car is in use and an encounter is forced,then on the map the car is disabled,when you leave the map,regardless if it is with or without the car,the engine gives the car to the player,then the next map that is loaded by the engine(not using force encounter) the player wont have the car,possible to fix this?simple function to load worldmap without the car wopuld be perfect
Right, time to deal with this one.

Is removing the car from the player really the way around that? :?

It sounds more like a force_encounter bug. The car position isn't being properly updated afterwards.
 
Timeslip said:
Nirran said:
when the car is in use and an encounter is forced,then on the map the car is disabled,when you leave the map,regardless if it is with or without the car,the engine gives the car to the player,then the next map that is loaded by the engine(not using force encounter) the player wont have the car,possible to fix this?simple function to load worldmap without the car wopuld be perfect
Right, time to deal with this one.

Is removing the car from the player really the way around that? :?

It sounds more like a force_encounter bug. The car position isn't being properly updated afterwards.

yea it is a force_encounter bug,thought it may be easier to add a simple function,either way,w/e you think is best

Nirran
 
Nirran said:
yea it is a force_encounter bug,thought it may be easier to add a simple function,either way,w/e you think is best

Nirran
Well, removing the car wouldn't be a 'simple function'. On the other hand, a function to set the current map that the car is sitting in would be, with the caveat that it probably wouldn't take effect until the map was reloaded.

Really I haven't looked at the car too much. I know well the effects it has on the world map, but not the machinary that handles giving it, removing it or moving it around. I'm not sure how much you can manipulate it with scripts already. I see functions for refueling, checking if it's empty, and checking the current area in which the car is sitting, but not anything else. (Noticeably, I don't see any functions for removing the car, so I've no idea how the new reno theft works... It looks partially hardcoded.)
 
new reno theft is handle with the car body script,and the map script of vigin street,i did similar to break the car using force encounter,its how i found the bug

edit : the only thing i know of thats close to what your after is that the engine loads the worldmap when dude steps on a brown exit grid and metarule(31, 0) loads the worldmap with the car,youve prolly already thought of those,anyway,hope that helps

Nirran
 
ok, this seems even more complicated than I thought...

The problem is that because force_encounter causes a random encounter, the player isn't considered to be in a town. However the car position is updated to the town of the which ever map you force_encounter too regardless. For actual random encounter maps, since that's the normal behaviour, everything is fine and when you leave you take the car with you correctly. For other maps, things go horribly wrong, because the map scripts assume that what just happened to them isn't possible. When you get to your destination, the engine updates the car current location correctly, but the map script doesn't spawn the car.

Since I don't really feel like adjusting every map script that handles a car, my workaround is to create a new force_encounter2 function that forces the encounter without spawning the car on the map. It's not perfect (you wont get access to the car trunk in the encounter,) but it means that you'll still have your car when you get to your destination.

Edit: 2.4 is up. I went with a force_encounter_with_flags function, to leave in the possibility of adding other special options later on without having to make more functions.
Code:
>New script function: force_encounter_with_flags
>Added an option to save the console contents to a file
>get/set_sfall_global can now optionally take an int instead of a string
>The limit of 1024 sfall globals has been removed
>sfall globals are now far faster if many are in use at once
 
Timeslip said:
Edit: 2.4 is up.
Code:
>Added an option to save the console contents to a file

Timeslip very thanks! :D

I have a question about Multiplayer.
Does it work in/via internet? Or only LAN?
 
Cubik2k said:
I have a question about Multiplayer.
Does it work in/via internet? Or only LAN?
It theoretically works over the internet, but the bandwidth requirements are a bit steep. It doesn't behave very well if the bandwidth can't keep up with the data it's trying to send either. I haven't tested it on any link slower than 40mb.

I didn't really see the point in putting a decent link in until the gameplay problems are fixed, which will very likely be never.
 
Timeslip said:
Edit: 2.4 is up. I went with a force_encounter_with_flags function, to leave in the possibility of adding other special options later on without having to make more functions.
Code:
>New script function: force_encounter_with_flags
>Added an option to save the console contents to a file
>get/set_sfall_global can now optionally take an int instead of a string
>The limit of 1024 sfall globals has been removed
>sfall globals are now far faster if many are in use at once

thnx Timeslip

edit : hs_combatdamage doesn't fire other then on init_hook
edit : hs_tohit doesn't fire either

edit : pretty sure 3 in this arg(hit miss) triggers calculation that determines special text(knocking the stuffing out it,etc) and bypass armor,and 0 is critical miss
Code:
hs_afterhitroll.int

Runs after fallout has decided if an attack will hit or miss

int     arg1 - If the attack will hit. (2 = hit, 1 = miss, not sure if other values are allowed)
critter arg2 - The target of the attack
critter arg3 - The attacker
int     arg4 - The bodypart
int     arg5 - The hit chance

int     ret1 - Override the hit/miss
int     ret2 - Override the targeted bodypart
critter ret3 - Override the target of the attack

edit : 0 is definetly critical miss,and 3 is armor bypass calculation(it does a check,3 will pop up alot without bypass,but it never does bypass without returning a 3)

edit : while the above 2 hook scripts dont fire except on load,if you add register_hook and then put the type it is,it will work normaly

edi9t : register hook is buggy when used with hs_ scripts(i know it isnt the way it was ment to be)

Nirran
 
Any idea why the latest Sfall won't work with the latest High-res patch?

Here's what I did:

- Fresh FO2 install.
- Applied MIB88 Megamod 2.35.2 + 2.4 + 2.41.
- Applied Sfall 2.4.
- Applied High-res patch 2.2a.

It gives me a CRC error when I try to run the game, saying it expected 1.02d. It works fine without the High-res patch. Using the version of Sfall that comes with the Megamod makes no difference.
 
try using the exe from the official patch from interplay,CRC is a checksum error,its looking for known exe,i run the game with those mods and i dont recieve an error

Nirran
 
Nirran said:
edit : hs_combatdamage doesn't fire other then on init_hook
edit : hs_tohit doesn't fire either

edit : while the above 2 hook scripts dont fire except on load,if you add register_hook and then put the type it is,it will work normaly

edi9t : register hook is buggy when used with hs_ scripts(i know it isnt the way it was ment to be)
I can't replicate any of these problems. With a script folder containing just hs_tohit.int it fires fine every hit calculation. Adding a gltohit.int doesn't break anything; they both run together as expected.

To clarify how multiple scripts attached to the same hook are supposed to work, they get run in reverse order, so that the lowest script in the chain takes precedence if they all try and call set_sfall_return. (i.e. if you have a hs_xxx and a gl_xxx both attached to the same hook and both calling set_sfall_return, it will be the hs_xxx script that will 'win'.)

edit : pretty sure 3 in this arg(hit miss) triggers calculation that determines special text(knocking the stuffing out it,etc) and bypass armor,and 0 is critical miss
It's the same as any other dice roll calculation. 0 is critical fail, 1 is fail, 2 is success, 3 is critical success. (Edit: and I've only just noticed that is_critical and is_success are both proper function calls, and not simple defines like I expected, so that's hidden from normal scripters... Seems a bit of a waste.)
 
Timeslip said:
Nirran said:
edit : hs_combatdamage doesn't fire other then on init_hook
edit : hs_tohit doesn't fire either

edit : while the above 2 hook scripts dont fire except on load,if you add register_hook and then put the type it is,it will work normaly

edi9t : register hook is buggy when used with hs_ scripts(i know it isnt the way it was ment to be)
I can't replicate any of these problems. With a script folder containing just hs_tohit.int it fires fine every hit calculation. Adding a gltohit.int doesn't break anything; they both run together as expected.

to clarify,i added register hook to the hs_ versions,caused bugs,some crashes

Nirran
 
Nirran said:
to clarify,i added register hook to the hs_ versions,caused bugs,some crashes

Nirran
Argg, yes, that would break all over the place. register_hook should be called from gl_ scripts only.

Doesn't explain why your hs_tohit isn't running though... Are you sure the script isn't crashing somewhere? Try replacing it with a simple one that does nothing other than display_msg.
 
ok ill try

edit : i swear it wasnt firing before,but it is now *shrug*

edit : combatdamage fires too but it crashed after a few attacks,played with the exact same script 2-3 hours(gl_ version) yesterday no crashes

edit : to clarify,tohit fires with both my code and the stripped display code

edit : would it be possible to add get and return target and attacker special flags in hs_afterhitroll hook script?or does it only use the hit_miss int for the text?actualy what im realy after is being able to set the critical table text that is returned,that possible?

edit : pretty sure my damage formula script is complete except for one thing,i cant determine what body part was targeted to allow for crippling the target,any way it is possible to return that?

edit : nice,sfall globals can take an argument instead of a static int,convinient,kudos

edit : even better then returning text is being able to set this bit flag,this is effect in critical tables(taken from the website noted in the script functions readme)
Code:
0x01000000 - knockout
0x02000000 - knockdown
0x04000000 - crippled left leg
0x08000000 - crippled right leg
0x10000000 - crippled left arm
0x20000000 - crippled right arm
0x40000000 - blinded
0x80000000 - death
0x00040000 - on fire - triggers the 'flamedance' animation, but not if the hit is fatal (probably a bug)
0x00080000 - bypass armor
0x00400000 - dropped weapon (doesn't work)
0x00800000 - lose next turn
0x00002000 - random
or if i missed what the functions do,please enlighten me :)

Nirran
 
what are the values for the int's in this function?and does it do what i asked for in the post before this?

Code:
set_critical_table(int crittertype, int bodypart, int level, int valuetype, int value)

edit : i think that maybe this bug is due to sfall,not sure,but ive played with the scripts that caused this for months,maybe a year,and didnt find the bug untill yesterday
Nirran said:
MSlavko82 said:
I have problem with car. I bought it from Smitty, entered it and moved to Den-east map, saved there. When I load game, there is no car. I tried with other maps (Den-West, Collyweb, Modoc, Redding) and it is same - once I reload the game, car is gone :(

this is fixed in the up and comming patch,i found this bug yesterday,pm me an email you have access to and i will send the script that fixes it,the problem is that on faster computers,the game loads the map before metarule(car current town) is updated and it returns -1 rather then the town the car is curently on,i added a check that checks good for -1,and as the code checks some things if(stuf and metarule) then place car end else delete car,it will do that,sorry about that,the fix is only one script

Nirran

Nirran
 
Back
Top