Page 1 of 1

Brush Entity

Posted: Mon Jan 09, 2017 5:51 pm
by decompile
Hey,

Recently I have the problem that my created "trigger_multiples" arent firing the EntityOutput "OnStartTouch" or any other type.
I checked with EntityIter that the brush is created, but randomly some of them arent working/ if they dont exist.
Its hard to reproduce it, since I have no clue how they randomly disable itself.

Is there something known, or changed recently?

Re: Brush Entity

Posted: Tue Jan 10, 2017 3:55 am
by L'In20Cible
Code?

Re: Brush Entity

Posted: Tue Jan 10, 2017 7:48 pm
by decompile
As I said, I cant reproduce the issue with a code, but heres my code to create and the entity output:

Syntax: Select all

def createBrushTriggerr(zoneObj, stageObj):
origin = Vector(*map(min, zip(zoneObj.coords1, zoneObj.coords2)))
maxCoord = Vector(*map(max, zip(zoneObj.coords1, zoneObj.coords2)))
m_vecMaxs = maxCoord - origin
m_vecMins = Vector(0, 0, 0)
trigger_multiple = Entity.create("trigger_multiple")
trigger_multiple.spawn_flags = 4097
trigger_multiple.target_name = "Zone_%i" % zoneObj.id
if stageObj.filter_name is not None:
trigger_multiple.filter_name = stageObj.filter_name
trigger_multiple.model = trigger_model
trigger_multiple.origin = origin
trigger_multiple.spawn()
trigger_multiple.maxs = m_vecMaxs
trigger_multiple.mins = m_vecMins
trigger_multiple.solid_type = SolidType.BBOX
return trigger_multiple.index


Syntax: Select all

@OnEntityOutput
def startTouch(output_name, activator, caller, value, delay):
if caller.classname == 'trigger_multiple':
printToServerConsole(output_name)


Randomly one trigger doesnt work, but with another plugin I saw it exists from EntityIter and checking the targetname.
Also I tried to .spawn() it again via the EntityIter but it didnt fixed my issue.

Re: Brush Entity

Posted: Tue Jan 10, 2017 8:15 pm
by Ayuto
This is off-topic, but worth mentioning it. This line

Syntax: Select all

origin = Vector(*map(min, zip(zoneObj.coords1, zoneObj.coords2)))
could just be

Syntax: Select all

origin = zoneObj.coords1.min(zoneObj.coords2)
The same also exists for "max".

Regarding the issue: have you tried calling "Enable" on the trigger, when it didn't work anymore?

Re: Brush Entity

Posted: Wed Jan 11, 2017 6:30 pm
by decompile
No clue why, but it doesnt appear anymore. Weird.