En:OnGetRandomLocation

Материал из Pocket Fallout для КПК на PDA PC PPC Mobile.

Содержание

Syntax

function OnGetRandomLocation() : String

Description

Called before hero gets to random location on worldmap. Current function locates random location on worldmap.

Parameters

Without parameters;

Result

The procedure returns string with level name (folder name in catalog with name maps\) which is necessary to load. Current function can return null string, if hero stays on worldmap. If current function returns level name then system plays animation of lighting flash. Data type - String

Example

function OnGetRandomLocation()
	// x, y - global hero location
	var x = m_WorldMap.GetWorldHeroX();
	var y = m_WorldMap.GetWorldHeroY();
	
 	if m_WorldMap.GetCityNameByCoords(x, y) == "" then 
          var lucky = Mod(Rand(), 2);       
          if (lucky == 0) then
 	     return "frozen";
          else         
            return "desert";
          endif                
	endif
	return "";
endfunction

See also

  1. OnWorldMapToLevelMap
  2. Predefined procedures and functions (events)
Личные инструменты