Jump to content

Raffson

Members
  • Posts

    57
  • Joined

  • Last visited

Everything posted by Raffson

  1. I've been looking at the controls and noticed it's still not there after the last update so meanwhile you can copy-paste this line into "Mods\aircraft\F14\Input\F-14B-Pilot\joystick\default.lua", right around line 148 if you haven't touched the file so far: {down = device_commands.FUELSYSTEM_Refuel_Probe, up = device_commands.FUELSYSTEM_Refuel_Probe, cockpit_device_id=devices.FUELSYSTEM, value_down = 1, value_up = -1, name = _('Refuel Probe extend, Refuel All, else Retract Probe'), category = _('Fuelsystem Control Panel')},
  2. Assuming you're looking for a switch that turns to hot mic if you turn it on and back to cold when you turn it off, as in "HOT MIC, else COLD MIC" sort of control, then I got you back :D Made a switch for that too, code goes as follows: {down = device_commands.RADIO_ICS_Func_RIO, up = device_commands.RADIO_ICS_Func_RIO, cockpit_device_id = devices.ICS, value_down = 0, value_up = -0.5, name = _('ICS Function HOT MIC, else COLD MIC'), category = _('Radio')}, I noticed the values -0.5 and -1 for cold mic, 0 for hot mic & 0.5 and 1 for override work, so my guess is it's coded "if value < 0 then cold mic, else if value == 0 then hot mic, else override" EDIT: damn, you said RIO.. I just realise the same thing now... looking at command_defs.lua, I'm trying to find RADIO_ICS_Func_RIO or something alike, but can't see it.. EDIT2: nvm, I'm blind... code's edited.. should work now, though I'm gonna test it real quick to verify... EDIT3: k so works on my end, and it makes me realize you could create a RIO-trainer control set where you could flip switches for the pilot from the back seat, even though that takes all realism away I guess it could be good from an educational point of view.. for example the instructor having the ability to adjust trim.. dunno but there's potential there :p
  3. Noticed a similar issue with the "Fuel Dump On, else Off" switch... Glad you like it! If you're interested, I can always break it down to you how the lua files work regarding controls...
  4. Came across this post and realized I want some buttons that make life easier for getting in and out of oversweep. So I broke down the TO/LDG into the following parts: TO -> open cover and extend handle, set lever to 68 degrees, lock the handle and close the cover LDG -> open cover and extend handle, set lever to 68 degrees, lock handle, go to oversweep and extend the handle again This leads to 4 buttons: 1) a button to open the cover and extend the handle, for which the code looks like this: { up=device_commands.WINGSWEEP_EmergencyLeverExtended, down=device_commands.WINGSWEEP_EmergencySweepCover, cockpit_device_id=devices.WINGSWEEP, value_up=1.0, value_down=1.0, name=_('Emergency Wing Sweep Open & Extend'), category=_('Throttle')}, Now for takeoff I noticed that a hot start has overswept wings with the handle locked and the cover closed and I'm wondering if this is a consistent state of the cockpit because in a normal case where the wings are in oversweep, I would assume to find the cover always open with the handle extended. But yeah, not sure what's considered correct here so... 2) a button to bring the wings to 68 degrees sweep, lock the handle and close the cover: { up=device_commands.WINGSWEEP_EmergencySweepCover, down=device_commands.WINGSWEEP_EmergencySweepLever, pressed=device_commands.WINGSWEEP_EmergencyLeverExtended, cockpit_device_id=devices.WINGSWEEP, value_down=0.30, value_pressed=0.0, value_up=0.0, name=_('Emergency Wing Sweep to 68°, Lock & Close'), category=_('Throttle')}, Note that you have to press the button long enough for the handle to lock in properly before releasing, otherwise the cover won't close and you'll have to press again. 3) a button to do the same as 2, except closing the cover: { up=device_commands.WINGSWEEP_EmergencyLeverExtended, down=device_commands.WINGSWEEP_EmergencySweepLever, cockpit_device_id=devices.WINGSWEEP, value_up=0.0, value_down=0.30, name=_('Emergency Wing Sweep to 68° & Lock'), category=_('Throttle')}, 4) a button to bring the handle to oversweep and extend the handle: { up=device_commands.WINGSWEEP_EmergencyLeverExtended, down=device_commands.WINGSWEEP_EmergencySweepLever, cockpit_device_id=devices.WINGSWEEP, value_up=1.0, value_down=0.0, name=_('Emergency Wing Sweep to Oversweep & Extend'), category=_('Throttle')}, Now your takeoff sequence would be buttons 1 & 2 while your post-landing sequence would be buttons 1, 3 & 4. Hopefully this is useful to someone else except myself :D
  5. In my earlier posts I mentioned that I've used noip in the past which is basically the same thing.. But anyhow, I've got a solution posted in one of the previous messages so currently I'm sorted out..
  6. Not necessarily outside the DCS World directory, just within a new folder called "socket" within the "LuaSocket" folder that's located in the DCS World directory.. Anyway, up to the next challenge, getting rid of http and using UPnP to discover the external IP since I don't feel like being dependent on a website xD
  7. Actually, the country doesn't match, but close enough to know what "Teringzooi" means :thumbup: Got it to work so no worries anymore, well, actually, you could try my solution & see if it also works for you cause maybe it only works for myself but yeah, can't really test that out :lol:
  8. OMFG finally, I got it to work! This is how my AutoConnectGameGUI.lua looks like now... -- Version 1.2.9.2 -- ONLY COPY THIS FILE IS YOU ARE GOING TO HOST A SERVER! -- The file must be in Saved Games\DCS\Scripts or Saved Games\DCS.openalpha\Scripts -- Make sure you enter the correct address into SERVER_SRS_HOST below. -- You can add an optional Port. e.g. "127.0.0.1:5002" package.path = package.path..";.\\LuaSocket\\?.lua;" package.cpath = package.cpath..";.\\LuaSocket\\?.dll;" function externalip() local http = require("socket.http") local json = loadfile("Scripts\\JSON.lua")() local resp,code,headers,status = http.request("[url]http://ipinfo.io/json[/url]") if code ~= 200 then return nil, "Failed fetching external IP; "..tostring(status) end local data, err = json:decode(resp) if not data then return nil, "Failed fetching external IP; "..tostring(err) end if data.ip then return data.ip else return nil, "Failed fetching external IP; no ip field was returned" end end -- User options -- local SRSAuto = {} local ipaddr, err = externalip() net.log(string.format("%s:%s", tostring(ipaddr), "9987")) --verify your IP in dcs.log SRSAuto.SERVER_SRS_HOST = tostring(ipaddr)..":9987" --change ":9987" to whatever port you're using SRSAuto.SERVER_SEND_AUTO_CONNECT = true -- set to false to disable auto connect or just remove this file -- DO NOT EDIT BELOW HERE -- SRSAuto.unicast = false -- Utils -- local HOST_PLAYER_ID = 1 SRSAuto.MESSAGE_PREFIX = "SRS Running @ " -- DO NOT MODIFY!!! local socket = require("socket") SRSAuto.UDPSendSocket = socket.udp() SRSAuto.UDPSendSocket:settimeout(0) SRSAuto.logFile = io.open(lfs.writedir()..[[Logs\DCS-SRS-AutoConnect.log]], "w") function SRSAuto.log(str) if SRSAuto.logFile then SRSAuto.logFile:write(str.."\n") SRSAuto.logFile:flush() end end -- Register callbacks -- SRSAuto.onPlayerConnect = function(id) if not DCS.isServer() then return end if SRSAuto.SERVER_SEND_AUTO_CONNECT and id ~= HOST_PLAYER_ID then SRSAuto.log(string.format("Sending auto connect message to player %d on connect ", id)) net.send_chat_to(string.format(SRSAuto.MESSAGE_PREFIX .. "%s", SRSAuto.SERVER_SRS_HOST), id) end end SRSAuto.onPlayerChangeSlot = function(id) if not DCS.isServer() then return end if SRSAuto.SERVER_SEND_AUTO_CONNECT and id ~= HOST_PLAYER_ID then SRSAuto.log(string.format("Sending auto connect message to player %d on switch ", id)) net.send_chat_to(string.format(SRSAuto.MESSAGE_PREFIX .. "%s", SRSAuto.SERVER_SRS_HOST), id) end end DCS.setUserCallbacks(SRSAuto) net.log("Loaded - DCS-SRS-AutoConnect") Figured out that you must copy-paste some files within the DCS installation directory.. To get this to work, you must go to DCS-Installation-Folder/LuaSocket & create a new folder called "socket".. Then copy http.lua, ltn12.lua, mime.lua & url.lua into that folder.. All those files are available in the LuaSocket folder so it's really easy, but for some reason this particular script couldn't find it when it was in LuaSocket itself.. Beware, don't delete/move the files from LuaSocket cause they might be referenced from a different place so instead do a plain copy of those files into the "socket" folder that you've created in LuaSocket..
  9. It's basically what I'm trying but somehow it won't work when dcs executes the script.. I get very strange outputs when using pcall & checking the type of my html variable.. The only difference here is that you are using a sink but that shouldn't be the issue.. Nevertheless I will try it tomorrow & let you know what comes out but I have serious doubts if this will actually work.. As I mentioned in earlier posts, pcall says I'm trying to call a nil value which can't be the case.. Also I got a very strange output when asking sending tostring(http) to the log, which should give me an address pointing to a table but instead it says it's pointing to a JSON encode/decode object.. The weirdest past is that when I try to execute the essential part of the script locally then it all works fine.. I'm starting to think it's a bug from dcs itself or some outdated Lua-DLLs that dcs uses.. I'm seriously hoping I missed something on how to correctly use http requests in dcs' Lua but somehow I can't imagine it to be different from http's regular use.. As one would say in the Netherlands, Teringzooi! :lol:
  10. Yeah I'm not sure I have a hostname assigned.. As mentioned in earlier posts, I could use noip but that's not exactly what I want.. I'm getting damn close to a solution here but for some reason the http request takes a dump on me so gotta figure out what the deal is.. once that's done I think it'll work just fine..
  11. The first line is at your own discretion so you can put that wherever you want, i.e. the install location of simple radio itself. The second line should point to you Saved games folder being: C:\User\YourUserName\Saved games\ It should automatically point to the right folder but be sure it doesn't point to the DCS folder within Saved games... EDIT: about teamspeak, not sure there but you should get the standalone version which shouldn't ask anything about teamspeak.. Thus you could still join a TS server & hear everyone.. Download is at the following site: https://github.com/ciribob/DCS-SimpleRadioStandalone/releases Download DCS-SimpleRadioStandalone.zip
  12. I'm not a Lua expert so I'm not sure what the pcall should look like.. When you're asking for a full snippet, I'm assuming you mean the whole AutoConnectGameGUI file which looks like this at the moment.. -- Version 1.2.9.2 -- ONLY COPY THIS FILE IS YOU ARE GOING TO HOST A SERVER! -- The file must be in Saved Games\DCS\Scripts or Saved Games\DCS.openalpha\Scripts -- Make sure you enter the correct address into SERVER_SRS_HOST below. -- You can add an optional Port. e.g. "127.0.0.1:5002" package.path = package.path..";.\\LuaSocket\\?.lua;" package.cpath = package.cpath..";.\\LuaSocket\\?.dll;" package.path = package.path..";.\\Scripts\\JSON.lua;" externalip = function() net.log("WTF...before") local h = require("socket.http") local json = loadfile("Scripts\\JSON.lua")() net.log("WTF...after") local resp,code,headers,status = h.request("[url]http://ipinfo.io/json[/url]") net.log("WTF...after2") if code ~= 200 then return nil, "Failed fetching external IP; "..tostring(status) end local data, err = json.decode(resp) if not data then return nil, "Failed fetching external IP; "..tostring(err) end if data.ip then return data.ip else return nil, "Failed fetching external IP; no ip field was returned" end end -- User options -- local SRSAuto = {} net.log("WTF..."..tostring(externalip())) net.log(string.format("%s:%s", tostring(externalip()), "9987")) SRSAuto.SERVER_SRS_HOST = "127.0.0.1:9987" SRSAuto.SERVER_SEND_AUTO_CONNECT = true -- set to false to disable auto connect or just remove this file -- DO NOT EDIT BELOW HERE -- SRSAuto.unicast = false -- Utils -- local HOST_PLAYER_ID = 1 SRSAuto.MESSAGE_PREFIX = "SRS Running @ " -- DO NOT MODIFY!!! local socket = require("socket") SRSAuto.UDPSendSocket = socket.udp() SRSAuto.UDPSendSocket:settimeout(0) SRSAuto.logFile = io.open(lfs.writedir()..[[Logs\DCS-SRS-AutoConnect.log]], "w") function SRSAuto.log(str) if SRSAuto.logFile then SRSAuto.logFile:write(str.."\n") SRSAuto.logFile:flush() end end -- Register callbacks -- SRSAuto.onPlayerConnect = function(id) if not DCS.isServer() then return end if SRSAuto.SERVER_SEND_AUTO_CONNECT and id ~= HOST_PLAYER_ID then SRSAuto.log(string.format("Sending auto connect message to player %d on connect ", id)) net.send_chat_to(string.format(SRSAuto.MESSAGE_PREFIX .. "%s", SRSAuto.SERVER_SRS_HOST), id) end end SRSAuto.onPlayerChangeSlot = function(id) if not DCS.isServer() then return end if SRSAuto.SERVER_SEND_AUTO_CONNECT and id ~= HOST_PLAYER_ID then SRSAuto.log(string.format("Sending auto connect message to player %d on switch ", id)) net.send_chat_to(string.format(SRSAuto.MESSAGE_PREFIX .. "%s", SRSAuto.SERVER_SRS_HOST), id) end end DCS.setUserCallbacks(SRSAuto) net.log("Loaded - DCS-SRS-AutoConnect") For some reason http is being bitchy again.. I has it working earlier with a line looking like: local http = require("http") but that gave me troubles again so I tried something different with no luck.. the json still works when doing it like you did.. Any suggestions for that http? EDIT: now stuff tend to really go bananas on me.. can't see the messages of other components in the log :s EDIT2: reinstalled everything & getting "LuaNET: Loaded - DCS-SRS GameGUI" back in the log.. still trying to get http to work though.. EDIT3: man wtf, I have no clue what's going on here but turns out it's require("socket.http") after all.. probably got confused since I tried adding files manually n shit but anyway, request call is still crashing.. edited the code to the most recent version again.. EDIT4: if the right way to do a pcall is the following: local stat,err = pcall(http.request, ("[url]http://ipinfo.io/json[/url]")) net.log(tostring(err)) net.log(tostring(stat)) then the log strangely says: LuaNET: attempt to call a nil value LuaNET: false
  13. Not sure where you're going with this, either you mean entering a domain name which I don't have or I'm missing something here.. Checking my ip is what I want to automate if you look at the code so guessing your advise is not going to work for me.. Thanks for trying though!
  14. I've used noip in the past & while it's a possible solution, I rather not use it cause suppose I don't use my computer for a month, the domain will be released. Another slightly less possible issue would be that my IP stays the same for more than a month which would require me to manually refresh the noip domain so I'd rather use what I have so far without the need to manually update the file every time I intend to host a server.. I will look into the search paths that you mentioned & keep you posted.. Thanks for your time though! EDIT : K I'm getting closer here, I managed to execute the code in a lua terminal so now I just need to figure out how I can get it to work in the AutoConnectGameGUI file.. Also thinking about asking the router for my external IP instead of bothering a website for it since my router supports UPnP cause otherwise the external IP would not show up on DCS itself.. Do you by any chance have experience with it? I read that it's a simple http request to a specific multicast address with a specific port but somehow I doubt that it's that simple.. EDIT2 : looks like I should've just used require("http") & move the package.path statements to the top.. also I needed to include dkjson file which I found now.. But now the require's aren't crashing anymore, it's the request itself..
  15. Since I have a dynamic IP I have a problem hosting with autoconnect.. I'm wondering if I'm missing something that allows me to use the current external IP address somehow because DCS itself is able to figure it out without a problem.. Now I'm trying to add a piece of code to DCS-SRS-AutoConnectGameGUI.lua but somehow keeps crashing due to a couple of require statements.. Just can't seem to figure it out quite well.. So far I've got the following code : externalip = function() local http = require("socket.http") -- these are the two lines that crash local json = require("dkjson") -- right here... local resp,code,headers,status = http.request("[url]http://ipinfo.io/json[/url]") if code ~= 200 then return nil, "Failed fetching external IP; "..tostring(status) end local data, err = json.decode(resp) if not data then return nil, "Failed fetching external IP; "..tostring(err) end if data.ip then return data.ip else return nil, "Failed fetching external IP; no ip field was returned" end end -- User options -- local SRSAuto = {} SRSAuto.SERVER_SRS_HOST = tostring(externalip())..":9987" SRSAuto.SERVER_SEND_AUTO_CONNECT = true -- set to false to disable auto connect or just remove this file Any idea how I can fix this or even better, throw away this stuff because I missed a functionality that's already available & does exactly the job I want? Just to clarify, whenever I host a server (both DCS & SimpleRadio), everything is running on the same machine.. Also wondering why I can't autoconnect to my own server because when I try other servers it works perfectly fine.. EDIT: I believe the requires are crashing because it can't find the right files.. However I'm not sure since you also use require("socket") so I have my doubts...
  16. I'm trying to find lift coëfficiënts to calculate takeoff speed, but somehow I can't find this info :( If anyone knows where to find this, that would be awesome cause now I'm kind of guessing my values:helpsmilie: EDIT : engine thrust & brake force are also factors that I'm looking for, i.e. to calculate V1... Thx in advance.
  17. Not really true, they do have this capability but only if they got an upgraded FCR.. But now all the fun has been taken away :(
  18. the ramp doesn't do much while landing now does it...:smilewink:
  19. i was already thinking something like that.. thx for comfirming my thought!
  20. i didn't spawn on the carrier.. just to be clear.. i landed it on the carl vinson.. but when i touched the deck.. i fell through it..
  21. I just landed a SU-33 on the carl vinson and i don't know why but suddenly i found myself inside the carrier and shortly after i "crashed" in the water.. did i land too hard on the deck?? cos as far as i know a carrier deck and landing gear of a carrier-based aircraft are made to withstand serious punishment :p
  22. best way to test this is fly at sealevel with full tanks and watch the time until your fuel's finished.. then try flying at an altitude in full AB so that the airspeed indicated is 300KIAS..at this altitude you should at least be able to fly double the time you flew at sealevel...
  23. I just noticed in the F-15C that the fuel flow stays the same no mather what altitude i'm at.. will this aspect be implemented or will it stay this way? :huh:
×
×
  • Create New...