Question About World's Speed

Sonim

First time out of the vault
What is the file that determines the world's speed? Can I implement FO1's world's speed code into FO2? I know that Sfall or Killap's patch fix the speed problem in FO2, but I am asking this for learning purposes.
 
Most options can be found in sfall's ddraw.ini. Options such as: WorldMapTimeMod=, WorldMapFPSPatch, WorldMapDelay2 etc'.
 
Most options can be found in sfall's ddraw.ini. Options such as: WorldMapTimeMod=, WorldMapFPSPatch, WorldMapDelay2 etc'.
Is there a way without Sfall installed? I mean, a way to directly change the game's code?
 
Yes, but only if you are a really good programmer and can hack the fallout2.exe accordingly.

Considering Sfall exists, I'll doubt anyone else will try their hands on such a feat.
 
Yes, but only if you are a really good programmer and can hack the fallout2.exe accordingly.

Considering Sfall exists, I'll doubt anyone else will try their hands on such a feat.
Firstly, thanks for your replies, this is the second time you are helping me. I don't mind the difficulty really, I want to learn some programming with the game's code. Is the world's speed determined by the .exe file? I thought it was coded in others files.
 
All this is engine level stuff, so you have to look for that inside the fallout2.exe file. You have to read out bytes and compare and do god knows what else. This is not noob stuff, and I have absolutely no idea how it works.
 
All this is engine level stuff, so you have to look for that inside the fallout2.exe file. You have to read out bytes and compare and do god knows what else. This is not noob stuff, and I have absolutely no idea how it works.
Thanks for the orientation, I will give it a look.
 
On a related question (I think), how would you change the travel speed between not having a car and having a car? I mean, is there a simple global variable that you change? Also, the car has 2 speeds in fallout 2, are these the same variable? And how to write a script to attach to a car so I can use it to change world map speed?
 
I can't seem to find a script for the car.
Since it's a scenery object the proto manager doesn't have access to it, and when I try to open the Den map in the mapper the car itself isn't there, nor can I find a spatial script or anything.

Adding a car to a map only places the car, there doesn't seem to be a script attached to it by default, although the player can still "use" the car. There must be a fairly complicated script out there somewhere, since in the game you can charge the car with power, use repair skill and the part on it to get it, and clicking on it will take you to the world map at a faster travel rate than walking.

Can anybody point me to the script that's being used here?
 
Have you checked HOOK_CARTRAVEL in hookscripts.txt?
And the car travel mechanism is hardcoded in the engine like tons of other stuff, not some complicated script.
 
Last edited:
I can't seem to find a script for the car.

Check these out in define.h:
Code:
#define METARULE_CAR_CURRENT_TOWN  30
#define METARULE_GIVE_CAR_TO_PARTY 31
#define METARULE_GIVE_CAR_GAS      32
#define car_current_town         metarule(METARULE_CAR_CURRENT_TOWN, 0)
#define car_give_to_party        metarule(METARULE_GIVE_CAR_TO_PARTY, 0)
#define car_give_gas(AMOUNT)     metarule(METARULE_GIVE_CAR_GAS, AMOUNT)
Also, check out denbus1.ssl for how to add or remove the car from the map, depending on if you brought it with you or not.

This is the procedure when you get the car.
Code:
procedure Node012 begin
   gfade_out(ONE_GAME_SECOND);
      game_time_advance(ONE_GAME_HOUR);
      set_smitty_part(state_smitty_part_given);
      item_caps_adjust(self_obj,2000);
      item_caps_adjust(dude_obj,-2000);
      set_global_var(GVAR_PLAYER_GOT_CAR, 1);
      remove_pid_qty(dude_obj, PID_CAR_FUEL_CELL_CONTROLLER, 1)
   gfade_in(ONE_GAME_SECOND);
   Reply(370);
   NOption(371, Node990, 004);
end

As you can see, it just changes a global var from 0 to 1.
Once you enter a map, the map script should check if you "have the car", then add/remove the car to the map.
Once the car is there(use macro - "Create_Car(CAR_UNCLAIMED_HEX, CAR_UNCLAIMED_ELEV)"), then I think it works as usual. More specifically, the macro makes a scenery car, then adds a script to it - "ZCDRVCAR". The trunk has a different script - "ZICITRNK".
 
Last edited:
Adding a car to a map only places the car, there doesn't seem to be a script attached to it by default, although the player can still "use" the car.

