|
|
Resetting Entitys At The Start Of Every Round
By Egir Helgrimson
Introduction
Sometimes you will run into the problem of an entity that isn't reset when a new round starts. This tutorial will show an example of how to use a func_door and a multimanager to fix this.
Setup
Given that you have already made the following:
| env_sprite
| Name | fire
| | Render Mode | Texture
| | FX Amount | 0
| | Sprite Name | sprites/flame2.spr
| | Set flag "Start on"
|
| func_bomb_target
| Target | render_fire_visible
|
| env_render | Name | render_fire_visible
| | Target | fire
| | Render Mode | Additive
| | FX Amount | 200
|
This setup will make some fire visible when the bomb blows. To go into
further details the fire is an env_sprite which looks like fire. The
func_bomb_target is the standard entity for marking bomb sites. When
the bomb is blown the target of this entity is triggered. Here the
target is "render_fire_visible", which is the name of an
env_render. Env_renders are used to change the rendermode of other
entities. It is verry usefull for making sprites visible and invisible
again. For more information about env_render, visit the VERC Collective
at
When the env_render is triggered it will change the rendermode of the
env_sprite such that the sprite becomes visible, e.g. starting the
fire.
The Problem
When the round restarts the fire is still on and its not supose to be.
In other words, the env_sprite kept its rendermode from the one given
to it by the env_render, even though that was in the last round.
This is an example of entities that does not reset each time a
new round starts.
The Solution
Put out the fire when each round starts by rendering it invisible
again with the following entity:
| env_render | Name | render_fire_invisible
| | Target | fire | | Render Mode | Texture | | FX
Amount | 0 |
In Half-life not all entities are reset every round. But luckily func_doors are, so we are going to use a func_door to create an event that we can react on upon round start. You might have more than one entity that needs to be reset like this, so we will make a multimanager to handle that.
Here is what the func_door and multi_manager looks like
| func_door | Target | reset_manager
|
| multi_manager | Name | reset_manager
| | render_fire_invisible | 0.1
| | <entityi> | 0.1
|
Should you have other entities you want to reset; enter them in place of <entityi> if not, just leave that field blank.
Note
To add extra (key,value)'s to a multi_manager you will need to use the SmartEdit button. For more information please see this tutorial on the multimanager:
http://www.egir.dk/index.php?page=vhe_multi_manager.htm
Conclusion
This should be it. At every new round, Halflife will touch the door, to make sure that its closed, and therefore the door will trigger the multimanager, that again will trigger each of the entities that you listed in it, resetting whatever you intended to, or actually just triggering something upon every round start.
Bibliography
You may find the original resetting entities tutorial at http://countermap.counter-strike.net/Tutorials/tutorial.php?id=7.
Last updated October 28, 2005 - www.egir.dk
|
|