-
Posts
1080 -
Joined
-
Last visited
Content Type
Profiles
Forums
Events
Everything posted by Hardcard
-
You could try getting a random point within the zone, then order the spawned aircraft to orbit around it (or to run a kind of circuit between the spawn point and the random point), for instance. Here's how I'd script the orbit task: Now, I guess you could combine that with a zone (from which you'd get the random point) and with :OnSpawnGroup(). Race-Track option: Circle option: I haven't tested this with spawned groups, might need tweaking and polishing... also, I'm guessing that this will interfere with normal AI behaviour/ME tasks. As for unit destruction after landing, try adding this at the end of the :OnSpawnGroup() function:
-
Are you sure this is the correct syntax for the zone object? A2ADispatcher:SetSquadronCap("Bandar Abbas Intl",[i][b][color="Red"]CAPZoneEast[/color][/b][/i],4000,8000,600,800,800,1200) How about this? A2ADispatcher:SetSquadronCap("Bandar Abbas Intl",[i][b][color="Red"]CapZone_East[/color][/b][/i],4000,8000,600,800,800,1200) Also, what about the final parameter for :SetSquadronCap()? Shouldn't you specify altitude type? "BARO"/"RADIO": A2ADispatcher:SetSquadronCap("Bandar Abbas Intl",[i][b][color="Red"]CapZone_East[/color][/b][/i],4000,8000,600,800,800,1200,"BARO") In my experience, it's better to give all parameters, don't assume they're optional (even when the documentation says so). As for setting up some sort of "filter" for intruders, it depends on the complexity of the mission, but I'd try an intruder category/typename check in zone.
-
Yup, that did nothing for me either, that's why I ended up creating my own script. It's been a while since I wrote that script, it might contain obsolete stuff, also, perhaps it would be a good idea to rewrite it from scratch :D What are you trying to accomplish? Perhaps we can come up with something better.
-
@BenC If you tell us what you want to accomplish, specifically, we'll show you the way (hopefully).
-
This probably isn't the issue, but, afaik, GROUP:FindByName() can only work with one group at a time. This will only find the group named "HQ", the group "Bravo HQ" will be ignored: local HQ = GROUP:FindByName( "HQ", "Bravo HQ" ) Why not do this instead?: local HQ = GROUP:FindByName( "HQ") local BravoHQ = GROUP:FindByName("Bravo HQ")
-
Well, it's not a perfect solution by any means, just a workaround that has caused me way more pain than I anticipated :lol: Btw, I edited the script in the spoiler, there's a line that's not needed and another that needs to be modified. Cheers!
-
@Sierra99 If you're looking for a scripted workaround, this works (the pilot will fly a bit like a sot, though :drunk:): Test mission + script file attached (the huey will land on the normandy on bingo fuel) Huey Orbit Test.miz Huey Orbit Ship Test.lua
-
@Everyone Thanks for clearing it up, guys! I'm no coder, just a guy who likes writing scripts from time to time, that's why I ask silly questions sometimes :doh: Have a good one!
-
Please, don't take this the wrong way, but I don't get why some people use the variable in its own declaration (I'm assuming this is meant to be the full declaration of the variable BombingRange). Is this meant to "isolate" RANGE:New() or something like that? Normally, I'd do it like this: BombingRange = RANGE:New("My Bombing Range") :AddBombingTargets(bombing_targets, 50) :Start() Which is the same as this: BombingRange = RANGE:New("My Bombing Range"):AddBombingTargets(bombing_targets, 50):Start()
-
Have you tried using "allied air group inside allied trigger zone" as condition for the "Ragnarok end" continuous trigger? How are you setting it all up in ME? Could you post your mission here? Here's what I'd do if I were to set this up using ME triggers (I'd prefer scripting it, though. It would be simpler and cleaner): 1 - Continuous trigger checking for the presence of allied groups inside any enemy trigger zones. This continuous trigger should have a flag check "flag X is not Y" as an additional condition. It should also have "Ragnarok start" as action. 2- Continuous trigger checking for the presence of CAP groups inside allied trigger zones (or allied groups, if you like). This trigger should have "set flag X to Y" and "Ragnarok end" as actions. 3- Another continuous trigger that will be used to reset flag X. This trigger should have "allied groups NOT in enemy zone" and "CAP groups NOT in allied zone" as conditions (or allied groups only, your choice). It should also have "set flag X to anything but Y" as action. Now, I think this covers all the bases, these 3 continuous triggers should allow for the kind of behaviour you're after. Ragnarok will start every time allied groups enter any enemy zone, hostilities will continue until the CAP groups reach the allied zones (you can use allied groups instead of CAP groups for this if you like). Btw, scripting in DCS is way easier than it might seem, if you're interested in learning, PM me. EDIT: The problem of CAP and SAM groups not engaging the second time around might be related to AI behaviour rather than the ME triggers used. It would be great if you could post your mission here.
-
@Neon67 The F14 module is brand new, there's a chance it still hasn't been fully implemented. Anyway, make sure that the bombs are "compatible" with the bombing task in ME. For instance, you can't bomb runways with guided missiles/bombs, that task is only compatible with unguided bombs and heavy unguided rockets. Try replacing the F14s with other planes that are known to work with bombing tasks (B1, A10, F15E, etc.), see if the problem persists. As for the "red cover" planes, I don't think those are available in ME, you might have to use mods.
-
Or you could script it instead. You could have all the randomization + spawning process done via a single F10 menu command (or specific events), as many times as you wanted, no need to restart the mission.
-
@Rockrend If you're only interested in knowing the fuel status of a specific plane, you don't need to use that iterator. You can do this instead:
-
I might be mistaken here, but I think that carpet bombing only works with WW2 planes. Try regular bombing (it always works for me), see if the problem persists.
-
Air unit to follow ground unit/ship - basic scripting
Hardcard replied to Sickdog's topic in Mission Editor
@Sickdog Remember the script I gave you for the offset landing point on that cargo ship? Let's see if I can find it... here it is You can try your luck with MOOSE, see if :RouteToVec3() works with the offset pointVec3 returned by that script. If it doesn't work, DCS task mission looks like a promising alternative (or not :D) . -
:Destroy() will remove the unit from the map without leaving a "carcass". You'll probably need to create an actual explosion in order to achieve the desired effect, I'd try :Explosion(). Now, I don't know if the explosions generated in such a way actually deal damage to objects, you'll need to test it.
-
Air unit to follow ground unit/ship - basic scripting
Hardcard replied to Sickdog's topic in Mission Editor
Remove that comma, pos table has no further values, so that comma shouldn't be there. Also, your followTask table isn't closed, you're missing the final } Here's a corrected version: local followTask = { id = 'Follow', params = { groupId = 5, pos = {x = 200, y = 0, z = -100} } } Group.getByName('follower'):getController():pushTask(followTask) As for a solution to your problem, I can't get into it right now, but I'm sure that either Funkyfranky or Grimes will be able to help with this. -
@Surrexen Glad you figured it out! You don't need to subscribe the SET_GROUP to events that won't be used in the script (though nothing serious will happen if you do). This should be enough for the purpose of your particular snippet: SET_MIG21Bis:HandleEvent(EVENTS.Crash) Also, I thought about mentioning that this is a weird way of defining a SET: SET_MIG21Bis = SET_GROUP:New() SET_MIG21Bis:FilterPrefixes( { "SQ IRN MiG-21Bis", "SQ RUS MiG-21Bis" } ) SET_MIG21Bis:FilterStart() SET_MIG21Bis:HandleEvent(EVENTS.Dead) But since there are examples of this in the MOOSE documentation, I assumed it wasn't really a problem. Anyway, this is how I'd normally do it: SET_MIG21Bis = SET_GROUP:New() :FilterPrefixes( "whatever" ) :FilterStart() [color="Blue"]--Then I subscribe the SET to the relevant EVENT[/color] SET_MIG21Bis:HandleEvent(EVENTS.Dead) [color="Blue"]--Finally, I create the OnEvent function[/color] function SET_MIG21Bis:OnEventDead(EventData) [i][b]Stuff I want done[/b][/i] end
-
@Surrexen I've never used the A2A Dispatcher, so I'm afraid I can't provide much assistance with problems related to it, sorry. One of the things I'd do is make sure that the SET_MIG21Bis variable is declared before you set up the A2A Dispatcher, other than that :dunno: If I were you, I'd pay a visit to the MOOSE Discord channel and ask there, chances are the solution to this particular problem has already been given there.
-
Lua scripting : monitoring static object status ?
Hardcard replied to CougarFFW04's topic in Mission Editor
There seems to be a problem with event handlers when combining MOOSE and MIST. No worries, though, here you have a "standard" DCS script that doesn't seem to conflict with MIST (also, it doesn't require name prefixes in ME, since it targets all statics and cargo objects in the mission): Now, there's some minor nonsense going on with sea shelf objects, but it shouldn't be a problem. Also, keep in mind that this script will generate a message for EVERY static/cargo object destroyed in the mission. If you want to target only specific objects, you'll need to add name checks as well.