Jump to content

Recommended Posts

Posted

Eno, the transport.dll issues seem to be a larger crash within the sim. There is a substantial bug report on it already and I've added the relevant details of dynamical spawned units causing crashes when given orders to the report. I'm not sure if there is anything I can do to lower the chances of it crashing on dynamically added groups.

 

David, as long as the aircraft are given their task, then yes they should engage one another.

respawnGroup('whatever', true)

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

Posted

Hi Grimes,

 

Can you explain how they are given this task. I've been looking at this respawning. I've managed to respawn an aircraft, but he just lands.

Posted

It grabs the waypoints set for the group in the mission editor and then gives the group a new mission task with that route information. The second variable with the function is the most important as it defines whether or not to assign the route. If the variable is a number it assigns the route after X seconds, otherwise it will immediately assign the route.

 

http://wiki.hoggit.us/view/RespawnGroup

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

Posted
do "respawned" planes now finally attack enemy planes?or are they still only following their assigned waypoints, ignoring other threats?

i tried to build a mission a few days ago, but the respawning plane seemed to ignore me totally...im just wondering, if ive done something wrong, or if its still a bug/missing feature, with mist 3.2

 

Try assigning them tasks like CAP or Fighter Sweep after you've spawned them with

aka: Baron

[sIGPIC][/sIGPIC]

Posted

well, how do i assign them tasks after they have respawned?

i did give the first plane a task...start on route task-engage for example...and the first plane actually does engage me,...but once its shot down, and it respawns, it will follow the waypoints i gave it, and ignore me completely...

Posted (edited)

Thank you Grimes.

 

Does it have to be 120 seconds, can it be 2 seconds for example, or does it need time to settle down?

if not Group.getByName('groupName') then

mist.respawnGroup('groupName', 120)

end

 

 

I'm assuming it is only taking the Waypoint tasking that is getting assigned after 120 seconds, and not the aircraft task, such as CAP, CAS or Ground Attack, for example?

 

Like DavidRed said, how do you assign the task (if this is waypoint task or aircraft task), if you wanted to change?

 

The respawning script interests me, as DCS World can seem quite an empty world. If there is a constant stream of aircraft at different times during a mission, then it may make it look more like real life, and thus more interesting for the clients entering the server.

 

I must say your work on Mist and the Lua scripting is in invaluable.

Edited by m9matt
Posted

Follow the guide... Items in blue are required variables, green are optional.

 

mist.respawnGroup('groupName') -- simply respawns the group with no task info. If its ground forces they will engage stuff, but if its aircraft they will ignore targets.

mist.respawnGroup('groupName', true) -- embeds the route information to the group so that once the group spawns it will immediately do the route. This includes all task data with each waypoint.

mist.respawnGroup('groupName', 5) -- if the 2nd variable is a number, then the default route will be assigned to the group after however many seconds you put in there. The number value has to be any number greater than 0. For instance 0.1 would work... but if you want to assign it right away anyways, just set the value to true.

 

I tested it out in singleplayer and respawning AI do attack one another and myself providing the task information is there.

 

David, the get the controller you simply need the groups name...

 

local con = Group.getByName('whatever'):getController()

 

From there you can create a mission task which is basically a table that shares most of the same formatting as a route in the mission file. From there you can set or push the task to the controller.

 

con:pushTask(newTask)

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

Posted

Is there any way to combine the cloneGroup(group, boolean task) and cloneInZone(group, randomZoneTable...) mechanisms for aircraft? I tried cloneGroup first and passing the spawned group name to teleportInZone, but the AI pilots uniformly ejected after they were teleported.

Black Shark, Harrier, and Hornet pilot

Many Words - Serial Fiction | Ka-50 Employment Guide | Ka-50 Avionics Cheat Sheet | Multiplayer Shooting Range Mission

Posted

Teleporting aircraft isn't really supported due to what is available within the scripting engine. For starters "teleportation" in the game doesn't exist. My script takes data on the group and spawns a new group best matching the old groups properties. If its done on AI ground forces then they will be automatically resupplied and start out at max HP, but dead units from the group will not be spawned. Unfortunately for aircraft there is a rather bothersome issue concerning fuel and weapons currently onboard the aircraft. The scripting engine has access to the current fuel load, but it is defined as 0.0 to 1.0 with any value over 1.0 indicating that fuel tanks are used and fuel is present in those tanks. Weapons return a simplified data for the number of each weapon type on board, the problem with that is it lacks pylon information. The overall issue with that is that in order to spawn aircraft the fuel value given is in liters (or kilograms) and the "live" payload data isn't in the same format as what is required "mission editor" format.

 

