Player walk through other players?
Moderator: InsideQC Admins
18 posts
• Page 2 of 2 • 1, 2
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.
- Wazat
- Posts: 771
- Joined: Fri Oct 15, 2004 9:50 pm
- Location: Middle 'o the desert, USA
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.
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.
- Wazat
- Posts: 771
- Joined: Fri Oct 15, 2004 9:50 pm
- Location: Middle 'o the desert, USA
18 posts
• Page 2 of 2 • 1, 2
Who is online
Users browsing this forum: No registered users and 1 guest