AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Entity infiltrate walls (https://forums.alliedmods.net/showthread.php?t=133997)

Gadzislaw007 07-30-2010 17:38

Entity infiltrate walls
 
Sometimes, when I stand close to wall and i plant an entity with movetype_toss the entity starts to fall really slow and when it touches floor it does not stop, but still fall.... If I stay far from a wall I can plant it properly, mine stops at floor.
Is that normal? How can I fix it?

PHP Code:

public set_mine(id) {
  new 
Float:StartOrigin[3]

 
  new 
PlayerOrigin[3]
  
get_user_origin(idPlayerOrigin1)

  
StartOrigin[0] = float(PlayerOrigin[0])
  
StartOrigin[1] = float(PlayerOrigin[1])
  
StartOrigin[2] = float(PlayerOrigin[2]-25)

  new 
MineEnt create_entity("info_target")

  
  
entity_set_string(MineEntEV_SZ_classname"landmine")
  
entity_set_model(MineEnt"models/w_landmine_zlw.mdl")
  
entity_set_edict(MineEntEV_ENT_ownerid)
  
entity_set_int(MineEntEV_INT_movetypeMOVETYPE_TOSS)
  
  
DispatchSpawn(MineEnt)
  
  
entity_set_origin(MineEntStartOrigin)
  
entity_set_size(MineEntFloat:{-35.0, -35.0, -1.0}, Float:{35.035.02.0})
  
entity_set_int(MineEntEV_INT_solid2)
  
  

   




Gadzislaw007 08-01-2010 12:38

Re: Entity infiltrate walls
 
BUMP!

Any ideas? Nobody has similar problem?

Hunter-Digital 08-02-2010 06:40

Re: Entity infiltrate walls
 
The entity size is bigger than the player size, therefore when the entity spawns, one of the corners gets into the wall and then slowly falls.

You either lower the size of the entity or do a trace hull on player's position to see if the entity has room to spawn.

Gadzislaw007 08-02-2010 10:41

Re: Entity infiltrate walls
 
I noticed it while ago. I just had to set size after entity already is stopped by ground.
Anyway thanks :).


All times are GMT -4. The time now is 00:17.

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