Jump to content

Is there an object that has the active Group object in a condition script field?


FlightControl

Recommended Posts

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]|

[/TABLE]

Link to comment
Share on other sites

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 ServerScripting 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

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]|

[/TABLE]

Link to comment
Share on other sites

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 ServerScripting 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

  • 4 months later...

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]|

[/TABLE]

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...