new features for sfall

Ghoul [BB]

First time out of the vault
I would like to ask the author of SFALL to add new option to his mod - custom grenade and rocket explosion radiuses.

These offsets are located in fallout2.exe:
0x753F0 [03] - rocket explosion radius
0x753E0 [02] - grenade explosion radius

it would be very funny to make these options editable!
 
I think that is a great idea, maybe create special fragmentation grenades and rockets.

I have a question regarding the latest Sfall, what does the EncounterTableLimit option do? Is that a way to increase the amount of baddies you can encounter?
 
That's a very good find! Maybe you can add this yourself?
Really cool would be new scripting command like set_explosion_radius. We could call it inside "afterhitroll" script and change blast radius according to weapon PID.
Another great thing would be to change blast effect. Right now it's hard coded...

You better off posting this to a proper thread: http://www.nma-fallout.com/showthread.php?178390-FO2-Engine-Tweaks
However, AFAIK, the only person who actively develops sfall is Timeslip. So you will have to implement this yourself or ask someone else to do it and make merge-pull request for Timeslip to approve.
There is even a dedicated WIKI page: http://falloutmods.wikia.com/wiki/Sfall_Requests

As you can see, there are many requests already.


Edit: forgot to mention, there is scripting command write_int which you can probably use to change blast radius on the fly. However, it will require "AllowUnsafeScripting" to be enabled in ddraw.ini.
 
Last edited:
Where did you get that offsets? Have you tested them yourself? Changing 0x753E0 doesn't change explosion radius in game and at 0x753F0 there's not even a [03].

Found offsets that actually work. It's 0x00479183 (int, default 2) and 0x0047918B (int, default 3).
Tested them using this functions:

Code:
   write_int(0x00479183, 6); // grenade radius
   write_int(0x0047918B, 2); // rocket radius
However, there seems to be some additional explosion distance limitation, because setting radius to something more than 8 hexes doesn't seem to work.

I propose to add new sfall functions like "set_explosion_radius(int type, int radius)", but first I will test them more and try to also find how to change radius for other explosion types.

Update: looks like "rocket" radius also applies to ALL explosion except grenade (rockets, dynamite, explosion() script command), according to my testing.
So we will only need 2 types here.

Update #2: funny, the information was there, all this time... http://teamx.ru/site_arc/docs/f2offsets.7z (in russian)
 
Last edited:
Found explosion art ID offsets!!!

Code:
write_int(0x00412D47, 15); 
write_int(0x00412DB5, 15);

You need to specify only ART ID (the last 3 bytes, without first). The default value is 10. You can see all art types in mapper by opening proto editor on some misc object and browsing art.
This explains why I couldn't find this before, I searched for the whole art/proto ID (4 bytes), but in reality, engine calls function like this:
Code:
art_id_(5, 10, 0, 0, 0);
First argument is art type (same as object types: item, scenery, etc.), second is art ID.
0x00412D4C, 0x00412DBA - these are art type offsets.

Now I will try to find out how to change art ID for grenades/rockets.
 
Great! It means, that it would be possible no add new explosion effects to scenery and into the game!! My dream is to make exploding plasma balls...
 
Ghoul [BB];4024478 said:
Great! It means, that it would be possible no add new explosion effects to scenery and into the game!! My dream is to make exploding plasma balls...

I forgot to mention important thing. Explosion art effects are created in pattern, about 5 objects if I'm not mistaken. So when I changed FID to flying plasma projectile, I saw 5 of them hanging in the air.
Not sure what to do about it yet :)

I think 1 effect instead of 5 would make more sense for grenades (and look more realisticly), maybe I will also manage to find how to change this pattern...

My own possible gain from this (for my mod):
1) proper explosion radius for my grenade launcher
2) smaller explosion effects for grenades (maybe)
3) different explosion effect for molotov cocktail/incendiary grenades

Would also be cool to "fix" explosion command not working in combat.. but something tells me this won't be easy (I suspect some hard-to-understand mechanics are involved).
 
