Info gamemode: Difference between revisions
		
		
		
		
		
		Jump to navigation
		Jump to search
		
				
		
 

 Note:This entity counts as an edict. There is also not much reason to use more than one per map as the entity can hold any number of outputs.
Note:This entity counts as an edict. There is also not much reason to use more than one per map as the entity can hold any number of outputs.
 Note:There are no outputs for other base game modes like dash, holdout and shootzones. Check
Note:There are no outputs for other base game modes like dash, holdout and shootzones. Check 
 Idea:Vscripts Input[InputName] hook can be used on these.
Idea:Vscripts Input[InputName] hook can be used on these.
		
	
| CHILLMODEA (talk | contribs) m (Fix minor grammar mistake) |  (It makes sense for it to be about the base game mode, so not a bug.) | ||
| Line 1: | Line 1: | ||
| {{LanguageBar}} | {{LanguageBar}} | ||
| {{CD|CInfoGameMode}} | {{CD|CInfoGameMode}} | ||
| {{this is a|logical entity|sprite=1|name=info_gamemode|series=Left 4 Dead}} When a map is loaded, this entity can fire outputs depending on the current game mode. This allows  | {{this is a|logical entity|sprite=1|name=info_gamemode|series=Left 4 Dead}} When a map is loaded, this entity can fire outputs depending on the current base game mode. This allows the main base game modes to be available in a single map instead of having separate maps for each base game mode. {{clr}} | ||
| {{ | {{Note|This entity counts as an [[edict]]. There is also not much reason to use more than one per map as the entity can hold any number of outputs.}} | ||
| == Outputs == | == Outputs == | ||
| Line 8: | Line 8: | ||
| {{O|OnVersus}} | {{O|OnVersus}} | ||
| {{O|OnSurvival}} | {{O|OnSurvival}} | ||
| {{O|OnScavenge|Fired when the map spawns in specified mode.   | {{O|OnScavenge|Fired when the map spawns in specified base mode.<!-- | ||
| -->{{Note|OnCoop fires in realism.}}<!-- | |||
| -->{{Bug|Killing the info_gamemode itself in one of these outputs with 0 delay crashes the game.|tested=l4d2}}}} | |||
| {{O|OnCoopPostIO|only={{l4d2}}}} | {{O|OnCoopPostIO|only={{l4d2}}}} | ||
| {{O|OnVersusPostIO|only={{l4d2}}}} | {{O|OnVersusPostIO|only={{l4d2}}}} | ||
| {{O|OnSurvivalPostIO|only={{l4d2}}}} | {{O|OnSurvivalPostIO|only={{l4d2}}}} | ||
| {{O|OnScavengePostIO|Fired shortly after all scavenge items have been populated | {{O|OnScavengePostIO|Fired shortly after all scavenge items have been populated.<!-- | ||
| -->{{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}}}}<!-- | |||
| -->{{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.}}|only={{l4d2}}}} | |||
| {{ | |||
| {{O|OnScavengeMatchStart|Fired on the first map load of a scavenge match. Doesn't fire on round restarts. {{ | {{Note|There are no outputs for other base game modes like dash, holdout and shootzones. Check {{code|g_BaseMode}} instead for example.}} | ||
| {{O|OnScavengeMatchStart|Fired on the first map load of a scavenge match. Doesn't fire on round restarts.<!-- | |||
| -->{{Note|Fires shortly after OnGameplayStart of info_director is fired.}}|only={{l4d2}}}} | |||
| {{O|OnNavAnalyze|Fired when the map is loaded with -navanalyze on the command line.|only={{l4d2}}}} | {{O|OnNavAnalyze|Fired when the map is loaded with -navanalyze on the command line.|only={{l4d2}}}} | ||
| == Inputs == | == Inputs == | ||
| {{I|PostSpawnActivate|Called internally and causes On<Mode> output to fire. {{ | {{I|PostSpawnActivate|Called internally and causes On<Mode> output to fire.<!-- | ||
| -->{{Warning|Crashes the game via infinite recursion if used by [[I/O]] system. Internally, it's called using the AcceptInput function which isn't exposed to vscript.}}|nofgd=1}} | |||
| {{I|PreRoundActivate|Called internally and causes On<Mode>PostIO output to fire.|nofgd=1}} | {{I|PreRoundActivate|Called internally and causes On<Mode>PostIO output to fire.|nofgd=1}} | ||
| {{I|FireScavengeMatchStart|Called internally and causes OnScavengeMapStart output to fire.|nofgd=1}} | {{I|FireScavengeMatchStart|Called internally and causes OnScavengeMapStart output to fire.|nofgd=1}} | ||
| {{Idea|Vscripts [[ | {{Idea|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 19:23, 12 October 2025

 
|  Class hierarchy | 
|---|
| CInfoGameMode | 

info_gamemode  is a   logical entity  available in 
 Left 4 Dead series. When a map is loaded, this entity can fire outputs depending on the current base game mode. This allows the main base game modes to be available in a single map instead of having separate maps for each base game mode.
 Left 4 Dead series. When a map is loaded, this entity can fire outputs depending on the current base game mode. This allows the main base game modes to be available in a single map instead of having separate maps for each base game mode. 
 Note:This entity counts as an edict. There is also not much reason to use more than one per map as the entity can hold any number of outputs.
Note:This entity counts as an edict. There is also not much reason to use more than one per map as the entity can hold any number of outputs.Outputs
- OnCoop
- OnVersus
- OnSurvival
- OnScavenge
- Fired when the map spawns in specified base mode. Note:OnCoop fires in realism. Note:OnCoop fires in realism. Bug:Killing the info_gamemode itself in one of these outputs with 0 delay crashes the game.  (tested in: l4d2) Bug:Killing the info_gamemode itself in one of these outputs with 0 delay crashes the game.  (tested in: l4d2)
- OnScavengePostIO   (only in  ) )
- Fired shortly after all scavenge items have been populated. Note:This doesn't mean item populating causes the output to be fired, mentioning item being populated just as a frame of reference. 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] Tip:Useful when wanting to spawn templated weapon_* entities and not have it affected by info_map_parameters densities. [confirm] Risk 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. Risk 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.
 Note:There are no outputs for other base game modes like dash, holdout and shootzones. Check
Note:There are no outputs for other base game modes like dash, holdout and shootzones. Check g_BaseMode instead for example.
- OnScavengeMatchStart   (only in  ) )
- Fired on the first map load of a scavenge match. Doesn't fire on round restarts. Note:Fires shortly after OnGameplayStart of info_director is fired. Note:Fires shortly after OnGameplayStart of info_director is fired.
Inputs
- PostSpawnActivate !FGD
- Called internally and causes On<Mode> output to fire. Warning:Crashes the game via infinite recursion if used by I/O system. Internally, it's called using the AcceptInput function which isn't exposed to vscript. Warning:Crashes the game via infinite recursion if used by I/O system. Internally, it's called using the AcceptInput function which isn't exposed to vscript.
- PreRoundActivate !FGD
- Called internally and causes On<Mode>PostIO output to fire.
- FireScavengeMatchStart !FGD
- Called internally and causes OnScavengeMapStart output to fire.
 Idea:Vscripts Input[InputName] hook can be used on these.
Idea:Vscripts Input[InputName] hook can be used on these.Todo: What happens when preventing these to fire by returning false?























