Getting the portalgun at the start of map correctly/en
Language subpage
This subpage is used on the Getting the portalgun at the start of map correctly page to display content in English.
If you have edited the language subpage, do not forget to purge the base page by clicking on the button on the right. Otherwise, its contents will not be updated.
Introduction
When transitioning through levels, you don't want the player to hear the portalgun upgrade sound or see a portalgun coming from nowhere when loading a new map from a level transition. This guide will show you how to fix that.
Note: If your map doesn't have any level transitions or it's the first/only map in the map collection, all you have to do is put the
weapon_portalgun
on the player spawn and you don't need to follow this guide.Creating
1. Create a weapon_portalgun
entity and position it inside the info_player_start
or where the player spawns and set its name to portalgun
.
2. Create a point_template
and set its name to portalgun_template
and set template 1
to portalgun
.
3. Create a logic_auto
entity and enter the following properties:
My Output > Target Entity Target Input Parameter Delay Only Once OnNewGame portalgun_template ForceSpawn <none> 0.00 No
The portalgun should now only spawn when you load directly into the map and won't spawn when using level transitions.