L4D2 EMS/GnomeHunter tutorial 9

From Valve Developer Community
Jump to: navigation, search

Now you have finished writing a complete Mutation using VScript, you may want to keep practicing before starting your very own Mutation.

Suggestions for expanding GnomeHunter

Here are some things you can try now that you have a basic version of GnomeHunter implemented:

Mixing up the gnome spawn rules

  • Try adding more gnome spawn points. Your Mutation will automatically spawn one gnome per point if you simply add more spawn points.
    • If you add more gnomes try changing your win condition to collecting all the gnomes, not just one gnome
    • You can also try adding multiple spawn points but only spawning one gnome. In order to do so, you'll have to change your ModeSpawns entry to include SPAWN_FLAGS.NOSPAWN for your gnome Entity Group, like so:
	["GnomehunterGnome", <...> SPAWN_FLAGS.NOSPAWN]

Then you'll want to manually spawn your gnome using this pattern:

	// get the entity group
	local gnomeEntityGroup = GetEntityGroup( "GnomehunterGnome" )

	// set the spawn point name (the map can contain multiple entities with this name)
	gnomeEntityGroup.SpawnPointName <- "gnome_spawn"

	// spawn a single gnome 
	SpawnMultiple( gnomeEntityGroup , { count = 1 } )

NOTE: You can read more about SpawnMultiple and other ways to spawn entity groups here: Appendix:Spawning

Changing the locker rules

  • Add multiple lockers to your Mutation
  • Make the lockers start glowing with EntFire inputs when you approach with the gnome
  • Change the locker so it will start glowing, but not open until some amount of time has passed with the gnome being nearby
  • Make storing the gnome in the locker spawn guns or items (boxes of fireworks!) as a reward

Locker revisions

  • Add a push brush to the locker to prevent the gnome from interpenetrating the model until it opens
    • Add the push_brush in hammer, and then when the locker spawns search around the locker model in a very small radius for a push brush with a specific name. Then you can enable and disable it when the locker opens and closes.
  • Change the locker to use the models from the Dark Carnival map, or another model that has a collision model. Add a trigger and change the gnome detection method to be trigger based instead of script based.

Changing the escape conditions

  • After storing the gnome in the locker have the player fulfill another condition to win
    • Perhaps the players must defeat a wave of special infected before winning
    • Have the players return to their starting place at the gazebo, or another point in the map before triggering the win. Use the message ticker or glowing props to guide the player to their goal.
    • Create a huge panic wave of 1000 infected and instruct the player to mow them all down to win! Display the updated kill count and goal count on the HUD.