Jump to content

Mist respawn group name


CougarFFW04

Recommended Posts

Hi everybody,

 

I am playing with the Mist functions clone, teleport...

and I have a few basic questions:

 

- The teleport function works with a table that require the groupName field. My problem is that my group name has space and it seems to be a problem...

When I get the group name automatically and print it I get the right thing (let suppose that it is: Bat115 ARMOR) but mist doesn't do anything but if I put directly groupName = "Bat115 ARMOR" in the var structure it works properly... Obsvouisly it is a problem with the space character in the name..How to deal with that ?

 

- I do not see any way to get the name of the "things" that are cloned... How can I get the name of the cloned group and is there any way to specify or change it ?

 

- all the functions I am speaking about return a string; I do not exacly what this string is but let's suppose that I am interested to get it AND that I want to run the function in a mist schedule like the exemple:

mist.scheduleFunction(mist.cloneGroup, {'groupName', true}, timer.getTime() + 60, 60, 1200)

How would I get the string returned by the mist.cloneGroup function within the mist.schedule function ?

 

- and finally a pure Lua question : in Lua there is na "wait" function. Does anybody know how to simulate de x sec pose (for exemple in a loop) that would be easy and not ressource demanding ?

 

 

Thanks

Link to comment
Share on other sites

Hi everybody,

- Obsvouisly it is a problem with the space character in the name..How to deal with that ?

 

 

I don't know why it does not work on your side, but I can assure you that a space in the group name is no problem for DCS nor for MiST.

If you'd attach your mission file I could take a look.

 

 

 

- How can I get the name of the cloned group and is there any way to specify or change it ?

 

 

The mist.cloneGroup function will return the name of the new group.

 

 

 

How would I get the string returned by the mist.cloneGroup function within the mist.schedule function ?

 

 

You cannot as far as I know. However you can write a function that calls mist.cloneGroup and uses the resulting group name it returns, and schedule this new function with mist.schedule.

 

 

- how to simulate de x sec pose (for exemple in a loop) that would be easy and not ressource demanding ?

 

Easy : schedule your next action with the mist.schedule function a few seconds later.

Zip - VEAF :pilotfly:

 

If you want to learn, talk and fly with french-speaking friends, the Virtual European Air Force is here for you ! Meet us on our Discord and our forum

If you're a mission creator, you may want to check the VEAF Mission Creation Tools (and its GitHub repository) a set of open-source scripts and tools that make creating a dynamic mission a breeze !

Link to comment
Share on other sites

I don't understand ; what do you mean "points 2, 3 and 4 are not compatible" ?

Zip - VEAF :pilotfly:

 

If you want to learn, talk and fly with french-speaking friends, the Virtual European Air Force is here for you ! Meet us on our Discord and our forum

If you're a mission creator, you may want to check the VEAF Mission Creation Tools (and its GitHub repository) a set of open-source scripts and tools that make creating a dynamic mission a breeze !

Link to comment
Share on other sites

May be I was not clear enough but

 

- I want to get the name of the clone

- you suggest to use the schedule function

- but I cannot get the name within the schedule function...

 

 

By the way I do not know what mist.cloneInZone is supposed to return but it sound that it is not the name as I cannot "print" it...

 

Are you sure one get the name ?

 

 

Edit : it is NOT the name...

Got it : https://forums.eagle.ru/showthread.php?t=161689


Edited by CougarFFW04
Link to comment
Share on other sites

Here :

 

function respawnMyGroup(groupName, position)
   -- prepare the respawn
   local vars = {}
   vars.gpName = groupName
   vars.name = groupName
   vars.route = mist.getGroupRoute(vars.gpName, 'task') -- copy the original group route, too
   vars.action = 'respawn' -- respawn
   vars.point = position -- new respawn position
   local newGroup = mist.teleportToPoint(vars) -- would be the same with cloneGroup
   
   -- do something with the new group - e.g. get its name and print if of
   trigger.action.outText("respawned "..newGroup.name)
end

-- respawning my little poney in 5 seconds
local groupName = "myLittlePoney"
local groupPosition = {x=0,y=0,z=0} -- do something meaningful, not 0 0 0 
mist.scheduleFunction(respawnMyGroup,{groupName, groupPosition},timer.getTime()+5)

Zip - VEAF :pilotfly:

 

If you want to learn, talk and fly with french-speaking friends, the Virtual European Air Force is here for you ! Meet us on our Discord and our forum

If you're a mission creator, you may want to check the VEAF Mission Creation Tools (and its GitHub repository) a set of open-source scripts and tools that make creating a dynamic mission a breeze !

Link to comment
Share on other sites

  • Recently Browsing   0 members

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