load_map command

QuantumApprentice

Look, Ma! Two Heads!
The load_map command is used to change maps for the player using some trigger.

The definition for this command is listed in the map scripting document as this:

Code:
load_map void Map

map_name (string or int)
start_location (int)

Loads a new map (map_name), removing all scripts currently running
and passing on the entrance location (start_location) to the new map’s
map_init script. Can also use the number representing the map in the
map list (for example, between 0 to 64 in Fallout 1)
https://falloutmods.fandom.com/wiki..._scripting_-_commands,_reference,_tutorials#L

I'm trying to figure out what the start_location actually does.
I want to load a map and start the player on a specific level, or a specific hex, but I'm not finding anything that explains this.
I borrowed a spatial script from Oblivion Lost mod that used this command to switch maps for the ending, and it works to switch maps, but it always spawns dude_obj on the same default starting position no matter what number I use.
Any help?
 
Digging through the manual, it looks like there are a couple of other commands that may work better, can anybody give me their opinions on these?
Code:
[B]goto_xy[/B]

Map

(Moves the character to the specific map?) [URL='https://falloutmods.fandom.com/wiki/User:Sduibek']Sduibek[/URL] ([URL='https://falloutmods.fandom.com/wiki/User_talk:Sduibek']talk[/URL]) 18:03, August 4, 2012 (UTC)

...and...

Code:
[B]move_to[/B] int Map

obj (ObjectPtr)
tile_num (int)
elev (0-2)

Immediately moves an object (obj) to the given tile number and elevation on the current map.

Thanks in advance :)
 
"Start location" will set the GVAR_LOAD_MAP_INDEX to the defined value. In the target map script you can then use the GVAR to do stuff, like move the player to a specific hex. Example:

Code:
load_map(MAP_JUNKENT, 6);
Code:
JUNKENT.ssl
if (global_var(GVAR_LOAD_MAP_INDEX) == 6) then begin
   override_map_start(61, 91, 0, 5);
   if (dude_caps >= 100) then begin
      dude_caps_adjust(-100);
   end
   else begin
      dec_general_rep(2);
   end
   set_map_var(1, 1);
   set_map_var(5, GAME_TIME_IN_DAYS);
end
 
Last edited:
Awesome thank you!
I couldn't get GVAR_LOAD_MAP_INDEX to change by just using load_map, but that override_map_start command did the trick.
Thanks again :)
 
Back
Top