thy_ 158 Posted September 1, 2022 Pretty sure I'm stepping through a basic question but, really, I've TRIED hard all this afternoon to find out on my own how to make the forEach understand the array content are trigger variable names already dropped in place via Eden Editor. myTriggersVarNames = [ "myTrg1", "myTrg2", "myTrg3" ]; while {true} do { // Doesn't work: { if (player inArea _x) then { systemChat "Player inside the trigger"; }; } forEach myTriggersVarNames; // Working fine: /* if (player inArea myTrg1) then { systemChat "Player inside the trigger" }; */ sleep 3; } Share this post Link to post Share on other sites
Harzach 2517 Posted September 1, 2022 myTriggersVarNames = [ "myTrg1", "myTrg2", "myTrg3" ]; This is an array of strings. myTriggersVarNames = [ myTrg1, myTrg2, myTrg3 ]; This is an array of variable names. 1 1 Share this post Link to post Share on other sites
thy_ 158 Posted September 2, 2022 You right, @Harzach. I didn't notice, even though with the error below, that forEach works in my tries with no quotes. Some advice to avoid this error? It says the trigger var names are not defined. How can I define them since they're just triggers? Share this post Link to post Share on other sites
thy_ 158 Posted September 2, 2022 Forget. 🤣 If the Trigger's array got one or more vanames and those triggers don't exist on Eden Editor, the "Error Undefined Variable" is shown up. Thanks. 1 Share this post Link to post Share on other sites
Harzach 2517 Posted September 2, 2022 *edit* - ah, there ya go! 1 Share this post Link to post Share on other sites