609_Relentov
Members-
Posts
526 -
Joined
-
Last visited
Content Type
Profiles
Forums
Events
Everything posted by 609_Relentov
-
Text to specific players in zone
609_Relentov replied to 74DELTA's topic in Scripting Tips, Tricks & Issues
Good luck. I see in your example you are also outputting sound, and there's a similar function to send sounds to a unit: outSoundForUnit(...), see here: https://wiki.hoggitworld.com/view/DCS_func_outSoundForUnit -
Text to specific players in zone
609_Relentov replied to 74DELTA's topic in Scripting Tips, Tricks & Issues
Maybe use outTextForUnit(...); Here's the page in wiki.hoggitworld.com: https://wiki.hoggitworld.com/view/DCS_func_outTextForUnit -
Hey Sean, thanks for the reply. Yes, I was reading about access to this function possibly being prevented based on server settings (for multi player missions). As for the last suggestion, that makes sense, although the reason I wanted to get this info is for my BluForAC script, which would be something that anyone could load in their mission, thus I would not have control of the invisible flag being set. It's not the end of the world, it just means if someone used that script, if they attempted to call up some CAS aircraft to attack enemy ground units, if the ground units identified to be attacked by the friendly AI aircraft happened to be set to invisible, the AI aircraft would just return to base. I will need to add that to the script readme/features so users know; here's the thread for that script:
-
Hmm so far no luck; I found the function entry in the DCS Export Script on the Hoggit SSE site: LoGetObjectById() -- (args - 1 (number), results - 1 (table)) Returned object table structure: { Name = Type = {level1,level2,level3,level4}, ( see Scripts/database/wsTypes.lua) Subtype is absent now Country = number ( see Scripts/database/db_countries.lua Coalition = CoalitionID = number ( 1 or 2 ) LatLongAlt = { Lat = , Long = , Alt = } Heading = radians Pitch = radians Bank = radians Position = {x,y,z} -- in internal DCS coordinate system ( see convertion routnes below) -- only for units ( Planes,Hellicopters,Tanks etc) UnitName = unit name from mission (UTF8) GroupName = unit name from mission (UTF8) Flags = { RadarActive = true if the unit has its radar on Human = true if the unit is human-controlled Jamming = true if the unit uses EMI jamming IRJamming = -- same for IR jamming Born = true if the unit is born (activated) AI_ON = true if the unit's AI is active Invisible = true if the unit is invisible Static - true if the unit is a static object } } I don't see any other documentation, but it appears you call LoGetObjectById() with one parameter, passing the unit ID, and it returns a table. Not clear if the returned table has just one entry (i.e. index = 1), and if the Flags table within that one entry has just one entry as well (i.e. index = 1). So, it seems like to reference the "Invisible" boolean element, you could reference the table returned from LoGetObjectById via tblLoGetObjectById[1].Flags[1].Invisible, but I'm seeing an error in the dcs.log when I try this syntax (ERROR SCRIPTING (Main): error in error handling) and my trigger.action.outText(...) commands are not writing anything out, it's exiting early. @Sean B. do you have any examples of using this function and the resulting returned table? Thanks!
-
Thanks for the reply. I hadn't used DCS.getUnitProperty()... unfortunately this is not what I was looking for, this is more for if units are hidden on the F10 map (so we/clients can't see them), I'm talking about units/groups that are invisible to the AI. I see the Controller.setCommand() method, with the SetInvisible command/task that will set a unit to invisible (to AI), but I'm trying to find a way to determine if a unit has previously been set to invisible (e.g. via ME) and will thus not be seen by the AI.
-
Greetings script writers and users. I've made available my BluForAC lua script in the User Files downloads section. This script is a complement to the OpForAC script but is for when you want some assistance from friendly AI aircraft and helicopters, instead of opposing force aircraft to fight and shoot down. This script will spawn 1-4 friendly force AI aircraft (repeatable), which can be fighter, attack, multi-purpose aircraft, or helicopter types. AI aircraft types, engagement scenarios (e.g. CAP, CAS, SEAD, Anti-Ship) and some pre-set target waypoint distances are selectable from the F10 menu, under the F10 menu item: "Spawn AI BluFor Aircraft At Will". Just point your client/player aircraft directly at the enemy ground/sea target(s) you wish them to attack, and (as applicable) choose the distance you want them to fly as they search for targets. For enemy aircraft targets, pointing your client/player aircraft at them will help, but is not necessary. See the image below to see some of the F10 menu items. After completing the OpForAC script, I thought why not make a similar script for friendly forces, including not just friendly CAP aircraft that would attack enemy aircraft, but also include CAS, SEAD and anti-shipping duties as well, and so BluForAC was born. Also, in conjunction with using the OpForAC script, this would allow me to be confronted with both enemy and friendly AI aircraft in my relative air space, to help me practice friendly/enemy aircraft identification/IFF. This script was written to allow a Player (for single mission) or Client (for single or multiplayer mission) to call up friendly AI aircraft at will, without having to create any in the mission. Also, it has some options that will persist as long as the mission is active (i.e. it does not write to a file, but to tables), including: - AI aircraft skill (default = random) - AI aircraft starting altitude AGL (default = ~co-alt) Here's the link to the script in user files: https://www.digitalcombatsimulator.com/en/files/3335913/ Good luck and have fun. AKA_Relent *** Features: *** Version 1.00 AI BluFor aircraft coalition will be the same coalition of the aircraft or helicopter the client (MP) or player (SP) spawns in The same AI BluFor aircraft type can be re-spawned as many times as desired One to four AI BluFor aircraft can be spawned at a time AI BluFor aircraft load-out depends on engagement scenario (e.g. Anti-Ship, CAP, CAS, SEAD) AI BluFor aircraft skill defaults to "Random", but can be changed via 'Options' menu. Note that the updated AI skill persists for the initiating player name, for the duration of the mission AI BluFor aircraft starting altitude AGL defaults to "Co-Alt+", but can be changed via 'Options' menu using pre-set low/medium/high altitudes AGL. Note that the updated starting AI altitude AGL persists for the initiating player name, for the duration of the mission AI BluFor aircraft spawn directly behind client/player aircraft with the same heading as the initiating client/player aircraft; To maximize the ability of the AI BluFor aircraft to find enemy targets (especially for Anti-Ship, CAS and to a lesser degree SEAD missions), point your client/player aircraft directly at the enemy target(s) you wish them to attack AI BluFor aircraft spawn at a similar altitude as the client/player by default (i.e. "Co-Alt+"), but can be changed to pre-set altitudes via Options menu; AI helicopters spawn at ~500 feet AGL max AI BluFor aircraft's second and final waypoint is fixed for CAP mission types (20 miles, as defined by glbCAPDistBluFor), but is selectable via F10 menus for Anti-Ship and SEAD missions; for CAS missions, the second and final waypoint is variable depending on how far ahead ground/sea targets are found; If no targets are found, CAS BluFor aircraft will not spawn AI BluFor CAS aircraft aircraft will only spawn if enemy ground units are inside the "target search circle", which is in front of the second waypoint (the distance to which is calculated, depending on if ground units are located ahead of the Client/Single Player aircraft); The target search circle is 10 miles in diameter, as defined by the glbCASSearchRadius variable Once an AI BluFor aircraft returns to a friendly/neutral base and lands, it will be de-spawned once the aircraft stops (there is a function that checks for this every 120 seconds) A maximum of 24 AI BluFor aircraft can be spawned and active (alive) at a time, as defined by the glbMaxBluForSpawnable variable; If you attempt to spawn AI BluFor aircraft and it would cause the total number of active (alive) AI BluFor aircraft to exceed this maximum number, you will see a message telling you they cannot be spawned, until the number of active AI BluFor aircraft is reduced by attrition or they land and de-spawn You can prevent BluFor AI aircraft from spawning in or travelling through an exclusion zones; Simply create one or more circular trigger zones that include "Blue Exclusion Zone" or "blue exclusion zone" in the trigger name.
-
OpForAC - Opposing Force AI Aircraft script
609_Relentov replied to 609_Relentov's topic in Scripting Tips, Tricks & Issues
I uploaded a new Zip, now version 1.4.1 I made a very minor update, namely, to bump up the starting unit and group ids used to assign to newly spawned AI aircraft, to reduce the chance they are assigned to ids for existing aircraft in the given mission. -
Updates to User Files (i.e. My files) is not persisting
609_Relentov replied to 609_Relentov's topic in Forum and Site Issues
Yep, I think you hit the nail on the head @Sedlo, much appreciated. Apparently by default the first time you edit one of your User Files (since this Map field was added), that drop down has "not set", and if you don't select something (e.g. All maps), it won't save your changes. I just did another update on another kneeboard of mine after setting that field properly, and the changes stuck. Not sure if this was posted somewhere (apologies if it was), but it would have been nice if us users got a warning about ensuring this new field has a proper selection before clicking Update ... Still doesn't explain why another of my User Files (kneeboard - https://www.digitalcombatsimulator.com/en/files/3318837/ ) was removed . -
Updates to User Files (i.e. My files) is not persisting
609_Relentov replied to 609_Relentov's topic in Forum and Site Issues
@BIGNEWY thanks, it’s the AJS37 kneeboards, user file 3319591. It seems to be happening with other files as well; also sent you a forum message -
Updates to User Files (i.e. My files) is not persisting
609_Relentov replied to 609_Relentov's topic in Forum and Site Issues
Thanks Rudel, strange, I deleted cookies on Edge, and tried again, still doesn't work. I then download/installed Chrome, logged in and tried on that browser, same result after clicking Update... this is really odd. -
Updates to User Files (i.e. My files) is not persisting
609_Relentov replied to 609_Relentov's topic in Forum and Site Issues
Tried again today, still not saving to web site, even though when I click the Update button, it's displaying "File uploaded". Is anyone else able to save their User Files successfully? -
I was looking at the hoggitworld SSE documentation, and I didn't see a method that would allow you to assign a country that was currently neutral (e.g. coalition.side.NEUTRAL) to the blue or red coalition (e.g. coalition.side.BLUE, etc.). Is this possible via scripting? The reason is that it might be nice if a script that required a specific country to be RED or BLUE but was instead NEUTRAL to be automatically assigned to the proper coalition at the start of the mission. I don't see that it's possible given what I've seen in the SSE documentation, and from doing some searches here, but wanted to double check in case someone was able to do this.
-
OpForAC - Opposing Force AI Aircraft script
609_Relentov replied to 609_Relentov's topic in Scripting Tips, Tricks & Issues
I uploaded a new Zip, now version 1.4 I added two features: - Once an AI OpFor aircraft returns to a friendly/neutral base and lands, it will be de-spawned once the aircraft stops (there is a function that checks for this every 120 seconds) - A maximum of 24 AI OpFor aircraft can be spawned and active (alive) at a time, as defined by the glbMaxOpForSpawnable variable; If you attempt to spawn AI OpFor aircraft and it would cause the total number of active (alive) AI OpFor aircraft to exceed this maximum number, you will see a message telling you they cannot be spawned, until the number of active AI OpFor aircraft is reduced by attrition or they land and de-spawn Also made two fixes: - Previously the call signs for the spawned OpFor aircraft were fixed (e.g. Enfield11), and hadn't given it much thought, until I was testing and switched sides. Then I saw a bunch of "Enfield11" aircraft all over the place :). So, for OpFor aircraft spawned on the blue/alllied side, they will use more dynamic in-game call signs. Those on the red/axis side will use dynamic numeric call signs. - With the changes to the SA-342, the OpFor SA-342L and SA-342Mistral were spawning with no/missing weapons. They were corrected such that both are now SA-342L, one with cannon/rocket load out, one with Mistral loadout. -
Interestingly now it's working - I had another condition in that expression with the isActive, so that may have been the culprit. In any case thanks for putting up your code example to help re-affirm that it's working.
-
Thanks, Kanelbolle, interesting that it works for you. I was utilizing isActive slightly differently, which was not working after the target groups/units were activated. for i, grp in pairs(coalition.getGroups(coalition.side.RED, Group.Category.GROUND)) do for idx, theUnit in pairs(Group.getUnits(grp)) do if (Unit.isActive(theUnit) == true) then -- late activation unit is active ... <do stuff> end end I can try it more how you are using the method/function and see how it goes.