The reason clone and respawn functions work with aircraft is because it grabs the data from the mission file itself, thus it has all of the "right data" to start off with. You should be able to use mist.cloneInZone and then use mist.getGroupRoute and mist.goRoute to achieve what you desire...

http://wiki.hoggit.us/view/GetGroupRoute

 local newGroup = mist.cloneInZone('gp1', 'zone1')
 mist.goRoute(newGroup.name, mist.getGroupRoute('gp1')) 

 

I thought of adding "task" data to the 'inZone' functions but ultimately decided against it in favor of future functions for manipulating route data or a more specialized functions for aircraft.

  • Like 1

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

Posted (edited)

Taking your example code of teleport in zone and schedule function from the wiki....is there any way to keep the initoal heading of the units when its teleported? Units change heading if I teleport it to different zone every 5 seconds for example.

 

 

Edit got workarround using respawninzone instead...

Edited by Cougar

sigpic4165_1.gif

attachment.php?attachmentid=36435&d=1266786388

Posted

 

<snip>

 

The reason clone and respawn functions work with aircraft is because it grabs the data from the mission file itself, thus it has all of the "right data" to start off with. You should be able to use mist.cloneInZone and then use mist.getGroupRoute and mist.goRoute to achieve what you desire...

http://wiki.hoggit.us/view/GetGroupRoute

 local newGroup = mist.cloneInZone('gp1', 'zone1')
 mist.goRoute(newGroup.name, mist.getGroupRoute('gp1')) 

I thought of adding "task" data to the 'inZone' functions but ultimately decided against it in favor of future functions for manipulating route data or a more specialized functions for aircraft.

 

Okay, thanks. That's the last piece I needed for the fighter range component of my most recent project—it's a little dull if the targets all come from exactly the same place every time.

Black Shark, Harrier, and Hornet pilot

Many Words - Serial Fiction | Ka-50 Employment Guide | Ka-50 Avionics Cheat Sheet | Multiplayer Shooting Range Mission

  • 3 weeks later...
Posted

I have vehicles getting bound up on bridges- and the groups they're affiliated with are stopping at the end of their routes instead of doubling back. If a vehicle gets killed, I imagine that the group continues... but are they holding at the end of their routes- waiting for the ensnarled vehicles to catch up?

 

Just curious if that's the logic of it...

"ENO"

Type in anger and you will make the greatest post you will ever regret.

 

"Sweetest's" Military Aviation Art

Posted
I have vehicles getting bound up on bridges- and the groups they're affiliated with are stopping at the end of their routes instead of doubling back. If a vehicle gets killed, I imagine that the group continues... but are they holding at the end of their routes- waiting for the ensnarled vehicles to catch up?

 

Possibly. AI tend to leave a unit for dead whenever it gets stuck on a bridge, but I've also seen them wait for the unit to catch up.

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

Posted (edited)

Hi Grimes,

 

when respawning a group of vehicles, is there a way to broadcast the vehicles lat/long coordinates via a message?

 

I see there is mist.getLeadingLLString and mist.msgLL

 

but I'm unsure how it should be scripted.

 

I'm respawning the groups randomly in a zone, and would like the message to go out to all players.

Edited by m9matt
Posted