I was going to suggest, if everything else fails, to simply add an "empty" frame to the final explosion art, so even if it's left hanging in the air for a round (like it does now), you don't see it. ^^

Not to mention that I have a ton of ideas which are much easier to do if handling arrays is easier to do. You can fix a lot of crap with it, I'm sure, I just have to catch phobos with less work backlog, and talk him into it.

Especially now that he's found more info on how the exe works ^^
 
Last edited:
Ghoul [BB];4024490 said:
Probably, you know, how to modify dynamite and plastic explosives damage?

It's hard-coded too. But it was easy to find:
Code:
if ( explosivePid == 51 || explosivePid == 206 )
  {
    maxDmg = 50;
    minDmg = 30;
  }
  else
  {
    maxDmg = 80;
    minDmg = 40;
  }
  if ( v3 && perk_level_(v3, 82, v3) )
  {
    maxDmg += 10;
    minDmg += 10;
  }

You simply change this values. Offsets:
Dynamite: 0x4A2873 (max dmg, int) - 0x4A2878 (min dmg, int)
Plastic: 0x4A287F (max dmg, int) - 0x4A2884 (min dmg, int)

I also managed to find how exactly explosion effects work and how to reduce effect size. Still thinking on how (and IF) to add this to sfall. I'm thinking maybe I should just enable unsafe scripting in sfall, do hacks in scripts and call it a day :)

For those interested, this is how game selects explosion art for ranged attack explosions:
Code:
          if ( isExplosion )
          {
            if ( damageType == DMG_emp )
            {
              explosionArtId = 2;
            }
            else
            {
              if ( damageType == DMG_plasma )
                explosionArtId = 31;
              else
                explosionArtId = 29;
            }
          }
          else
          {
            explosionArtId = 10;
          }

So we have several options here:
1) add new hookscript (overkill)
2) add new opcode that will change each of these hard-coded values (including ones posted above)
3) do nothing, use unsafe scripting and be happy :)
 
Last edited:
For those interested, this is how game selects explosion art for ranged attack explosions:
Code:
          if ( isExplosion )
          {
            if ( damageType == DMG_emp )
            {
              explosionArtId = 2;
            }
            else
            {
              if ( damageType == DMG_plasma )
                explosionArtId = 31;
              else
                explosionArtId = 29;
            }
          }
          else
          {
            explosionArtId = 10;
          }

If it's not an explosion, then... give it explosion art? :D Is that right?
Also, is FID 10 the explosion for plastic/dynamite explosives?

Code:
if ( v3 && perk_level_(v3, 82, v3) )

This is what I mean by the pseudocode being subpar: it's probably more like "if(source_obj == dude_obj && perk_level_(dude_obj, 82)) ..." but it can't figure that out.
 
If it's not an explosion, then... give it explosion art? :D Is that right?
Also, is FID 10 the explosion for plastic/dynamite explosives?
Yes, 10 is generic explosions, including "explosion" command.

Code:
if ( v3 && perk_level_(v3, 82, v3) )
This is what I mean by the pseudocode being subpar: it's probably more like "if(source_obj == dude_obj && perk_level_(dude_obj, 82)) ..." but it can't figure that out.

Well, that is still better than tracing several registers manually to an unnamed function... It's just a matter of time to figure out most of the gibberish - we have full documentation on most scripting commands, which in turn touch most of the game systems, so you can trace variables from script and understand which argument is what (or sometimes it's becoming clear after staring at the code for time :D).
 
Probably, this is a desidion of the problem of hanging in the air plasma, laser and electic projectiles...

if I

simply change this values. Offsets:

Dynamite: 0x4A2873 (max dmg, int) - 0x4A2878 (min dmg, int)
Plastic: 0x4A287F (max dmg, int) - 0x4A2884 (min dmg, int)

sfall fill not allow to start modifyed fallout2.exe.. the same crap with explosion radiuses.

BTW, how to increace plasma balls speed? And is it possible to make a beam for laser rifle? (i mean instant hit attack with the beam trace)?
 
Last edited:
Back
Top