Info gamemode: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
No edit summary
(-more info, outputs are most relevant so moved to top)
Line 3: Line 3:
{{Entity|info_gamemode|sprite=1|type=e0|series=Left 4 Dead}} When a map is loaded, this entity can fire outputs depending on the current game mode. This allows the all game modes to be available in a single map instead of having separate maps for each game mode. {{clr}}
{{Entity|info_gamemode|sprite=1|type=e0|series=Left 4 Dead}} When a map is loaded, this entity can fire outputs depending on the current game mode. This allows the all game modes to be available in a single map instead of having separate maps for each game mode. {{clr}}


== Keyvalues ==
== Outputs ==
{{KV Targetname}}
{{IO|OnCoop}}
{{IO|OnVersus}}
{{IO|OnSurvival}}
{{IO|OnScavenge|Fired when the map spawns in specified mode. {{note|OnCoop fires in realism}}|in=L4D2}}


== Inputs ==
{{IO|OnCoopPostIO|since=L4D2}}
{{IO|PostSpawnActivate|Unknown. Appears to crash}}
{{IO|OnVersusPostIO|since=L4D2}}
{{IO|PreRoundActivate|Unknown.}}
{{IO|OnSurvivalPostIO|since=L4D2}}
{{IO|FireScavengeMatchStart|Unknown.}}
{{IO|OnScavengePostIO|Fired shortly after all scavenge items have been populated|since=L4D2}}
::{{note|This doesn't mean item populating causes the output to be fired, mentioning item being populated just as a frame of reference}}
::{{tip|Useful when wanting to spawn templated weapon_* entities and not have it affected by info_map_parameters densities {{confirm}}}}
::{{ModernConfusion|Description in FGD is not correct. This output does fire later than On<Mode> outputs but it doesn't wait until IO generated by it finishes. Doesn't even wait for the delays specified in On<Mode> outputs to expire.}}


== Outputs ==
{{IO|OnCoop|Fired when the map spawns in coop games.}}
{{IO|OnVersus|Fired when the map spawns in versus games.}}
{{IO|OnSurvival|Fired when the map spawns in survival games.}}
{{IO|OnScavenge|Fired when the map spawns in scavenge mode.|in=L4D2}}
{{IO|OnCoopPostIO|Fired after all entity IO generated by <code>OnCoop</code> has finished.|since=L4D2}}
{{IO|OnVersusPostIO|Fired after all entity IO generated by <code>OnVersus</code> has finished|since=L4D2}}
{{IO|OnSurvivalPostIO|Fired after all entity IO generated by <code>OnSurvival</code> has finished|since=L4D2}}
{{IO|OnScavengePostIO|Fired after all entity IO generated by <code>OnScavenge</code> has finished|since=L4D2}}
{{IO|OnScavengeMatchStart|Fired on the first map load of a scavenge match. Doesn't fire on round restarts.|since=L4D2}}
{{IO|OnScavengeMatchStart|Fired on the first map load of a scavenge match. Doesn't fire on round restarts.|since=L4D2}}
{{IO|OnNavAnalyze|Fired when the map is loaded with -navanalyze on the command line.|since=L4D2}}
{{IO|OnNavAnalyze|Fired when the map is loaded with -navanalyze on the command line.|since=L4D2}}
== Inputs ==
{{IO|PostSpawnActivate|Fired internally right before On<Mode> outputs fire. Trying to fire this manually is not intended and game will crash|nofgd=1}}
{{IO|PreRoundActivate|Fired internally right before On<Mode>PostIO outputs fire.|nofgd=1}}
{{IO|FireScavengeMatchStart|Fired internally right before OnScavengeMapStart output fires. {{note|This fires shortly after OnGameplayStart of info_director is fired}}|nofgd=1}}
{{ModernIdea|Vscripts [[Left_4_Dead_2/Script_Functions#Hooks|Input{{!(}}InputName{{)!}}]] hook can be used  on these. {{todo| What happens when preventing these to fire by returning false ?}} }}


== See Also ==
== See Also ==

Revision as of 14:00, 31 August 2023

English (en)Translate (Translate)
C++ Class hierarchy
CInfoGameMode
CBaseEntity

Template:Entity When a map is loaded, this entity can fire outputs depending on the current game mode. This allows the all game modes to be available in a single map instead of having separate maps for each game mode.

Outputs

OnCoop
OnVersus
OnSurvival
OnScavenge
Fired when the map spawns in specified mode.
Note.pngNote:OnCoop fires in realism


OnCoopPostIO  (in all games since Left 4 Dead 2)
OnVersusPostIO  (in all games since Left 4 Dead 2)
OnSurvivalPostIO  (in all games since Left 4 Dead 2)
OnScavengePostIO  (in all games since Left 4 Dead 2)
Fired shortly after all scavenge items have been populated
Note.pngNote:This doesn't mean item populating causes the output to be fired, mentioning item being populated just as a frame of reference
Tip.pngTip:Useful when wanting to spawn templated weapon_* entities and not have it affected by info_map_parameters densities [confirm]
Warning.pngRisk of Confusion:Description in FGD is not correct. This output does fire later than On<Mode> outputs but it doesn't wait until IO generated by it finishes. Doesn't even wait for the delays specified in On<Mode> outputs to expire.


OnScavengeMatchStart  (in all games since Left 4 Dead 2)
Fired on the first map load of a scavenge match. Doesn't fire on round restarts.
OnNavAnalyze  (in all games since Left 4 Dead 2)
Fired when the map is loaded with -navanalyze on the command line.

Inputs

PostSpawnActivate  !FGD
Fired internally right before On<Mode> outputs fire. Trying to fire this manually is not intended and game will crash
PreRoundActivate  !FGD
Fired internally right before On<Mode>PostIO outputs fire.
FireScavengeMatchStart  !FGD
Fired internally right before OnScavengeMapStart output fires.
Note.pngNote:This fires shortly after OnGameplayStart of info_director is fired
Tip.pngIdea:Vscripts Input[InputName] hook can be used on these.
Todo:  What happens when preventing these to fire by returning false ?

See Also