getLeadingLLString gets as argument a unit and precision. You can do something like that (I don't have the reference with me so it may be a bit incomplete)

Once spawned do this script:

trigger.action.outtext(mist.getLeadingLLString(unit.getByName('myUnit'),3))

[sIGPIC]OK[/sIGPIC]

Posted

Thankyou for the reply Zayets.

 

I tried the following Do Scripts in the trigger action and neither worked for me, what am I doing wrong?

1.trigger.action.outtext(mist.getLeadingLLString(unit.getByName('Group Name'),3))

then 2. mist.getLeadingLLString(unit.getByName('Group Name'),3

Posted

I think you'd want mist.getLLString and not mist.getLeadingLLString. The difference is that the leadingLLString function takes selection of units, then narrows it down based on the radius and heading variables, and then returns the average position of the remaining units. mist.getLLString just returns the average position of the selection of units.

 

trigger.action.outText(mist.getLLString({units = mist.makeUnitTable({'[g]theGroupNameHere'}), acc = 3}), 50)

 

This reminds me that I need to add examples for these functions on the wiki.

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

Posted

This reminds me that I need to add examples for these functions on the wiki.

 

I'll buy you some beers (even if virtual ones) if you do that. :pilotfly:

[sIGPIC]OK[/sIGPIC]

Posted

Browsed through the scripting wiki and came across this function. Wonder (in case it's correct) how does it works

array of Unit function coalition.getGroups(enum coalition.side coalition, enum Group.Category groupCategory or nil)

 

returns list of groups belong to the coalition. It returns all groups or groups of specified type.

coalition - coalition identifier

groupCategory - group category. If nil the function will return list of groups of all categories.

 

I noticed that the return type is array of Units. Which means that if I call this one like that

 

redGroups = coalition.getGroups(coalition.side.RED, Group.Category.GROUND)

 

will return an array like this one :

 

{Unit humvee1, Unit humvee2, Unit humvee 3}

 

Assuming that humvee1 and humvee2 are part of group called ScoutOne it means that in order to get the real group list from this coalition means to check each unit in this array for the group they belong to. Now, assuming that the result is in this form :

 

{{Unit humvee1,Unit humvee2},{Unit humvee3}}

 

it makes things a bit more complicated to get the group names for example.

[sIGPIC]OK[/sIGPIC]

  • 2 weeks later...
Posted
Follow the guide... Items in blue are required variables, green are optional.

 

mist.respawnGroup('groupName') -- simply respawns the group with no task info. If its ground forces they will engage stuff, but if its aircraft they will ignore targets.

mist.respawnGroup('groupName', true) -- embeds the route information to the group so that once the group spawns it will immediately do the route. This includes all task data with each waypoint.

mist.respawnGroup('groupName', 5) -- if the 2nd variable is a number, then the default route will be assigned to the group after however many seconds you put in there. The number value has to be any number greater than 0. For instance 0.1 would work... but if you want to assign it right away anyways, just set the value to true.

 

I tested it out in singleplayer and respawning AI do attack one another and myself providing the task information is there.

 

David, the get the controller you simply need the groups name...

 

local con = Group.getByName('whatever'):getController()

 

From there you can create a mission task which is basically a table that shares most of the same formatting as a route in the mission file. From there you can set or push the task to the controller.

 

con:pushTask(newTask)

 

i dont know, i still cannot get the respawned ai to attack me...

respawn.zip

Posted

Hi all,

 

I need support for a script, that could be a little modification of a MIST function.

 

I need to do 2 script that should do the following:

 

One that script that add a route to a pre-existent and parked (uncontrolled) AI flight (defined by group name), that will randomly choose one zone from a table zone (defined by name). than the flight should fly to the zone point, land for 15 minutes and route back to homeplate.

 

Another script that add a route to a ground troops (defined by name) that will randomly choose one zone from a zone table (defined by name)... and this already exist in MIST. But, the adding part, after 15 minutes the troops should route back to the starting point.

 

Can anyone could be so kind to write at least an example or similar?

 

Thanks

ChromiumDis.png

Author of DSMC, mod to enable scenario persistency and save updated miz file

Stable version & site: https://dsmcfordcs.wordpress.com/

Openbeta: https://github.com/Chromium18/DSMC

 

The thing is, helicopters are different from planes. An airplane by it's nature wants to fly, and if not interfered with too strongly by unusual events or by a deliberately incompetent pilot, it will fly. A helicopter does not want to fly. It is maintained in the air by a variety of forces in opposition to each other, and if there is any disturbance in this delicate balance the helicopter stops flying; immediately and disastrously.

Posted

In one of my mission projects I use AI helicopters and making then do circular holding patterns. The idea is rather to have the helicopters hover as AFAC’s just behind a hill or building. Is there a way to make an AI helicopter hover at a set height and forced to face a set heading? I think it should be in ME for AI helicopters.

  • ED Team
Posted
In one of my mission projects I use AI helicopters and making then do circular holding patterns. The idea is rather to have the helicopters hover as AFAC’s just behind a hill or building. Is there a way to make an AI helicopter hover at a set height and forced to face a set heading? I think it should be in ME for AI helicopters.

 

 

Honestly I havent tried, but cant you set speed to 0, altitude to whatever and set heading?

  • Like 1

64Sig.png
Forum RulesMy YouTube • My Discord - NineLine#0440• **How to Report a Bug**

1146563203_makefg(6).png.82dab0a01be3a361522f3fff75916ba4.png  80141746_makefg(1).png.6fa028f2fe35222644e87c786da1fabb.png  28661714_makefg(2).png.b3816386a8f83b0cceab6cb43ae2477e.png  389390805_makefg(3).png.bca83a238dd2aaf235ea3ce2873b55bc.png  216757889_makefg(4).png.35cb826069cdae5c1a164a94deaff377.png  1359338181_makefg(5).png.e6135dea01fa097e5d841ee5fb3c2dc5.png

Posted (edited)
Honestly I havent tried, but cant you set speed to 0, altitude to whatever and set heading?

 

Good call. No I have not tried that, testing.....

 

EDIT: That works perfect! Just set speed 0 and add one waypoint in the heading you want and set the height. The speed on the first waypoint can’t be set under 1 so with this you will not be able to change position. Thanks to SiThSpAwN, rep inbound.

Edited by HiJack
  • Recently Browsing   0 members

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