View Issue Details

IDProjectCategoryView StatusLast Update
0002398The Dark ModCodingpublic02.07.2022 15:31
ReporterFidcal Assigned ToFidcal  
PrioritynormalSeverityfeatureReproducibilityhave not tried
Status confirmedResolutionfixed 
Summary0002398: Add "foreach" to triggers to expand 'call' spawnarg.
DescriptionTriggers have a "call" spawnarg. Expand this to support "foreach" so each trigger not only calls the script function once, but for each of its targets.
TagsNo tags attached.

Relationships

related to 0003213 new triggers need "callobjectfunction" 
related to 0003303 closed trigger_once_entityname doesn't react to dropped items 

Activities

Dragofer

Dragofer

02.07.2022 13:06

developer   ~0014938

Setting this to resolved as the "foreach" spawnarg has meanwhile been introduced and works correctly.
Dragofer

Dragofer

02.07.2022 13:15

developer   ~0014939

Last edited: 02.07.2022 13:33

On second reading, this actually seems to be specifically about trigger brushes receiving the "foreach" functionality, which is currently only available for callscriptfunction entities and trigger_touch entities.

You can already easily let a trigger brush target a callscriptfunction entity, so it seems to have little urgency to implement this for trigger brushes directly. The advantage would be that you would be able to pass to the script which actor entered the trigger brush (since foreach also enables passing on entity parameters to the script).
Obsttorte

Obsttorte

02.07.2022 14:41

developer   ~0014945

Added relationship to 0003303.
We already have methods to allow actions to take place under such conditions as items beeing in a location etc...
It doesn't make much sense to add tons of redundant functionalities if there is no real gain.
It might be worthwhile discussing this in the forum - both possible advantages and actual usecases where this might be required.
Dragofer

Dragofer

02.07.2022 15:31

developer   ~0014951

Last edited: 02.07.2022 15:31

Would have to distinguish between 2 features:

1) "foreach" > calling the script in "call" on each targeted entity. This is kind of dubious to combine with a trigger brush, since the trigger brush already triggers all of its targets so you'd be adding a 2nd action.

2) passing variables to the script (itself, the entity that activated it and if foreach is enabled, one of the targeted entities). This could be quite useful for trigger brushes. You can't pass the original activating entity in a trigger + callscriptfunction combo, and you can't pass anything with an objective + location clip combo. Stim/Response could, however, replicate this functionality already since it can pass a lot of information if you know how to setup the script.

For some reason callscriptfunction entities require "foreach" to be enabled before you can pass variables. That's why I even brought up feature 2 in this ticket.

Issue History

Date Modified Username Field Change
10.10.2010 12:28 Fidcal New Issue
10.10.2010 12:28 Fidcal Status new => assigned
10.10.2010 12:28 Fidcal Assigned To => tels
27.11.2010 12:45 tels Severity normal => feature
15.05.2013 15:28 tels Assigned To tels => Fidcal
02.07.2022 13:06 Dragofer Status assigned => resolved
02.07.2022 13:06 Dragofer Resolution open => fixed
02.07.2022 13:06 Dragofer Note Added: 0014938
02.07.2022 13:15 Dragofer Status resolved => confirmed
02.07.2022 13:15 Dragofer Note Added: 0014939
02.07.2022 13:20 Dragofer Relationship added related to 0003213
02.07.2022 13:33 Dragofer Note Edited: 0014939
02.07.2022 14:38 Obsttorte Relationship added related to 0003303
02.07.2022 14:41 Obsttorte Note Added: 0014945
02.07.2022 15:31 Dragofer Note Added: 0014951
02.07.2022 15:31 Dragofer Note Edited: 0014951