Jump to content

esb77

Members
  • Posts

    338
  • Joined

  • Last visited

  • Days Won

    2

Community Answers

  1. esb77's post in Trouble getting trigger.action.activateGroup() to work was marked as the answer   
    So in scouring for more info I found a solution:
    migGroupFromTable = migGroupsToActivate[1] nextMigGroup = Group.getByName(migGroupFromTable) nextMigGroup:activate() That does what I want, grabs a value from a table, and activates the group with that name.
    But I still don't understand why the general structure of:
    trigger.action.activateGroup("groupName") --or trigger.action.activateGroup(stringVariable) -- where stringVariable == "groupName" doesn't do basically the same thing.    I'll look into it some more, because if     trigger.action.activateGroup(Group)   actually wants the group mission ID number, or the GUID number of the group and not the name,  then I'm doing my most frequent ME script bug of wrong format of input into a function.   I probably also need to go back and look up the difference between . and : in LUA, which I looked up two days ago and have already forgotten.   Something about functions that pass self as the first parameter I think.   I'll update if I manage to un-confuse myself.
     
    I managed to get it to work with this
    --Modifying it again, trying trigger.action: trigger.action.outText("testing activate method", 20, false) migGroupFromTable = migGroupsToActivate[1] trigger.action.outText(migGroupFromTable, 20, false) nextMigGroup = Group.getByName(migGroupFromTable) trigger.action.activateGroup(nextMigGroup) trigger.action.outText("Group getbyname got: " .. nextMigGroup, 20, false) which throws and error on the final outText and I think reveals my problem.   trigger.action.activateGroup wants the Group object table, not the Group name string.  Using .getByName gets the right input, and with that it works.
×
×
  • Create New...