Lineaxe Posted August 29, 2020 Share Posted August 29, 2020 (edited) request for a C# function that will return OS.time to be added into DCS core Hi , I have a somewhat crucial need for a C# function to be added into DCS . This is so that I can access it without having to desanitize the MissionScripting.lua file . C# code such as the following could easily be added in and shouldn't cause any problems with any XNA code already present in the project. using System; namespace funcOS { class AccessOSFunctions { public long getOSTimetoLong() { OSLongTime= new Date().getTime(); return OSLongTime; } public long setLongtoOSTime() { // not used } } } :dunno: Edited August 29, 2020 by Lineaxe Link to comment Share on other sites More sharing options...
Lineaxe Posted September 4, 2020 Author Share Posted September 4, 2020 would love to have some feedback on what you guys think about this Link to comment Share on other sites More sharing options...
Kang Posted September 4, 2020 Share Posted September 4, 2020 Alright... You stressed that you have a crucial need for this. Fair enough. I simply cannot see any necessity at all. Link to comment Share on other sites More sharing options...
Flagrum Posted September 5, 2020 Share Posted September 5, 2020 What do you do with C# in DCS? Without the SDK you won't be calling any API functions anyways, be that in C# or more likely C++. Link to comment Share on other sites More sharing options...
Pizzicato Posted September 5, 2020 Share Posted September 5, 2020 Dear ED, Please take time out from all the myriad features, bugs, and optimisations you're working on to write me some dedicated code in an otherwise unsupported language because it's super-critical to some undisclosed personal project I'm working on. Sincerely, Some bloke i7-7700K @ 4.9Ghz | 16Gb DDR4 @ 3200Mhz | MSI Z270 Gaming M7 | MSI GeForce GTX 1080ti Gaming X | Win 10 Home | Thrustmaster Warthog | MFG Crosswind pedals | Oculus Rift S Link to comment Share on other sites More sharing options...
Chump Posted September 5, 2020 Share Posted September 5, 2020 What's wrong with os.time() in LUA? Link to comment Share on other sites More sharing options...
Pizzicato Posted September 6, 2020 Share Posted September 6, 2020 What's wrong with os.time() in LUA? The OS library is sanitized in DCS, so users don't have access to it. i7-7700K @ 4.9Ghz | 16Gb DDR4 @ 3200Mhz | MSI Z270 Gaming M7 | MSI GeForce GTX 1080ti Gaming X | Win 10 Home | Thrustmaster Warthog | MFG Crosswind pedals | Oculus Rift S Link to comment Share on other sites More sharing options...
Lineaxe Posted September 15, 2020 Author Share Posted September 15, 2020 (edited) Well I must point out that any code needed I put the code is already in the above post. I simplified any operations needed for any intergration into the DCS engine . C# is not obscure at all, and it is the language used to write XNA code (which I imagine would be used to create the DCS world). Anyhow, it's the one that I have used to create 3d world engines with. It's the one that Microsoft uses for Directx related code and it's XBOX 1 code is written with XNA. So I created a function that can should hook into existing code in the DCS engine. Now , I know that many programmers are quite busy with upgrades, bug traces & fixes, and the like , so I did just put it in the wishlist and made it as easy as possible for someone to implement. Heh, as I go back over my 40 years of programming , I think of all the times , in all the programming languages, I somehow go back to calling that time function. Right up from to old days of C , before C++ . I think I even called it up in Pascal back then. I wouldn't call a function as common as that 'obscure' at all , However, it is pretty obscure , as far as the DCS project is concerned I must admit :) The project that the code is being used with, I posted elsewhere here, It's a Random Generator, based off some research I had done online at some LUA programming websites. I threw a coupla extra options into the original function , however,throughout the function os:time , is required. This generator is being used right inside my Chop_u series of missions. Well, implemeting the above code , somehow is on my wishlist anyhow. I am sure that tons of great features are being worked on at the moment and I eagerly await all patches ! I can always just remind everyone who downloads these missions to manually copy a modified copy of the missionscripting.lua file over after the upgrades( as it gets written over). Edited September 15, 2020 by Lineaxe Link to comment Share on other sites More sharing options...
drPhibes Posted September 17, 2020 Share Posted September 17, 2020 C# is not obscure at all, and it is the language used to write XNA code (which I imagine would be used to create the DCS world). AFAIK DCS world is written in C++, not C#. Link to comment Share on other sites More sharing options...
Lineaxe Posted September 20, 2020 Author Share Posted September 20, 2020 (edited) Uhh, C++ , eh , now I know why the C# code is so obscure to DCS...Joke's on me I think ... Heheh, oh well .I have been doing some coding in C++ for Arduino, Ubuntu & Andriod (linux) systems. I did check out some OPENGL stuff. WebGL Looks promising . Directx is such a large API . Must be huge now, I haven't looked at it in quite a while. Now I wonder what kind of tools have been developed to help created 3d worlds using C++ these days. I have always nicknamed C++ the 'hell' language. But multiple inheritance, I guess , comes at a cost... Brrr....must be the language of the devil I tell ya . Anyhow, I still dabble away in it here and there :) Edited September 20, 2020 by Lineaxe Link to comment Share on other sites More sharing options...
Flagrum Posted September 20, 2020 Share Posted September 20, 2020 It's a Random Generator, based off some research I had done online at some LUA programming websites. I threw a coupla extra options into the original function , however,throughout the function os:time , is required. This generator is being used right inside my Chop_u series of missions. Building your own random number generator is a bad idea. It will break the track file replayability as your mission scripting code will behave differently when you fly the mission and when you replay the track. I bet, there are solutions for this, besides the various randomizing methods that the mission editor itself already provides. You might want to research the DCS mission scripting in LUA capabilities in general and the existing scripting frameworks, for example using MIST. Link to comment Share on other sites More sharing options...
Lineaxe Posted September 23, 2020 Author Share Posted September 23, 2020 Hi, thanks for the reply. Well, I have noticed, even without using a random generator, the tracks are unplayable since they use numbers to represent Attacking units and so on. So, when I tried to hit replay, it didn't know what to do. It was suggested I get TacView Advanced so I can watch the Tracks . Now , I see your point about potential danger in using different random generators , especially for time related events. The only time I have used the generator to create a time span offset, I have give the software some leeway on when It actually schedules something based on the number. So far in my code, It doesn't matter if there is a bit of fluctuation. I am willing to accept it for the benefit of lots of randomization options. I like to think a bit of C++ code added into the DCS core might open up that option a bit for people to use :) Now ,that's quite an engine they have and they already have tons of stuff to work on. So, I will just work around it by updating missionscripting.lua as needed. Link to comment Share on other sites More sharing options...
Lineaxe Posted January 24, 2021 Author Share Posted January 24, 2021 I keep on thinking that this would be the spot for me to add in some Pascal code as well ... Link to comment Share on other sites More sharing options...
Kang Posted January 24, 2021 Share Posted January 24, 2021 And thus this request moved from 'somewhat strange' to 'borderline insane'. Lovely. DCS has no option for missions to run any custom Assembler code as well, I hear. Link to comment Share on other sites More sharing options...
Lineaxe Posted February 1, 2021 Author Share Posted February 1, 2021 (edited) WELL THAT IS A VERY NASTY REPLY TO MY JOKE KANG... In fact I WOULD PREFER you to NEVER reply to anything else I write at ED FORUMS. Edited February 1, 2021 by Lineaxe Link to comment Share on other sites More sharing options...
Recommended Posts