View previous topic :: View next topic |
Author |
Message |
Wazat
Joined: 15 Oct 2004 Posts: 732 Location: Middle 'o the desert, USA
|
Posted: Fri Nov 20, 2009 3:20 am Post subject: |
|
|
lth wrote: | Oh, well, I totally cheated for my freeze perk in the horror - I just set every monster's nextthink to time+10  |
That works fine. Basically, changing nextthink prevents the monster from moving at all because their movement is completely tied to their thinks (unlike players), while encasing them in a solid object lets them still act and try to move, but they won't get anywhere. So if you want to do like a snare or immobilization spell, wrapping a solid entity around them works fine. To totally freeze the enemy so they hang suspended in their last position, you need to set their nextthink. Setting their .pain and .touch etc to null also helps (then resetting those back to what they should be when the freeze wears off). That way landing demons and dogs (that were frozen mid-jump) don't get to reset their think, and shooting an enemy doesn't trigger pain animations to break the freeze either.
Edit: Alternately, you could change t_damage to not trigger pain animations on frozen enemies, and change the dog & demon touch functions to just change their think without resetting nextthink so they function properly when the freeze wears off, but don't unfreeze prematurely. _________________ When my computer inevitably explodes and kills me, my cat inherits everything I own. He may be the only one capable of continuing my work. |
|
Back to top |
|
 |
Wazat
Joined: 15 Oct 2004 Posts: 732 Location: Middle 'o the desert, USA
|
Posted: Wed Nov 25, 2009 3:30 am Post subject: |
|
|
I'd like to point out something else: You can have monsters that walk through other monsters, through players, certain walls, etc while still acting solid to other objects. Create wrapper functions for movetogoal and walkmove, and have those same wrappers call the same code as player pre think and post think are calling.
pseudo-code:
void movetogoal(float dist)
{
desolidify_targets();
movetogoal_real(dist);
solidify_targets();
}
You could make a ghost monster that moves through certain walls of the level that are solid to the player and other monsters. It also moves through players and other monsters. The other monsters won't get stuck as long as they are making the ghost non-solid with their movetogoal, as it does to them.
Summoning monsters is problematic when you don't want that monster blocking player movement. Setting .owner is a good way to let the summoner move through as though the monster wasn't solid, while still allowing enemy bullets to hit the monster. However, teammates cannot travel through it in this way. If you marked them as non-solid to each other though, they could pass through the monster and the monster could pass through them.
Making a swarm of monsters non-solid to each other but not anything else also helps with swarm mechanics so that they don't get stuck trying to go around each other.
One problem though is natural movement, like falling, jumping, etc. The monsters will still interact with the world during such movement. At that point you may prefer SOLID_CORPSE for some of these features. _________________ When my computer inevitably explodes and kills me, my cat inherits everything I own. He may be the only one capable of continuing my work. |
|
Back to top |
|
 |
Teiman
Joined: 03 Jun 2007 Posts: 309
|
Posted: Fri Jan 08, 2010 5:31 pm Post subject: |
|
|
a better solution for coop telefrag could be to add a "cooldown" for respawners. and check for the other player distance before respawning. |
|
Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2004 phpBB Group
|