Jump to content

St3v3f

Members
  • Posts

    499
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by St3v3f

  1. Not thrilled about the WW2 stuff as I am not interested in old warbirds, but having a European theater would be exiting
  2. Simple mission without combat. Nice weather atmosphere, some air traffic and with ATIS for departure and destination airfields. Tanker available on the way Ferry Tbilisi - Kutaisi.miz
  3. Updated the script Thanks to Grimes giving us Mist 3.1, it's all working lovely now. When the respawn is triggered, a new tanker will appear while the old one remains existent and will RTB I also removed the issue with the speed and respawning when holding short by changing the condition from 'speed less than' to 'on ground'
  4. Excellent job Grimes, wish I could +rep you again Tanker respawn is working lovely now
  5. I don't know right know if there is a file option for the condition, but using a file makes editing more work in my opinion as it is not automatically updated into the mission. You need to go to the trigger and import the file again. Pasting the content in is quicker for me. And on top of that, imported files like scripts and sounds may get lost sometimes.
  6. Any chance you can provide the .miz?
  7. I don't quite understand what your problem is with the group:inAir() line. Granted, the snipped wasn't tested as I've put it out before breakfast, but I've just loaded it and it ran fine. inAir() is a function that you can call for Objects of the SSE and it'll return true or false. Alternatively, you can use Object.inAir(group) Documentation about the SSE and the inAir function is here: http://en.wiki.eagle.ru/wiki/Part_1 http://en.wiki.eagle.ru/wiki/Part_2
  8. To check if a player is on the ground, try using this as a LUA PRECONDITION in a trigger: local group = 'A-10 #1' --Enter the groupname from the ME here group = Group.getByName(group) if group ~= nil then group = group:getUnits()[1] if group:inAir() then return false else return true end else --If Group does not exist return true end return false The question is, what do you want to happen with inactive groups (Slots that aren't taken)? In this example, they are treated as 'on Ground'. If you want them as 'in Air', remove these two lines: else --If Group does not exist return true
  9. Thanks for the update Grimes! I've converted the tests from my SCT issues over to Mist v3, these are the results: Now with mist.cloneGroup: The tanker starts in the air, with 0 speed, stalls out and dives downwards, but has the engines on and can recover. While he airstarted at 6000 feet with sct, he now does at about 100. Although the engines are now running as in Case 1, the 100 feet are obviously not enough to recover from the 0 speed and it crashes. New code, same result: local group = mist.getGroupData('Tanker_Arco') group.route = { points = mist.getGroupRoute('Tanker_Arco', true) } group.country = 'USA' group.groupType = 'AIRPLANE' mist.dynAdd(group) Now things get a bit weird. local group = mist.getGroupData('Tanker_Arco') group.route = { points = mist.getGroupRoute('Tanker_Arco', true) } group.country = 'USA' group.groupType = 'AIRPLANE' group.groupName = nil group.groupId = nil group.units[1].unitId = nil group.units[1].unitName = nil mist.dynAdd(group) Result: 00023.635 ERROR DCS: Mission script error: : [string "--[[..."]:4576: bad argument #1 to 'lower' (string expected, got nil) stack traceback: [C]: ? [C]: in function 'lower' [string "--[[..."]:4576: in function 'getPayload' [string "--[[..."]:4473: in function 'dynAdd' [string "local group = mist.getGroupData('Tanker_Arc..."]:9: in main chunk If I do group.units[1].unitName = 'bla', it'll do the same as with sct, spawn a new tanker that sits idle on the ramp It seems to me that there is a check missing that getPayload doesn't get called in cases like this. So I tried to commenting the line out and the tanker spawned with unitName = nil and sat idle on the ramp again. Same as 4
  10. It might be, but I only tried using events once and that didn't work out well. Maybe someone else has some experience in this
  11. While creating a script to respawn tankers, I encountered some strange issues. But I am not sure whether it's a problem with SCT or the SSE: Case: Tanker Airstarting sct.cloneGroup('Tanker_Arco', true) Result: The second tanker appears with the engines off, diving into the ground Case: Tanker Rampstart sct.cloneGroup('Tanker_Arco', true) Result: Exactly the same, the second tanker appears (in air!), engines off, nosediving Case: As a workaround, I tried to build the group data and create the group with sct.dynAdd: local group = sct.getGroupData('Tanker_Arco') group.route = { points = mist.getGroupRoute('Tanker_Arco', true) } sct.dynAdd('USA', 'AIRPLANE', group) Result: Good so far. The original group despawns of course, the new tanker starts up and takes off Case: Since I don't want a respawn but a clone, my next step was to remove the unit/goup names/ids from the collected data: local group = sct.getGroupData('Tanker_Arco') group.route = { points = mist.getGroupRoute('Tanker_Arco', true) } group.groupName = nil group.groupId = nil group.units[1].unitId = nil group.units[1].unitName = nil sct.dynAdd('USA', 'AIRPLANE', group) Result: The original tanker does it's thing. Starts up and takes off all well. The new group however spawns in, turns the engines off and will sit around idle Case: The same code as 4 with the tanker air starting Result: This is where the circle closes. The new tanker spawns in, engines off, nosediving into the ground. I then created the group data by taking the complete group informations out of the mission file, changed the group/unit names/ids and called coalition.addGroup and everything worked as it should, the second group spawned and took off. So it's my impression that something within SCT doesn't work out Tanker Respawn.zip
  12. Looking forward to it :thumbup: It will integrate the SCT stuff I presume?
  13. I just had a thought. Originally I said the triggerzone is optional. You have to keep in mind though, that you should always place a triggerzone over the takeoff airfield, if the tanker does a ramp start. Reason: If it respawns and starts to taxi, it's speed goes above the 1 m/s threshold. If he then holds short of the runway or stops on the runway, the speed drops back below that threshold and it will respawn again. So either have a triggerzone over the airfield and/or increase the 'respawnSpeed' variable to above taxi speed
  14. All you need to do is to stick with the first of the two scripts I've posted and change the first four lines: local units = mist.makeUnitTable({'[blue][plane]'}) local flag = 50207 local zones = {'1 Sphere Zone'} local zone_type = 'sphere' local units = mist.makeUnitTable({'RDR AGrp01 Pilot'}) local flag = 10107 local zones = {'Gudauta Zone'} local zone_type = 'cylinder' local function unitsInZonesOnOff(result) local ret = mist.getUnitsInZones(units, zones, zone_type) if #ret == 0 and result == true then trigger.action.setUserFlag(flag, 0) result = false elseif #ret > 0 and result == false then trigger.action.setUserFlag(flag, 1) result = true end mist.scheduleFunction (unitsInZonesOnOff, {result}, timer.getTime() + 1) end unitsInZonesOnOff(false) In my tanker script, the detection of 'parking' is done by checking if it's speed is less than 1 m/s, irrelevant of where he is. So even if he just came off the runway and holds on the taxiway because of traffic, the script will detect this as parking and spawn the new tanker. That is perfectly fine for that purpose. The problem with a 'proper' detection of parking is that you don't know which airfield it will land at and even if you know, you don't know which parking spot he will take. That may be easy for large aircraft in Gudauta as there is only the one ramp suitable for them, but other airports have the large pads all over the place. Since the script was intended to be easy to implement, I decided to go with that implementation, rather than having to place a triggerzone over every possible parking spot in the Caucasus. The reason the mist functions are not suitable in this situation is that they only set the flag to true when the conditions are met, they don't set them to false if they are not met. If you have a unit move through a zone, the flag will stay on when the aircraft is out of the zone again. The scripts I've provided WC with, work similar to mist.flagFunc.units_in_zones and mist.flagFunc.units_in_moving_zones, but they also set the flag off when the conditions are not met anymore
  15. Reserved
  16. Baron's Tanker (and AWACS) Respawn Script; Version 2.1 If you have a long-running mission and want to have unlimited tanker support without having to place multiple tankers in the mission or are tired of being afraid of idiots killing the tanker, this is for you. The Tanker will respawn when one of three conditions is met: The Tanker is destroyed or damaged If it landed If it's fuel is low Steps: Add Mist to the mission. The script is working with DCS 1.5.2 and Mist 4.0.57 Place a tanker in the mission just like you always do. Give him waypoints and orbit instructions etc. It should have a RTB-Waypoint as well Create a MISSION START Trigger. For Action, select DO SCRIPT Paste the following code --RESPAWN SCRIPT; MISSION START -> DO SCRIPT local oldGroupRemovalTime = 2700 -- Time (seconds) after which old groups are removed barons_respawn_script = {} barons_respawn_script.predicate = function(groupName, lowFuelThreshold, lowHealthThreshold) if barons_respawn_script and barons_respawn_script[groupName] then groupName = groupName .. barons_respawn_script[groupName] end local group = Group.getByName(groupName) if not group then return true end group = group:getUnits()[1] if not group or Unit.inAir(group) == false then return true end if group:getFuel() < lowFuelThreshold or group:getLife() / group:getLife0() < lowHealthThreshold then return true end return false end barons_respawn_script.removeGroup = function(group) group = Group.getByName(group) if group then trigger.action.deactivateGroup(group) end end barons_respawn_script.action = function(groupName) local oldName = groupName if barons_respawn_script[groupName] == nil then barons_respawn_script[groupName] = 0 else oldName = groupName .. barons_respawn_script[groupName] end barons_respawn_script[groupName] = barons_respawn_script[groupName] + 1 local newName = groupName .. barons_respawn_script[groupName] mist.scheduleFunction(barons_respawn_script.removeGroup, {oldName}, timer.getTime() + oldGroupRemovalTime) local group = Group.getByName(oldName) if group then group = group:getController() Controller.setCommand(group, {id = 'DeactivateBeacon', params = {}}) Controller.setTask(group, {id = 'NoTask', params = {}}) end group = mist.getGroupData(groupName) group.route = { points = mist.getGroupRoute(groupName, true) } group.groupName = newName group.groupId = nil group.units[1].unitId = nil group.units[1].unitName = newName group.category = 'AIRPLANE' mist.dynAdd(group) group = Group.getByName(newName) group = group:getController() end barons_respawn_script.checkstate = function(groupName, lowFuelThreshold, lowHealthThreshold, oldresult) local newresult = barons_respawn_script.predicate(groupName, lowFuelThreshold, lowHealthThreshold) if oldresult == false and newresult == true then barons_respawn_script.action(groupName) end mist.scheduleFunction(barons_respawn_script.checkstate, {groupName, lowFuelThreshold, lowHealthThreshold, newresult}, timer.getTime() + 1) end Change the variable at the top as you desire Add another DO SCRIPT action to the trigger Paste the following code --RESPAWN SCRIPT; MISSION START -> DO SCRIPT local groupName = 'Tanker_Texaco' -- Name of the group in the ME local lowFuelThreshold = 0.08 -- RTB when less then this amount of fuel local lowHealthThreshold = 0.75 -- RTB when less then this amount of health barons_respawn_script.checkstate(groupName, lowFuelThreshold, lowHealthThreshold, true) Edit the first three lines to fit into your mission Repeat steps 5 - 7 for other tankers
  17. Master Server is unaccessible again for me and a buddy as well
  18. For a (correct) CCIP pipper to appear, you need to set the UGM dial on the rear aux panel. Settings: 0: S-8KOM 1: S-8TsM 2: S-13 3: Unused 4: S-8OFP2 5: UPK-23 Gunpods 6: Unused 7: FAB-250 8: FAB-500 9: KMGU-2 AO 10: KMGU-2 PTAB
  19. I was talking about Slmod with the chat commands, but even that isn't capable of reading anything out of the chat message and passing it on to somewhere else
  20. Yep, dial in the frequency and flip the ADF switch up. When someone is transmitting on this frequency, the yellow needle on the HSI will point to the source of the transmission. You can tune to the tower frequency and everytime he talks on the radio, you'll get a bearing. Tune in to an ILS frequency, and it will point to the Localizer.
  21. You can create chat-commands that trigger actions, but unfortunately, I am not aware of any mechanism that is able to read data and pass it on to another function
  22. No, what you paid for are 10 activations of the game. A new activation is required after significant changes to the hardware. When you run out of activations, you will get a new one every 30 days, but only up to one remaining activation at most, so you won't be back to 10 activations after 10 months. You also have 10 deactivations, which you can use to revoke an activation and get it back. Therefore you don't have a significant loss when not deactivating, but there is still no reason not to do it.
  23. try a different server
  24. You've also got TACAN available to navigate.
  25. Which is exactly what I said?!
×
×
  • Create New...