Jump to content

Lumax

Members
  • Posts

    67
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Thanks for clearing that up. Guess i'll have to look at my code again. because setting a taks for the 1st time works but not the 2nd time :/
  2. I took a look at that. not much of help though. My problem is not assigning a route to a group (random or not) But rather assign a new route for the group which should replace the current assigned route. So the question still remains unanswered: can waypoints only be assigned once to ground units and they are stuck with it until they get destroyed?
  3. Do not move your plane before you have nav data ready. else you have to wait some time before the cdu to align. Once you have the nav data rdy. watch the compass and throttle up. move your plane 1m forward then break. you see the needles on the compass moves. You can now push the button EAC.
  4. Hi all. Is it not possible to assign a new set of waypoints for the ground units. I am using Controller.setTask(...) to set the waypoint for my units. This works fine the 1st time i use it. But when i want to assaign a new route it dosent work. I even tried to Controller.popTask(...) . before assigning them a new set of waypoints. but no go. So can waypoints only be assigned once to ground units and they are stuck with it until they get destroyed?
  5. Im trying to set a task for my group. basically a bunch of waypoins. im reading this http://wiki.hoggit.us/view/DCS_task_mission now my problem is that how do i make it execute a script code on a waypoint. ? example wp3 ? lets say i have something like this. local object = Group.getByName('convoy') local leader = Unit.getByName('ConvoyUnit #1') local control = object:getController() local wp1 = leader:getPosition() local wp2 = trigger.misc.getZone('Trigger Zone A') local wp3 = trigger.misc.getZone('Trigger Zone B') local x1 = wp1.p.x local y1 = wp1.p.z local x2 = wp2.point.x local y2 = wp2.point.z local x3 = wp3.point.x local y3 = wp3.point.z local path = { [1] = { type = 'Turning Point', action = 'Off Road', x = x1, y = x1, speed = 20, name = 'WP1', }, [2] = { type = 'Turning Point', action = 'Off Road', x = x2, y = y2, speed = 20, name = 'WP2', }, [3] = { type = 'Turning Point', action = 'Off Road', x = x3, y = y3, speed = 20, name = 'WP3', }, } local mission = { id = 'Mission', params = { route = { points = path, } } } Controller.pushTask(control, mission)I guess i need to add something like this to Wp3 but not sure of the correct format ["task"] = { ["id"] = "ComboTask", ["params"] = { ["tasks"] = { [1] = { ["number"] = 1, ["auto"] = false, ["id"] = "WrappedAction", ["enabled"] = true, ["params"] = { ["action"] = { ["id"] = "Script", ["params"] = { ["command"] = "DO MY CODE HERE", }, -- end of ["params"] }, -- end of ["action"] }, -- end of ["params"] }, -- end of [1] }, -- end of ["tasks"] }, -- end of ["params"] }, -- end of ["task"] Edit: never mind. im stupid,the answer is in my post --
  6. Youre right about that. my goal was to get this working for SP. I do not know much about mp coding in dcs. But i noticed that when you join your mp server. it does not uppack the downloaded mission to "%TMP%\DCS\Mission" But rather dump all resorces such as files & pic directly to "%TMP%\DCS\" with some "random id?" names set on them. example: ~mis000012FE after messing around with the editor and some simple scripting, all i can say about it. damn this thing sucks. it needs a big update. simple things such as making one file load another file within your mission.miz. come on.. tellin people to dump (for them unknown) files at places on their pc to get missions working is a big no, no. creating tonz of triggers just to include file.. blah. imo triggers should be used for game related ations. not to load the mission function files :p They should look at the way bohemia interactive studios is doing it with arma. its a verry nice system. oh well lets see if there is a workaround for mp aswell. (without using triggers ofc)
  7. Solved my problem.. After messing around a bit i came up with a solution. -- TEST 1 -- -- This works but -- this is not practical since this would not be a constant. names changes. dofile("C:\\Users\\ME\\AppData\\Local\\Temp\\DCS\\Mission\\CoreData.lua") -- TEST 2 -- local currentpath = debug.getinfo(1).short_src -- tim the sting and set new path where dcs unpacks the mission. local newpath = string.sub(currentpath, 0, string.find(currentpath, "DCS")+2) .. "\\Mission\\" dofile(newpath .. "CoreData.lua") -- get the path to the init file using debug -- debug.getinfo(1).short_src usaly returns something like -- C:\Users\ME\AppData\Local\Temp\DCS\/~mis0000**** The error Test2 produces. 00240.039 ERROR DCS: Mission script error: : can't open '[string "C:\Users\ME\AppData\Local\Temp\DCS\Mission\CoreData.lua' stack traceback: [C]: ? [C]: in function 'dofile' [string "C:\Users\ME\AppData\Local\Temp\DCS\/~mis00007DED"]:16: in main chunk Now what struck me was this: can't open '[string "C:\Users\ME\AppData\Local\Temp\DCS\Mission\CoreData.lua' Somehow dofile is trying to do something like. dofile('[string "C:\Users\...) instead of dofile("C:\Users\...) Now the solutions was rather simple. in Test2 i just replaced. dofile(newpath .. "CoreData.lua")with dofile( string.sub(newpath .. "CoreData.lua", 10) )so if i want to load several files i end up with something like local currentpath = debug.getinfo(1).short_src local newpath = string.sub(currentpath, 1, string.find(currentpath, "DCS")+2) .. "\\Mission\\" dofile( string.sub(newpath .. "File1.lua", 10) ) dofile( string.sub(newpath .. "File2.lua", 10) ) dofile( string.sub(newpath .. "File3.lua", 10) ) dofile( string.sub(newpath .. "File4.lua", 10) )
  8. My hole point in trying to do this is so i dont have to use triggers. Also moving my CoreData to DCS root dir as suggested is not accatable. Problem araises when i want to share my mission with my friends. I dont hant to guide them thought a install process for my mission.
  9. That is not accatable. @piXel496 Yes both init.lua and CoreData.lua are inside the mission file. I see no point in assigning the resulat of a & b into a local variable before returning the result. My function is not the problem. its something wrong with dofile I also want to avoid having it all in one file. my init.lua is working fine but errors when trys to open CoreData.lua If i move the function combstr to init.lua and remove dofile everythings works. But as i said i dont want it all in one file. Not sure how putting init.lua into initialization box will help since the init file starts.
  10. Hello. I like to know how i can import one file from another. i have on init.lua file that is activated on mission start. this init file should load some other files conaining functions etc. My mission.miz looks like Scripts Config warehouses options mission init.lua CoreData.lua this is my trigger rule. My test code: And here is the error it produces: Can anyone tell me what im doing wrong ?
  11. Lots. 1st. Adjusting the code should allows you to use any usb hid devices. 2nd. You can create sequenses of keypresses which you can not with the ST software.. Example. press Pov2 Up once. represent Key1 , next time you press Pov2 Up it represent key 2. Or you can create advance macros. This was more of a POC "proof of concept". It requires some work set up as one want it and one needs some python skills to create functions etc.
  12. Why so massive frame drop with explotions? Each time i fire some rockets or use cluster bombs etc. My frame rate goes from about 50/45 down to 10 or less. This mostly happens when there are multiple explotions. Is there anytging i can do to reduce this framedrop, "except buying a superconputer" ?? Its rather annoying and i have crashed many many timed because of this drop in framerate.
  13. Hi, Is it possible to script waypoints for ground units. I want a few units going from Wp1 to Wp2 then back to Wp1 so on in a enless loop. Im not sure how to go about doing this with Lua. The ingame editor does not seem to have a loop/cycle for waypoints
  14. Fix the controller settings to allow us to use our joystick for all oprions.. Simple things as allow us to change gunner to driver position.. Many of the settings are greyed out and can not be assigned to the joystick. Its very annoying switching between the keyboard and the joystick!
×
×
  • Create New...