| Both sides previous revision Previous revision | |||
|
hpl3:game:map [2015/03/12 11:33] nebej |
hpl3:game:map [2015/09/17 10:49] (current) ian.thomas [Map Transfer Area] |
||
|---|---|---|---|
| Line 70: | 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 80: | 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 ===== | ||