Install Steam
login
|
language
简体中文 (Simplified Chinese)
繁體中文 (Traditional Chinese)
日本語 (Japanese)
한국어 (Korean)
ไทย (Thai)
Български (Bulgarian)
Čeština (Czech)
Dansk (Danish)
Deutsch (German)
Español - España (Spanish - Spain)
Español - Latinoamérica (Spanish - Latin America)
Ελληνικά (Greek)
Français (French)
Italiano (Italian)
Bahasa Indonesia (Indonesian)
Magyar (Hungarian)
Nederlands (Dutch)
Norsk (Norwegian)
Polski (Polish)
Português (Portuguese - Portugal)
Português - Brasil (Portuguese - Brazil)
Română (Romanian)
Русский (Russian)
Suomi (Finnish)
Svenska (Swedish)
Türkçe (Turkish)
Tiếng Việt (Vietnamese)
Українська (Ukrainian)
Report a translation problem
A lot of the useful stuff is documented here.
CTerrorPlayer.IsSurvivor()
CTerrorPlayer.GetActiveWeapon()
I would love to get/set keyvalues, but as far as m_zombieClass, there is also CTerrorPlayer.GetZombieType(). I wish there was a generic SpawnZombie callback which would allow you to change the zombie about to spawn as well as model,health, etc, sort of like EnvEntityMaker, but a work around is to hook the spawn event, use the newly spawned zombie's position as input to ZSpawn (as there is no auto option) and kill the original. I use that for Tank Slayer, the one downside is you can hear a second of the original's bacteria sounds.
I know. Is there a way to modify that IGameEvent pointer though? If not, shoot, I'll need to continue relying on HammerCode and SourceMod. Just an FYI, instead of checking modevents.res, IMO a more helpful document is here[wiki.alliedmods.net], however that won't be up-to-date obviously.
Beautiful, that is just fantastic. Now all I need is the ability to send usermessages and modify netprops. Maybe a function to change an entity's model too.
http://www.youtube.com/watch?v=602zppb3Swg
It's coded[zombiescanfly.com] that such that it retrieves the m_hThrower from CBaseCSGrenadeProjectile (netprops) to find the owner of the grenade, and then proceeds to target an infected entity. A lot of cool things can be done with netprops, and would be awesome to have in a vscript!
I'm very interested in the Pickup and drop functions on custom physics props. Is it possible to get the held entity index from a player if he is holding something? Like if a player holding a key uses a lock to make a door open without needing to drop it? Interacting with custom props could bring alot of creativity in puzzle type maps.
http://www.youtube.com/watch?v=fL1s1h_NGBA
Technically, we are not hooking a function unless we can modify or augment the outcome of the function. From what I've been told, we cannot modify the game event params (please confirm), but rather just "listen" for them.
Also, from what I can see in my modevents.res, there is no player_spawn, but there is a player_first_spawn, but I still have the older non-beta L4D2 installed. IMO, it's still not as solid as a hook to SurvivorBot::Spawn(), because I have seen instances where the event is never broadcasted (during my long hours of SM and HC modding). To prevent items from being picked up dynamically, I've always hooked CBaseEntity::Use(), and I have no idea if that can be done in EMS (maybe there is an alternative way or workaround, perhaps CanPickupObject). It would be helpful if Valve provided us modders with more hooks. For example, CTerrorPlayer::Weapon_CanUse(), NextBotPlayer<CTerrorPlayer>::Weapon_Equip(), SurvivorBot::Weapon_Switch() to name a few more. Again, there may be a workaround for these. I am just naming some that I have hooked in my c++ server plugin that I couldn't find with vscripts. Lastly, getting and setting netprops, e.g. sample function from my c++ valve server plugin (VSP):
I personally cannot think of any rational way of coding a function like that running off Squirrel VM :P It would be highly appreciated to have a method to modify netprops in our scripts. Maybe a wrapper function for IVEngineServer::UserMessageBegin() too! :)
You're right about most events, you are passively receiving them. Not all events are in modevent.res btw, those are just the custom L4D2 ones. When in doubt, use display_game_events 1. spawn and first_spawn definitely work. I use both in Tank Slayer,
All the events seem to be in the update folder modevent.res, the left4dead2/resources/modevents.res appears to be out of date.
@The Fish: If you change teams, SurvivorBot::Spawn() seems to fire again (and over and over again for infected), but the event player_first_spawn does not. You are correct in your reasoning that the client entities are created once.