Subcategories

Maps and encounters


exec_map_update_scripts

sfall.h

void exec_map_update_scripts()

Executes map_update_p_proc for all objects on map and global/hook scripts as well.

This is a macro, you need to include sfall.h to use it.


force_encounter

void force_encounter(int map)

Can be called either from a global script while traveling on the world map, or from a normal script while on a local map. In either case the encounter occurs shortly after the next time the player moves on the world map. The player will not get an outdoorsman skill check.


force_encounter_with_flags

void force_encounter_with_flags(int map, int flags)

Does the same thing as force_encounter, but allows the specification of some extra options. Forcing a random encounter on a map that is not normally used for random encounters may cause the player to lose the car, if they have it. In this case use force_encounter_with_flags with the ENCOUNTER_FLAG_NO_CAR flag set.


get_map_enter_position

array get_map_enter_position()

Returns an array of the player’s position data (index: 0 - tile, 1 - elevation, 2 - rotation) when entering the map through exit grids. If entering from the world map, the tile value will be -1. Should be called in map_enter_p_proc procedure to get the correct position data.


in_world_map

bool in_world_map

Returns 1 if the player is looking at the world map, or 0 at any other time. Obviously this is only useful in global scripts, since normal scripts will never get the chance to run on the world map.


set_map_enter_position

void set_map_enter_position(int tile, int elevation, int rotation)

Overrides the players entry position when entering the map through exit grids. Setting the tile to 0 will put the player on the start hex (default tile and elevation) of the map. Works only in map_enter_p_proc procedure.


set_map_time_multi

void set_map_time_multi(float multi)

Adjusts how fast time passes while you’re on the world map. It takes a single float as an argument, where 1 is the normal speed. This function works in addition to the WorldMapTimeMod setting in ddraw.ini and the Pathfinder perk, rather than overriding it, so calling set_map_time_multi(0.5) when the player has 2 levels of Pathfinder would result in time passing at 25% the normal speed on the world map.