FlightControl Posted July 29, 2013 Share Posted July 29, 2013 All, Is there a way how i can test which instance of a Group i have when executing a condition script for a group? I would like to do something like this Group.getByName(self)... Does something like this exist? Otherwise, when copying the same object doing the same tests but for each object individually, i need to change every condition script specifically... Sven [TABLE][sIGPIC][/sIGPIC]| Join MOOSE community on: DISCORD :thumbup: Website of the MOOSE LUA Framework. MOOSE framework Downloads. Check out Example Missions to try out and learn. MOOSE YouTube Channel for live demonstrations and tutorials. [/TABLE] Link to comment Share on other sites More sharing options...
Grimes Posted July 29, 2013 Share Posted July 29, 2013 Are you asking about it within a waypoint action or something? If so, then the answer is yes! local myGroup = ... is the same as local myGroup = Group.getByName('currentGroupNameHereManuallyTypedOut') The right man in the wrong place makes all the difference in the world. Current Projects: Grayflag Server, Scripting Wiki Useful Links: Mission Scripting Tools MIST-(GitHub) MIST-(Thread) SLMOD, Wiki wishlist, Mission Editing Wiki!, Mission Building Forum Link to comment Share on other sites More sharing options...
FlightControl Posted July 30, 2013 Author Share Posted July 30, 2013 Are you asking about it within a waypoint action or something? If so, then the answer is yes! local myGroup = ... is the same as local myGroup = Group.getByName('currentGroupNameHereManuallyTypedOut') Well, i know the function Group.getByName( "Name"). but that is not what i want. When at a waypoint a condition is evaluated, is in that evaluation script, a variable or object referenceable that would point to the actual object being evaluated on the waypoint? (my hopes are declining... :) ) Sv. [TABLE][sIGPIC][/sIGPIC]| Join MOOSE community on: DISCORD :thumbup: Website of the MOOSE LUA Framework. MOOSE framework Downloads. Check out Example Missions to try out and learn. MOOSE YouTube Channel for live demonstrations and tutorials. [/TABLE] Link to comment Share on other sites More sharing options...
Grimes Posted July 30, 2013 Share Posted July 30, 2013 What we have here is failure to communicate. Literally ... Is a self variable when used with a groups waypoint or triggered actions. But you have to declare an object to equal it in order to use it. If I added this on each waypoint as a script action it would output the groups size when it passes each waypoint. local group = ... trigger.action.outText('Current Group size is' .. group:getSize()) The right man in the wrong place makes all the difference in the world. Current Projects: Grayflag Server, Scripting Wiki Useful Links: Mission Scripting Tools MIST-(GitHub) MIST-(Thread) SLMOD, Wiki wishlist, Mission Editing Wiki!, Mission Building Forum Link to comment Share on other sites More sharing options...
FlightControl Posted December 22, 2013 Author Share Posted December 22, 2013 Grimes, Thank you. Now i understand. In my mission i am spawing groups dynamically, and with the syntax you described i can now reference each group in a DO SCRIPT waypoint action, by referencing the Self (= ...) to a function in my LUA script file. You cannot believe what tricks i had to do before I found this out today. I should have read your reply more carefully. When the mission is finished, i'll post an update, because now my scripting gets more easy (away with the zone crap etc...). thanks, Sven [TABLE][sIGPIC][/sIGPIC]| Join MOOSE community on: DISCORD :thumbup: Website of the MOOSE LUA Framework. MOOSE framework Downloads. Check out Example Missions to try out and learn. MOOSE YouTube Channel for live demonstrations and tutorials. [/TABLE] Link to comment Share on other sites More sharing options...
Recommended Posts