AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Stopping monster movement. (https://forums.alliedmods.net/showthread.php?t=53542)

Drak 04-06-2007 00:09

Stopping monster movement.
 
I'm trying to get monster's basicly to be frozen, he's what I tryed so far:
Code:
set_pev(entid,pev_flags,FL_FROZEN) // ---------------------------------------------------------- // set_pev(entid,pev_maxspeed,0.0) set_pev(entid,pev_speed,0.0)

Setting it's flags didn't do anything, but setting it's maxspeed/speed had a different effect, it stopped the monster from moving. But when using the monster to make it follow you (It's the Scientist NPC) he didn't move... But when using him again, he did.. Anyone have any idea?
It would also be really good if there was a way to make the NPC 'brain dead'. Something to basicly just freeze it, don't shoot, don't attack. blah blah.

EDIT:
Code:
set_pev(entid,pev_nextthink,0.0)
Using this along with the speed settings, it works fine. They won't move, but what if I wanted to re-vert it back?

Drak 04-07-2007 01:54

Re: Stopping monster movement.
 
I really hate to bump my own thread, but anyone have any ideas?

XxAvalanchexX 04-07-2007 03:00

Re: Stopping monster movement.
 
If you're using the nextthink method, when you want to re-enable them, set their pev_nextthink to get_gametime() + 0.1

jurugi 05-04-2007 19:21

Re: Stopping monster movement.
 
You might be able to set the monster as spawnflags:0 which makes it not attack anything, but still acts as a monster entity and reacts to sounds etc. and do what you're doing

VEN 05-05-2007 04:22

Re: Stopping monster movement.
 
When dealing with flags don't perform simple set but use bitwise OR operator:
Quote:

set_pev(entid, pev_flags, pev(entid, pev_flags) | FL_FROZEN)
Also have you read hlsdk_const.inc?

Quote:

#define FL_FROZEN (1<<12) // Player is frozen for 3rd person camera



All times are GMT -4. The time now is 06:42.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.