Jump to content

ata_sa

Members
  • Posts

    12
  • Joined

  • Last visited

1 Follower

  1. Hi all, I have been trying to adjust my settings on DCS to get better performance but I have not been successful Problem is: 1) Everything moving around me is blury and has double vision 2) My cockpit shakes (no extreme shake but more vibration) with slight head movement (even talking) >>> This happens when I get FPS around 50 low on the deck <<<< >>> It goes away when I make pixel density 0.5 basically worst graphics <<< System: Graphics: Geforce RTX 3080 Ti 12GB GDDR6X PCI Express 4.0 Graphics Card CPU: Ryzen 9 - 5950X RAM: 32G Windos 11 Hard: SSD 1TB
  2. Hi Thanks for your comment @cfrag please check my topic. Grimes helped alot on this but I got stuck at the end https://forum.dcs.world/topic/328903-scripting-with-mist-unit-spawn-by-unhooking-cargo/#comment-5280864
  3. @Grimes After reading more about lua functions, I realized that this is a function so I need to call it somehow. Still struggling with this part
  4. If I have wrote a lua function how can I call it in DCS ? I have studied this post and some others but I cannot figure out how !
  5. I tried this code but it is not working. Switched condition is created and works correctly (attached picture). There is no error when code is run but when I put units in the zone flag does not turn on. I used a message code as shown below to see if it enters this if conditions. It seems that it does not since I dont get the message. I even placed the message after local function checkZones() but got no output local zones = {{zone = 'Z1', flag = 1},{zone = 'Z2', flag = 2}} ... for j = 1, #cZones do if not cZones[j].found then local zone = trigger.misc.getZone(cZones[j].name) if mist.utils.get2DDist(zone.point, pos) < zone.radius then trigger.action.setUserFlag(cZones[j].flag, 1) local msg = {} msg.text = 'flag is on' msg.displayTime = 10 msg.msgFor = {coa = {'all'}} mist.message.add(msg) cZones[j].found = true num = num + 1 end ...
  6. wow amazing ! Thanks I only need flags from previous run so this is ok
  7. I think if I add this line it will solve my problem: first lines ... local function checkZones() local cZones = mist.utils.deepCopy(zones) local num = 0 Then this line for m = 1, #cZones do -- when DCS trigger starts running code again it will set all founds to false otherwise the zone with previous true value will never be checked again cZones[m].found = false end good point ! I found this comment from old topics : Once("kickstart loop") -> (desired condition) -> Set flag (X) Switch Condition ("Restart/reset loop") -> Time Since Flag(X, desired time) -> Clear Flag (X), Set Flag(X), Run the script
  8. Dear @Grimes thanks for your help. I appreciate that. I understand that you used if not cZones[j].found then to check if the zone is already accupied code does have to search anymore for that zone (it does not pass the if not condition.) But now if the zone is occupied cZones[j].found = true this value becomes true. However, even if the zone gets empty this value remains true for ever. Also our outer loop is for i = 1, #blueUnits do this means that all units will be checked once and then loop will be closed. How does this work for DCS ? Does DCS keeps running this script over and over again every second ?
  9. Dear @Grimes Thanks for your time again. Your explanations are amazing. I am re-writing the code and I will try on DCS I may have a mistake at local zone = trigger.misc.getZone(cZone.name) part why do we have to write cZones[j].found = true ? Doesnt is automatically become true if there is 1 unit in the city according to your last comment ? If it does not automatically become true and we use cZones[j].found = true , then when it checks next time (if not cZones[j].found then) and imagine that the unit left the city this will stay remain true. sorry I am very new to this and struggling alot to understand all functions ... local blueUnits = mist.makeUnitTable({"[blue][vehicle]"}) -- need to make table since [blue][vehicle] is not a unit name local zones = {{zone = 'Red City - 1', flag = 64},{zone = 'Red City - 2', flag = 65}, {zone = 'Red City - 2', flag = 66}, {zone = 'Red City - 2', flag = 67}} local function checkZones() local cZones = mist.utils.deepCopy(zones) local num = 0 for i = 1, #blueUnits do local unit = Unit.getByName(blueUnits[i]) if unit then local pos = unit:getPoint() for j = 1, #cZones do if not cZones[j].found then trigger.action.setUserFlag(cZones[i].flag, 0) local zone = trigger.misc.getZone(cZone[j].name) --- mistake ??? if mist.utils.get2DDist(zone.point, pos) < zone.radius then -- whatever your code for checking it is, whether its a circle or polyzone trigger.action.setUserFlag(cZone[j].flag, 1) --- action to set the flag cZones[j].found = true num = num + 1 end end end end if num == #cZones then -- once all zones have 1 unit then the loop can be broken out of break end end end
  10. Thanks @Grimes for your effort and valuable time . Looks amazing. Some questions: For the first line can I do ? local blueUnits = {[blue][vehicle]} I want this function for any type of vehicle enters the area. I dont have specific list. --------------------------------------- if unit then this means if any unit available ? ----------------------------------------- local pos = unit:getPoint() This function returns location of the unit. However, pos is never used anywhere ? ------------------------------------- if not cZones[j].found then What is this part for ? if unitInZone == true then -- whatever your code for checking it is, whether its a circle or polyzone -- set flag if needed sorry I dont understant this part ------------------------------------- -- set flag if needed for each city I set one flag, my flag numbers are 64,65,66,67 to use in score section. so should I write flag=63+j in this part ? How can I toggle this flag ? for exampe if one city is out of units this will turn off the flag for that city.
  11. I have another question: I have 4 zones and some ground units. I want to give 20 score to blue team if they capture 1 city (at least 1 unit in zone means flag is on). So if units capture all, blue team has 80 scores. In this code I create a flag for city and if a unit enters this city the flag is on and if not flag is off (using toggle). Later on at mission goals section I use these flags to give score. (If flag is true ... Score <20>) I was wondering how can write this code in less expensive way ? so it does take lots of CPU calculations ? do mist.flagFunc.units_in_zones{ units = {'[blue][vehicle]'}, zones = {'Red City - 1'}, flag = 61, interval = 5, toggle=true } mist.flagFunc.units_in_zones{ units = {'[blue][vehicle]'}, zones = {'Red City - 2'}, flag = 62, interval = 5, toggle=true } mist.flagFunc.units_in_zones{ units = {'[blue][vehicle]'}, zones = {'Red City - 3'}, flag = 63, interval = 5, toggle=true } mist.flagFunc.units_in_zones{ units = {'[blue][vehicle]'}, zones = {'Red City - 4'}, flag = 64, interval = 5, toggle=true } end
  12. Hi all, I am new to scripting and I have been studying some tutorials. So far I have made some simple scripts. My goal is to create something like this. I would be glad if you help me. lets say I have X number of cargos and 1 cargo drop zone ... Per each cargo I unhook in the zone, one group unit is activated (total X number of groups). Units do not have to be linked to specific cargo crate, they can be activated randomly from a list of X number of groups. Thanks :)
×
×
  • Create New...