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?
Brush Entity
- L'In20Cible
- Project Leader
- Posts: 1536
- Joined: Sat Jul 14, 2012 9:29 pm
- Location: Québec
Re: Brush Entity
Code?
Re: Brush Entity
As I said, I cant reproduce the issue with a code, but heres my code to create and the entity output:
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.
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
This is off-topic, but worth mentioning it. This line
could just be The same also exists for "max".
Regarding the issue: have you tried calling "Enable" on the trigger, when it didn't work anymore?
Syntax: Select all
origin = Vector(*map(min, zip(zoneObj.coords1, zoneObj.coords2)))
Syntax: Select all
origin = zoneObj.coords1.min(zoneObj.coords2)
Regarding the issue: have you tried calling "Enable" on the trigger, when it didn't work anymore?
Re: Brush Entity
No clue why, but it doesnt appear anymore. Weird.
Return to “Plugin Development Support”
Who is online
Users browsing this forum: No registered users and 83 guests