![]() |
Показать все 8 сообщений этой темы на одной странице |
HLFX.Ru Forum (https://hlfx.ru/forum/index.php)
- Half-Life SDK (https://hlfx.ru/forum/forumdisplay.php?forumid=8)
-- Re-spawning monsters in HL multiplayer? (https://hlfx.ru/forum/showthread.php?threadid=5381)
Re-spawning monsters in HL multiplayer?
Hello Team!
I know we have some awesome coders in this community, and I was wondering can someone give me a heads up at my struggle?
I'm trying to make a re-spawn functions for the monsters in Half-Life. The basic idea is simple and it has being implemented in some mods, unfortunately none of them are open sourced, and with no reference... I'm sort of in the dark.
I have a code for giving players points for killing monsters, different amount based on the monster killed, and I wanted to have the monsters re-spawn after some time after being killed.
Do you know of any good example I could use? Or maybe you know of a tutorial I probably missed?
Your comments and feedback will be greatly appreciated.
What type of respawn do you want to implement? Player-like (leave corpse and re-create monster) or resurrection-like (dead monster gets up)?
Leave corpse (or gibs) and re-create monster.
Then I suggest to start with something like this.
1) Remember the initial origin and angles of the monster in its Spawn() function:
m_vecSpawnOrigin = pev->origin; |
m_vecSpawnAngles = pev->angles; |
1 | if ( ShouldFadeOnDeath() ) |
2 | { |
3 | // this monster was created by a monstermaker... fade the corpse out. |
4 | SUB_StartFadeOut(); |
5 | } |
6 | else |
7 | { |
8 | // body is gonna be around for a while, so have it stink for a bit. |
9 | CSoundEnt::InsertSound ( bits_SOUND_CARCASS, pev->origin, 384, 30 ); |
10 | } |
CBaseEntity::Create( pev->classname, m_vecSpawnOrigin,m_vecSpawnAngles , pev->owner ); |
SUB_StartFadeOut(); |
__________________
I'm on github
I'm on opendesktop.org
Thank you for all the feedback.
FreeSlave, I'm referring to Scientist Hunt, I'm sure for this one it's not the monster make thing... since the barney re-spawns on crossfire... and he\s not made with monster-maker there.
Back on the topic or the code: I presume a similar thing is done for the re-spawning of the weapons and the ammo items... still I was not able to completely grasp the concept.
mostermaker? entity
__________________
https://www.moddb.com/mods/half-life-system-error
https://vk.com/aaatrigger
| Временная зона GMT. Текущее время 04:37. | Показать все 8 сообщений этой темы на одной странице |
На основе vBulletin версии 2.3.0
Авторское право © Jelsoft Enterprises Limited 2000 - 2002.
Дизайн и программирование: Crystice Softworks © 2005 - 2024