The car scenery is created and deleted via script. It in itself is just visuals and doesn't do anything. Traveling by car is just "a fake" as well - the game tracks where you are, where the car should be, and then spawns the scenery into the map to a specific place. Using the car object will set a variable and moves you to the worldmap which will then act differently.

Adding in a new car can be quite complicated, as you have to define spawn points for every single map and keep track of its position (especially bad if it's a town location with multiple maps and you want the player to be able to enter all these maps with the car). Thanks to Sfall and global scripts it is now possible to put all that shit into a single file, though, so making a completely new car system is probably easier than trying to mimic the original Fo2 car.
 
Check these out in define.h:
Code:
#define METARULE_CAR_CURRENT_TOWN  30
#define METARULE_GIVE_CAR_TO_PARTY 31
#define METARULE_GIVE_CAR_GAS      32
#define car_current_town         metarule(METARULE_CAR_CURRENT_TOWN, 0)
#define car_give_to_party        metarule(METARULE_GIVE_CAR_TO_PARTY, 0)
#define car_give_gas(AMOUNT)     metarule(METARULE_GIVE_CAR_GAS, AMOUNT)
Also, check out denbus1.ssl for how to add or remove the car from the map, depending on if you brought it with you or not.

This is the procedure when you get the car.
Code:
procedure Node012 begin
   gfade_out(ONE_GAME_SECOND);
      game_time_advance(ONE_GAME_HOUR);
      set_smitty_part(state_smitty_part_given);
      item_caps_adjust(self_obj,2000);
      item_caps_adjust(dude_obj,-2000);
      set_global_var(GVAR_PLAYER_GOT_CAR, 1);
      remove_pid_qty(dude_obj, PID_CAR_FUEL_CELL_CONTROLLER, 1)
   gfade_in(ONE_GAME_SECOND);
   Reply(370);
   NOption(371, Node990, 004);
end

As you can see, it just changes a global var from 0 to 1.
Once you enter a map, the map script should check if you "have the car", then add/remove the car to the map.
Once the car is there(use macro - "Create_Car(CAR_UNCLAIMED_HEX, CAR_UNCLAIMED_ELEV)"), then I think it works as usual. More specifically, the macro makes a scenery car, then adds a script to it - "ZCDRVCAR". The trunk has a different script - "ZICITRNK".

Thanks! I was able to find the entry in define.h and the code in Smitty's script, but I can't find ZCDRVCAR.ssl or ZICITRNK.ssl...heck I can't even find the .int files for them...

But I did find ZSDRVCAR.ssl and ZICRTRNK.ssl in the GENERIC folder, are these the ones I'm looking for?

Also, if ZSDRVCAR is the correct file, then the relevant script command looks like it might be:
Code:
car_was_used_to_exit := true;
play_sfx("carstart");



Thanks to Sfall and global scripts it is now possible to put all that shit into a single file, though, so making a completely new car system is probably easier than trying to mimic the original Fo2 car.

Really? That would be AWESOme!
 
Thanks! I was able to find the entry in define.h and the code in Smitty's script, but I can't find ZCDRVCAR.ssl or ZICITRNK.ssl...heck I can't even find the .int files for them...

The .int files should be part of master.dat. You can explore and extract using "Fallout 2 dat explorer" which you can find pretty easily. I think you can find this tool here https://www.nma-fallout.com/threads/fallout-database.200205/


But I did find ZSDRVCAR.ssl and ZICRTRNK.ssl in the GENERIC folder, are these the ones I'm looking for?

These are the ones. As far as I can tell, you don't have to change anything in the ZSDRVCAR.ssl, even if you add new maps to the game. The trunk has to be modified.


Also, if ZSDRVCAR is the correct file, then the relevant script command looks like it might be:
Code:
car_was_used_to_exit := true;
play_sfx("carstart");
This is one of the relevant commands for the car. As I said, for now, unless you specifically need to, you shouldn't change anything here.
What you do need to change in order to use the car in game, is to decide via script when do you "get the car" (global var GVAR_PLAYER_GOT_CAR). If you add another map to the game, you should mod the trunk script, ZICRTRNK, and spawn points and stuff, as Lexx mentioned.
 
Really? That would be AWESOme!

Just put a map_enter_p_proc into a global script and add all the necessary conditions into it. You just have to check for the current map and see if the car is supposed to be here ... if yes, create the scenery, if no delete the scenery (if it is already in the map). Well, that's the gist of it at least.
 
Back
Top