

Igneous01
Members-
Posts
130 -
Joined
-
Last visited
Content Type
Profiles
Forums
Events
Everything posted by Igneous01
-
Making lfs and io available in ME Script Environment
Igneous01 replied to Igneous01's topic in Mission Editor
I found the problem - my 1.5 dcs created a seperate install inside of my existing DCS World\bin directory, so I was editing a file that wasn't being loaded by the game. Reinstalled and fixed the path issues and now I can use io and lfs. Thanks guys! -
I'm trying to figure out how to make lfs and io available to my mission. I saw this link in mist: http://wiki.hoggit.us/view/Dump_G For functions mist.debug.dump_G, mist.debug.writeData, and mist.debug.dumpDBs, you must (temporarily!) unprotect the Lua environment and enable the io and lfs libraries. You do this by commenting out the sanitizeModule calls in <DCS main directory>/Scripts/MissionScripting.lua. Just be sure to re-protect yourself later when you run missions from untrusted sources. So I followed those instructions and commented out the sanitizeModule calls in the MissionScripting.lua file (for all the apis). I saved it and restarted DCS. When I go back into mission and try something like env.info(lfs.writedir() or _G["lfs"] or lfs == nil it's always telling me lfs is nil. When I try using lfs = require ("lfs") it tells me require is nil. I made sure to comment out those things so that loadlib and require are available, but everything is still nil in ME environment. How do I get access to these libraries?
-
Thread safe way to remove items from a table
Igneous01 replied to Igneous01's topic in Mission Editor
Hmm, so looks like best option right now is to use a hash table and set indexes to nil (which should be safer than resizing entire table while in scheduled call). -
I've been practicing with the mi8 and I have a really tough time slowing down from 200+ kph. Here is what happens: I drop collective to keep my altitude around 40m off the deck, and slowly pitching up to slow down. Eventually I get around 50 kph and I get some shaking - I check my vertical airspeed gauge and it shows i'm descending 2 m/s, I check the Doppler shift and it shows I'm climbing 1.5 m/s. The shaking gets worse but there's little indication that im entering a VRS, so I start to raise collective, next thing I know I've climbed to 100 meters and I need to do the approach again. I must be misunderstanding something here, because when the instruments are accurate I'm able to control myself and not enter VRS, but when the mi8 is shaking, and both vertical speeds show I'm well above 3m/s descent, I have no idea what is going on - am I entering a VRS? I have the same problem when flaring left or right - get shaking like I'm about to enter VRS, try to raise collective a tiny bit to compensate, then I rocket up 40 meters into the air. Any tips?
-
I'm working on a few scripts where when a client triggers a radio action, some code loops through a collection and gets the nearest objects to the player then does some logic on them. At the same time I want to be able to manage the collection and delete/remove any objects that are dead or nil. Is there a thread safe way of doing this so that the clients code doesn't have a race condition with the scheduled function cleaning up the collection? There's not much information on this, but I assume timer.scheduleFunction() and triggering a function through MOOSE:MENU_GROUP_COMMAND are called on separate threads (please correct me if im mistaken) - if this is the case, are there any locks / atomics available to use within a mission script to synchronize the read/delete?
-
Has this issue been addressed now?
-
So I tried this out with a FARP, and nothing is working. I have a Unlimited Warehouse (Beslan Airfield) with unlimited AC, Weapons and Fuel. I have a FARP close by initialized with: -12 Vihkrs -4 Fuel Tanks -80 Rockets -100 Tons of each fuel type -0 equipment -4 KA50 Airframes Each of the operating percentages are set to 51% The resupply rate is 80km/h, every 5 minutes, with 100 Ton transport capacity. Beslan is added as a supplier. When I go in game, I rearm myself and take all the weapons and loadouts available until it's empty - it never resupplies. No notifications pop up, nothing. Also, there's no way to identify the remaining fuel quantity at a farp - using fuel for resourcing is pointless if you can't explain to the player why they cant refuel (I was testing with smaller fuel quantity, all I got from ground crew was 'negative'). There should be a way to view the contents of a farp in game so that players can either check for themselves, or be told in some way that why they cant be refueled. Attached miz file. ResourceManagerFarpNotWorking.miz
-
I've tried again, this time with simple trigger activation groups - noticeable stutter with 2 or more groups. Also happens with MOOSE:Spawn. Any sort of spawning/late activation causes stuttering.
-
Spawning the same gorup of units endlessly
Igneous01 replied to kylekatarn720's topic in Mission Editor
I looked at your mission, and I think the problem is the two trigger timings: -MOOSE Should be loaded on MISSION START -Your doscript should be called with a time delay (1 seconds or more) It looks like your spawn code is being called before moose has finished initializing. -
Spawning the same gorup of units endlessly
Igneous01 replied to kylekatarn720's topic in Mission Editor
you dont need to use :Spawn() - remove that line and try it afterwards. Have you checked out the example missions? MOOSE has plenty of example and demo missions that show the spawning in action with various unit types. -
So if you delay setting the waypoint information, you can prevent stuttering? In my scenario, I was testing the Dismount Script (i had 4 apcs with various cargo dismount) and there was noticable stutter for a few seconds (out of 4 spawned groups, only 2 had waypoints, and the waypoint was 200m in front of them, which is pretty short distance to compute)
-
Is there scripting support for adding/removing contents from warehouses? Something like: every 30 minutes a logistics convoy spawns from one warehouse, and travels to another warehouse - if it gets there, munitions and airframes are added back warehouse. If they are destroyed, nothing happens. Or: transport helos sling load cargo crates to another warehouse to resupply it. Possible?
-
Hmm, my problem with despawning/respawning the entire group is that there is noticeable lag when you do it (say 6 or more units in group). If there was a way to thread the spawn so that it doesn't interrupt the game itself that would be great.
-
I had a look at the script and added some logic so that it keeps track of remaining alive units. So if 3 guys die and they mount up and dismount again, only 3 will come out. I also added an optional flag parameter you can pass in (ie. to check if both the carrier vehicle and it's cargo are dead). Flag is set to 2 (mounted) 1(dismounted) 0(dead). You can use that to check if trigger if both carrier and group are dead. Mind you my lua is quite crappy (had to copy units table, remove those that are dead from copy, transfer table over) so im sure there are better ways to optimize this script. But from my testing it worked out pretty good. Attached script and miz file (miz is 2.0 nevada). DismountsScript_v1_5.lua Test_Dismount_Script.miz
-
Looking at the hoggit wiki and the unit class, I don't see any methods for creating units and adding them to existing alive groups - is it possible? I'd like to start working on an ai caching script but I'd need the ability to create / delete units apart of an existing group (and keep group leader alive at all times).
-
yes in my case I'm handling the shot event for specific artillery groups. If you want to check for any artillery group, there is a way to do so with Moose by checking the EventData.WeaponCategory or EventData.Weapon properties you can read more about all the properties returned here: http://flightcontrol-master.github.io/MOOSE/Documentation/Event.html##(EVENTDATA)
-
Moose is easier to use for this EHMortarShot = EVENTHANDLER:New() EHMortarShot:HandleEvent( EVENTS.Shot ) function EHMortarShot:OnEventShot( EventData ) -- this checks if the group name that fired was called 'Mortar1' (defined in mission editor) if (EventData.IniDCSGroupName == "Mortar1") then --set your flag here, do whatever end end
-
Late Activation Artillery - Fire At Point does not work
Igneous01 replied to Igneous01's topic in Mission Editor
Is there a way for me to delay trigger activation? (like add a countdown or sleep prior to it activating?) Yes it's in range - if the group is not 'late activation' it will fire it's salvo on the point. -
Has anyone had any luck with getting Late Activation Artillery units to do a fire mission? I tested it with the Russian Mortar in a trigger using: GROUP ACTIVATE(mortar) AI TASK PUSH (mortar -> fire at point) when the group activates (and after waiting 5 minutes) nothing happens.
-
I wont consider this module until it has a combat version, and later in the beta stage.
-
Spawning the same gorup of units endlessly
Igneous01 replied to kylekatarn720's topic in Mission Editor
I recommend MOOSE - spawning is super simple. MySpawnGroup = SPAWN:New("MyGroupName") :InitLimit(1, 100) :SpawnScheduled(30, 0) "MyGroupName" is the name of your group in ME. InitLimit(1, 100) limits the spawning (only 1 unit can be alive at a time, max respawns is 100) SpawnScheduled(30,0) tells the scheduler to respawn the group every 30 seconds If you have a large group you want to keep respawning (say it's 8 units) then adjust the InitLimit accordingly: :InitLimit(8, 100) There's much more stuff you can do - you can choose from predefined group templates and have the spawner randomly choose from those templates, random zones, random attack zones, etc. -
I'm really greatful for the hoggit wiki - it is my main go to place when I need to learn about what kind of calls I need to use and what to pass into them, and it's similar to how the Arma wiki is setup so finding stuff is relatively easy. However there's stuff that's not well explained that I can't find anywhere (how to setup IPC between DCS and an external program, how to connect to luasocket, interop, etc, the various lua environments (mission editor, simulation, external, etc)) For number 2, that's partially my point - cockpit arguments can only be done in triggers, and there's no way to poll a unit for their active radio and frequency. You also can't script dialog. As far as I can tell from searching, there's no way to create triggers in lua. I don't see methods for getting a units health, setting damage to a unit, moveToPosition command, setting weather, adjusting in game time, controlling mission flow logic, missing events (landed, hit, takeoff, flares, chaff). Some other frustrations: can't log boolean variables using env (but this is a limitation of lua it seems). Flags are terrible imo. Considering the majority of trigger functionality is based on an indexed variable with no name, it becomes unwieldy to understand what some trigger logic is doing when all you see is (flagActive(51) && flag(100)==2) - that doesn't explain anything to the coder. It's the equivalent of obfuscating all variables in code to A, B, C, etc... If we could give meaningful names to them that would help greatly. I also tried declaring and using a global variable instead of a flag, but I couldn't get it to work; it's not explained how far reaching the global scope is (is it accessible to each trigger do script? each units action do script? when is it initialized?). There's no explanation on when different parts of the simulation and scripting are initialized. Perhaps I'm being too rough on DCS, because I have an existing base to compare it with (Arma) which has a more complete suite of mission editing capabilities. But it also means that there's little incentive for me to work with LUA in dcs if there's no support for some of the things I would like to do above.
-
My biggest gripe is the lack of documentation. There's just not enough information available and you know it's bad when google doesn't help. My second biggest gripe is that lua really doesn't do a whole lot - i mean yeah you can respawn some units and setup patrols but it's really really limited in what it can do. In fact you can do almost anything you need to in game with triggers, there isn't a whole lot that lua has a purpose for unless you are building mods where the support is better. Third is the general unstableness of mission design in general - one day it will work, the next day it wont.
-
Is there a way to check if a unit has received a radio transmission, or query a units current radio frequency and active radio to validate that they can send said message to a unit? I have some radio items that I add for the player, which are used to communicate with some ai units on various frequencies and channels. What I would like to do is validate that the player is on the correct radio and frequency before executing the radio task trigger and removing the radio action (otherwise keep the action there). I have this setup with a bunch of triggers per message: 1. Radio action (Flag 1, val:1) 2. (Action Used + Cockpit Arguments) Trigger detects when flag1 equals 1, and cockpit arguments are in range for radio knobs, sets flag 2 to true 3. (Valid Transmission - Send Message) Trigger checks if flag1 is 1, and flag 2 is true, sends message to player via radio transmission and removes radio item 4. (Invalid Transmission - Expire Message) Trigger checks if flag1 has been equal to 1 for more than 3 seconds, resets to 0 (essentially a radio expired trigger) I find this gets quite complex when you have lets say 3 or more of these actions (now you have 12 triggers you need to manage in your mission, and I find the triggers list gets really unwieldy after 20). I'd like to cut away the cockpit arguments check/expire check so that I really only need the radio action and the valid/invalid trigger with a reusable script so there's less debugging involved. I was looking at ways of creating triggers via lua but I cant find any documentation for it. Also cant find any info about checking valid radio setup. Is what I am asking for possible?
-
I tried this now in the latest stable of 1.5 and i can't get it to work. Using KA-50: R828 Frequencies: Ch7 : 40 Mhz FM APC MLTB 1 WP 0 (SP) Action: Set Frequency (40Mhz FM) Triggered Actions Transmit Message("Test Message") Trigger ONCE - Radio Item Add (Flag: 1, Value: 1, "Contact FAC Ch7") Trigger ONCE - Flag is true (1) - AI PUSH TASK(Transmit Message), radio item remove next I go in game, set my r828 to channel 7, tune it until the light is off, switch to vhf1 on radio selector and fire off my radio item in f10 menu. No transmission is received, no text appears. The radio item is properly removed. Is this no longer working in current stable?