Page 1 of 1

Explosion...

Posted: Tue Jul 22, 2014 1:03 pm
by Hedgehog
Is it possible to fire Explode at entity env_explosion?

I tried to use explosion from TempEntities, but it looks very different from the env_explosion one.

Syntax: Select all

from effects import TempEntities
from engines.server import EngineServer
from events import Event
from filters.recipients import RecipientFilter
from mathlib import Vector
from players.helpers import playerinfo_from_userid

@Event
def player_say(event):
userid = event.get_int('userid')
text = event.get_string('text')

if text == 'run':
info = playerinfo_from_userid(userid)
position = info.get_abs_origin()

TempEntities.explosion(RecipientFilter(), 0.0, position, -1, 0.0, 0, 8, 150, 400, Vector(), 67)


How to make TempEntities.explosion particles and the "black circle on the ground" like in env_explosion? And for some reason it doesn't make any damage to player...

Posted: Tue Jul 22, 2014 6:06 pm
by Ayuto
TempEntities.explosion() is not doing any damage, because the method really just creates the effect. You will have to add the damage on your own.

Posted: Wed Jul 23, 2014 4:53 am
by Hedgehog
Ayuto wrote:TempEntities.explosion() is not doing any damage, because the method really just creates the effect. You will have to add the damage on your own.

Oops... I need to sleep more :D

How to create a black circle on the ground like env_explosion has?

Posted: Wed Jul 23, 2014 12:05 pm
by L'In20Cible
TempEntities.explosion() accepts a "flags" argument somewhere in its prototype accepting the following TE_EXPFLAG_* flags: https://github.com/alliedmodders/hl2sdk/blob/sdk2013/game/shared/tempentity.h

Now that we moved to python 3.4, I will wrap them at some point.


EDIT: Well, from memory, there was a flag to prints the decal or not but I just checked twice and this flag is not for this effect but for the env_explosion entity itself (as spawnflags). That or the flag is accepted as a member of a DispatchEffectInfo (or whatever I ended up calling this type on the python side). I tried to help, but from my smartphone ot's not that easy hehe. Will do some testing when I get the chance.