Jump to content

Hardcard

Members
  • Posts

    1080
  • Joined

  • Last visited

Everything posted by Hardcard

  1. @Everyone We've finally made SWAPR work on a dedicated server, no more spawn collisions! :yay: If things go according to plan, I'll be releasing a new version of SWAPR in the coming days, after polishing and further testing. Next on the list is Stennis implementation!
  2. @Jaghiti Last time I tried the AI BALANCER it wasn't working properly What version of MOOSE are you using?
  3. If Escort_1 consists of ground vehicles, I guess you can use: Escort_1 = GROUP:FindByName("BlueConvoy #001") Hold = Escort_1:TaskHold() Escort_1:SetTask(Hold) [color="Blue"]-- or you can also try[/color] Escort_1:RouteStop() As for trigger.action.groupStopMoving(), it requires the DCS group object, not the MOOSE group object (like Delta pointed out): trigger.action.groupStopMoving(Escort_1:GetDCSObject())
  4. Careful! I forgot to add the groupID parameter in the message trigger, check my edited post for the corrected syntax
  5. @Gunnar81 Sure, you can use the above script for that. Its structure is pretty simple: 1- Airplane unit declaration 2- Function that will return the airplane's internal fuel weight (in either lbs or kg) when called / executed 3- Variable that will call / execute the function and store its returned values 4- Fuel quantity checks that can used for a variety of purposes. This should do the trick for you (required values marked in red, if you want to use kg values, use Fuel_Kg instead of Fuel_Lbs in the check): local MyPlane = Unit.getByName("[color="Red"]PILOT name of the aircraft in ME[/color]") local function GetFuelWeight(MyPlane) local PilotCallsign = MyPlane:getCallsign() local Aircraft_Type = MyPlane:getDesc().typeName local Aircraft_Max_Internal_Fuel = MyPlane:getDesc().fuelMassMax local Fuel_Multiplier = MyPlane:getFuel() local Fuel_Kg = math.floor( Aircraft_Max_Internal_Fuel * Fuel_Multiplier + 0.5) local Fuel_Lbs = math.floor( Fuel_Kg * 2.2046 + 0.5) return PilotCallsign, Aircraft_Type, Fuel_Kg, Fuel_Lbs end local PilotCallsign, Aircraft_Type, Fuel_Kg , Fuel_Lbs = GetFuelWeight(MyPlane) [color="Blue"] -- This variable contains 4 different values from the referenced aircraft: PilotCallsign, Aircraft_Type, Fuel_Kg and Fuel_Lbs. Use them at your discretion[/color] [color="blue"]-- Then you can use a simple logic check to set stuff in motion, for example... [/color] if Fuel_Lbs == [color="red"]value[/color] then trigger.action.outTextForGroup(MyPlane:getGroup():getID() ,"[color="Red"]Content of the text message[/color]", 10) [color="Blue"]-- This message will be sent when fuel quantity is equal to the chosen amount[/color] end
  6. @mono6020 I guess you could try the switchWaypoint command, although I'm not sure it works with ships (I don't think it does, tbh). :RouteToVec3 and :RouteToVec2 work for ship groups (not for individual ship units, though), so you could try to use them in combination with a scheduler and ZONE:GetRandomVec3() / ZONE:GetRandomVec2() , in order to generate a random route automatically (like, get a random vec3/vec2 from the zone and execute RouteToVec with it every 5 to 10 minutes or so). I'm sure there are better ways of doing this... but I don't know them :D
  7. Yup, I figured you were probably trying to place the statics "blind"
  8. @e33et
  9. @johnv2pt0 Did you modify me_route.lua in order to have the "Takeoff from ground" option available for the two F-5s? I'll need to know the exact modifications you made in order to provide a definitive answer. EDIT: Problem solved (I think), you have a PM ;) (Btw, the replacement F-5s won't go anywhere, even when set to "Takeoff from ground hot", since they'll spawn without fuel)
  10. @Sandman1330 As mentioned, I think I've already solved this particular issue, but the new version is still being tested, hopefully, I'll get definitive results from different users soon, so I'll be able to release it. In the meantime, I'll send you the new test version I'm working on via PM, it would be really helpful if you could test it on a dedicated server, along with other players :thumbup:
  11. I'll try, but FlightControl (the creator of MOOSE) isn't around much, so I make no promises. Hehe... that would be like like modifying a smartphone to turn it into one of these...
  12. @johnv2pt0 Please, post an example mission here or send it to me via PM
  13. @Sandman1330 As Rudel_chw pointed out, you're using an old version of MOOSE, which doesn't support some methods that are required to run SWAPR. I provided a download link to a valid Moose.lua in the OP, please use that one, don't use anything that's not specified in the OP.
  14. @Sandman1330 I'll need more information Post your mission here or send it to me via PM
  15. That's a nice solution (although you might want to destroy Ship_1 before spawning Ship_2) Here's an easy way to stop ships without the need of having them removed / replaced: local ShipGroup = GROUP:FindByName("Name of the ship group in ME") ShipGroup:RouteToVec3( ShipGroup:GetVec3() , 0 ) [color="Blue"]-- This routes the ship group to its current position at speed 0, which causes the group ships to stop their engines... the ships will keep coasting for a few seconds before coming to a full stop[/color] Btw, you can simply edit the messages instead of constantly removing them :)
  16. It can't be done with clients / AI units :cry: But you can try to manually place static Su33s linked to the Kuznetsov unit + offset fixation enabled. Even then, I'm not sure 100% it'll work, since the Kuznetsov isn't really implemented for that sort of thing.
  17. Where is SpawnUnit declared? It's not included in the snippet. Also, :SpawnFromUnit() is a method for SPAWN class, not for UNIT class, it won't work with a UNIT object... Also, Carrier_1:Stop() will stop the scheduler (if it works), not the ship. Have you taken the time to learn the basics of MOOSE? I think you should be doing that first, before trying to code these things. :book: https://flightcontrol-master.github.io/MOOSE_DOCS/Documentation/index.html Also, I recommend that you set yourself up with LDT, it'll help you out with basic stuff (class methods, invalid syntax, etc):
  18. First off, ZONE_UNIT:New() requires that the name of the zone be given as a string (meaning between quotes... ' ' or " ") Also, :IsCompletelyInZone() requires the zone wrapper (object), not the name of the zone. Try this: Ship_1 = UNIT:FindByName( "RedShip #001" ) Heli_1 = GROUP:FindByName( "BlueHeli #001" ) Zone_Carrier = ZONE_UNIT:New( "ZoneShip", Ship_1, 5000, dx) [color="Blue"]-- The name of the zone in ME should be ZoneShip... although I'm not 100% sure that you actually need to have a zone in ME for this particular object[/color] FlareDrop3 = SCHEDULER:New( nil, function() if Heli_1:IsCompletelyInZone( Zone_Carrier ) then trigger.action.outText(' Online', 12) end end, {}, 0, 3 )
  19. Sure, tasks can be pushed via scripting... but will those Su34s actually execute them? I'm not sure they will... I might test it if I get the chance
  20. Right, sorry :doh: I guess you could use this, then (required fields marked in red): local MyPlane = Unit.getByName("[color="Red"]PILOT name of the aircraft in ME[/color]") local function GetFuelWeight(MyPlane) local PilotCallsign = MyPlane:getCallsign() local Aircraft_Type = MyPlane:getDesc().typeName local Aircraft_Max_Internal_Fuel = MyPlane:getDesc().fuelMassMax local Fuel_Multiplier = MyPlane:getFuel() local Fuel_Kg = math.floor( Aircraft_Max_Internal_Fuel * Fuel_Multiplier + 0.5) local Fuel_Lbs = math.floor( Fuel_Kg * 2.2046 + 0.5) return PilotCallsign, Aircraft_Type, Fuel_Kg, Fuel_Lbs end local PilotCallsign, Aircraft_Type, Fuel_Kg , Fuel_Lbs = GetFuelWeight(MyPlane) [color="blue"]-- This variable contains 4 different values from the referenced aircraft: PilotCallsign, Aircraft_Type, Fuel_Kg and Fuel_Lbs. Use them at your discretion[/color] trigger.action.outTextForGroup(MyPlane:getGroup():getID(), PilotCallsign.." : Fence [color="DarkOrange"]in[/color], remaining fuel "..Fuel_Lbs, 10) [color="Blue"]-- This message emulates the transmission to the ground controller[/color] [color="blue"]-- Then you can use a simple logic check to set stuff in motion, for example...[/color] if Fuel_Lbs >= [color="Red"]value[/color] then [color="blue"]-- Do stuff when remaining fuel quantity is either at or over a given value, for instance, set flag 666 to 1[/color] trigger.action.setUserFlag( "666", 1 ) elseif Fuel_Lbs < [color="red"]value[/color] then [color="Blue"] -- Do stuff when remaining fuel quantity is under a given value, for instance, set flag 666 to 2[/color] trigger.action.setUserFlag( "666", 2 ) end Run the script at Fence In... for Fence Out, simply copy-paste this script and change the value marked in orange (change "in" for "out")
  21. So, basically a ground unit sending you a message at fence in (including fuel quantity), is that it?
  22. @Everyone Good news, people! I've managed to finally get SWAPR working with some Stennis-based clients (only helicopters so far...fingers crossed for planes) The new SWAPR version I'm working on features: I'll keep working on Stennis plane implementation... if I pull it off, I'll need someone to punch me, to make sure I'm not dreaming ;)
  23. If SCORING relies on birth events (which I think is the case), that would explain the issue. This isn't a MOOSE problem but a DCS one... for some reason, birth events don't trigger the very first time a player joins a mission. In order to work around this issue you need to join Spectators the very first time you enter the mission... you're free to choose any coalition / slot you want after that, birth events will trigger fine from that point on
  24. Well, good luck with this
  25. By radio message, do you mean radio transmission (as in playing a prerecorded audio file)?
×
×
  • Create New...