User Tools

Site Tools


hpl3:game:map

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
hpl3:game:map [2015/03/12 11:29]
nebej
hpl3:game:map [2015/09/17 10:49] (current)
ian.thomas [Map Transfer Area]
Line 11: Line 11:
 These are the methods that are called from the Map: These are the methods that are called from the Map:
  
-void OnStart()\\ +**void Setup()** \\ 
-Called the first time the map is loaded.\\ +Called every time a map is loaded. Called before OnStart\\ 
-void OnEnter()\\+**void OnStart()** \\ 
 +Called the first time the map is loaded. ​Called before OnEnter\\ 
 +**void OnEnter()** \\
 Called every time the map is loaded\\ Called every time the map is loaded\\
-void OnLeave()\\+**void OnLeave()** \\
 Called when player leaves the map\\ Called when player leaves the map\\
-void CreateData()\\+**void CreateData()** \\
 All special data needed for the map (and not saved) are created here.\\ All special data needed for the map (and not saved) are created here.\\
-void DestroyData()\\+**void DestroyData()** \\
 All special data needed for the map (and not saved) are destroyed here.\\ All special data needed for the map (and not saved) are destroyed here.\\
-void Update(float afTimeStep)\\+**void Update(float afTimeStep)** \\
 Called every update tick\\ Called every update tick\\
-void PostUpdate(float afTimeStep)\\+**void PostUpdate(float afTimeStep)** \\
 Called after all normal Update during a tick has been called\\ Called after all normal Update during a tick has been called\\
-void VariableUpdate(float afDeltaTime)\\ +**void VariableUpdate(float afDeltaTime)** \\ 
-Called right before rendering the map. Has a variable timestep\\ +Called right before rendering the map. Has a variable timestep. Should be used for non-gameplay code\\ 
-void OnGui(float afTimeStep)\\ +**void OnGui(float afTimeStep)** \\ 
-When ImGui_%%*%% functions should be called.\\ +When ImGui_<​nowiki>​*</​nowiki> ​functions should be called.\\ 
-void +**void OnAction (int alAction, bool abPressed)** \\
-OnAction +
-(int alAction, bool abPressed)\\+
 When an action is made.\\ When an action is made.\\
-void OnAnalogInput(int alAnalogId, cVector3f &in avAmount)\\+**void OnAnalogInput(int alAnalogId, cVector3f &in avAmount)** \\
 When an analog action is made.\\ When an analog action is made.\\
-float DrawDebugOutput(cGuiSet @apSet,​iFontData @apFont,​float afStartY)\\+**float DrawDebugOutput(cGuiSet @apSet,​iFontData @apFont,​float afStartY)** \\
 This only used for pure debug purposes. Use cLux_DrawDebugText(…) for  easily outputting messages. “Show Map Info” in the F1 menu must be  turned on for it to show up.\\ This only used for pure debug purposes. Use cLux_DrawDebugText(…) for  easily outputting messages. “Show Map Info” in the F1 menu must be  turned on for it to show up.\\
-void OnRenderSolid(cRendererCallbackFunctions@ apFunctions)\\+**void OnRenderSolid(cRendererCallbackFunctions@ apFunctions)** \\
 Useful for drawing debug output or if you want some really specific effect in the level. Useful for drawing debug output or if you want some really specific effect in the level.
- 
-====== Map Creation Functions ====== 
  
 ====== Map Streaming ====== ====== Map Streaming ======
Line 72: Line 70:
 In order to make smooth transitions between levels you have to use an  Map Transfer Area. This is an area that is placed around the end of map A  and the begining of map B. The player and any objects inside this area  will retain their state and position relative to the area. The area  needs to be placed at the same relative position and have the same size  in both levels. It is possible to have different rotation of the area,  in cases where maps dont share the same orientation. The area also needs  to have the same name on both maps. It is possible to use multiple Map  Transfer Areas for maps multiple endings. In order to make smooth transitions between levels you have to use an  Map Transfer Area. This is an area that is placed around the end of map A  and the begining of map B. The player and any objects inside this area  will retain their state and position relative to the area. The area  needs to be placed at the same relative position and have the same size  in both levels. It is possible to have different rotation of the area,  in cases where maps dont share the same orientation. The area also needs  to have the same name on both maps. It is possible to use multiple Map  Transfer Areas for maps multiple endings.
  
-The state of the objects are transfered using a save state, this  contains everything from position to the value of a script variable. For  each object inside the area of map A the state is saved. The code then  looks for a entity with the same name in map B. If the entity exists ​ then the state is loaded, otherwise the entity is recreated on map B  with a _fckg_QUOT__stream__fckg_QUOT_ ​suffix at the end. It is  important that the area used during the transition looks the same on  both maps. Otherwise the player will notice the change. This only works  for Props that allow map transfer, this is true as default. Use  SetAllowMapTransfer(false) to disable map transfer of a prop type.+The state of the objects are transfered using a save state, this  contains everything from position to the value of a script variable. For  each object inside the area of map A the state is saved. The code then  looks for a entity with the same name in map B. If the entity exists ​ then the state is loaded, otherwise the entity is recreated on map B  with a "​__stream__" ​suffix at the end. It is  important that the area used during the transition looks the same on  both maps. Otherwise the player will notice the change. This only works  for Props that allow map transfer, this is true as default. Use  SetAllowMapTransfer(false) to disable map transfer of a prop type.
  
 The name of the Map Transfer Area needs to be passed as an argument to ChangeMap in order for it to work. The name of the Map Transfer Area needs to be passed as an argument to ChangeMap in order for it to work.
Line 82: Line 80:
  
 **void Map_Deload(const tString &in asTransferArea = ""​)** **void Map_Deload(const tString &in asTransferArea = ""​)**
 +
 +===== Stopping a prop from transferring =====
 +
 +In some cases you don't want a prop to transfer; either because you want to stop the player taking it with them, or because you don't want its properties preserved and would rather use the version in the new map. Use ''​Prop_SetAllowMapTransfer()''​ at any point to mark a prop as not transferable.
 ===== Changing Map ===== ===== Changing Map =====
  
hpl3/game/map.1426159795.txt.gz · Last modified: 2015/03/12 11:29 by nebej