Jump to content
faguss

Fwatch Request List

Recommended Posts

Reading the sqm doesn't work if the mission is packed into a pbo-file or when it is not known if the mission is in the missions-folder or in the 'users\username\missions', right?

See this.

if you can make in any way a 3d sound comunications

No such things with Fwatch. You might want to look into this.

Share this post


Link to post
Share on other sites

Update on your requests:

 

Would there be a way to rise the water level beyond what's possible by simply changing the in-game date, even as far as to flood the whole island?

 

:mem setweather

 

 

Could you make a command that finds current values for rain, overcast and fog from the memory?

 

:mem getweather

  • Like 1

Share this post


Link to post
Share on other sites

Hey faguss!

 

Do you think it's possible to launch another application from CWA / OFP thread and send the output to the game? I have already tried to do it simplest way possible, as I'm not the biggest fan of WinAPI:

char buffer[256];
FILE *fp = _popen("test.exe -c xxx", "r");
QWrite("[", out);
int first = 1;

while (fgets(buffer, 256, fp))
{
  if (first == 1)
  {
    QWrite("\"", out);
    first = 0;
  }
  else
  {
    QWrite(",\"", out);
  }

  QWrite(buffer, out);
  QWrite("\"", out);
}

QWrite("]", out);
_pclose(fp);

test.exe prints all of passed parameters. I want to return them as an array to CWA - it doesn't serve any purpose, but that's just for the sake of simplicity of testing.

CWA crashes after executing this code. Here's the reason from crash dump:

 

The thread tried to read from or write to a virtual address for which it does not have the appropiate access.

 

I can't really find anything useful on Google. The error is obvious, yet I don't have any idea on how to fix it or if it's even possible to do.

What's also worth mentioning, it doesn't crash on _popen. It's fgets(buffer, 256, fp) that messes things up.

Is there some "special" folder which won't cause any cries about privileges when CWA tries to execute something in it?

Share this post


Link to post
Share on other sites

Hey faguss!

 

Do you think it's possible to launch another application from CWA / OFP thread and send the output to the game?

 

Check :file wget command. It creates a pipe to which an external program is writing its output data. Then it passes that information along so it goes to the game as a return value of the :file wget command.

 

I wouldn't recommend using it because the game is stopped while third-party program is running.

Share this post


Link to post
Share on other sites

Thanks for the answer!
 
I'm surely gonna check it out this weekend. I must admit wget is a pretty clever approach.
 
While being at it, my idea is to manage most mission's logic externally by another application. I think it would be much cleaner, easier to maintain and powerful than writing the same thing using only OFP's scripting language. Not to mention all of the other possibilities, such as using a database.
 
It would work like this:

  • Create a new "agent" function in fwatch source code (it would send input acquired from OFP's script, then wait and read the output from external application).
  • Input would consist of a command name and optionally parameters, let's say: IS_OWNER PLAYER CAR1.
  • External application reads the input.
  • External application's parser processes the input and calls proper method / function / whatever accordingly.
  • fwatch gets an output from external application, for example as an array, which I've already mentioned in my previous post.

Main advantage of this solution: it would be very, very flexible. One could provide it's own program without the need to change anything in fwatch. Just provide the path to the executable, make sure it's there, parse the input (which could be totally different than my aforementioned proposal) and return something in format of OFP's array.

 
One more thing comes to my mind - what about upgrading fwatch project files to Visual Studio 2015? This may seem as a trivial question, yet I guess you have some good reasons to keep it in the older format? Surely upgrading isn't as easy as using officlal VS's project upgrade feature, as it doesn't compile anymore. I didn't really try that much to fix it, but I will in the free time.

 

Adding described external logic to fwatch could also work, but it would limit us to using C++ as a main language and we would have to recompile it every time and swap DLL, instead of doing so only with our external program in case of any changes.

Share this post


Link to post
Share on other sites

my idea is to manage most mission's logic externally by another application

Good luck.

 

What about upgrading fwatch project files to Visual Studio 2015? I guess you have some good reasons to keep it in the older format?

Vektorboson has made source for the newer VS but I had issues with the latter so I moved to the old one. Also OFP is an old game and I'd like to have compatibility with old computers.

Share this post


Link to post
Share on other sites

Good luck.

Thanks. I'm not sure if it's not an irony, but I just really like this idea and I'm curious if it's possible to do or not, even if it won't work efficiently enough to actually use it in missions.

 

Seems like even predefined function that calls wget doesn't work for me, it crashes CWA with the same reason as fgets mentioned in one of the previous posts. I wonder if it's not an OS-related issue (Windows 10). Microsoft just loves to gradually restrict access for applications, which generally isn't a bad idea, yet I miss Windows 98 in this matter. One could delete whole Windows folder, while Windows was still running.

 

I think I'll try to get some info on MSDN forums.

Share this post


Link to post
Share on other sites

Hello! Thank you so much for your work! Through this work I was able to make ideas real. You can see on my youtube channel https://www.youtube.com/channel/UClQweo3ZqWpBw12tDPz138A/videos. The question is whether the function changes the gamma? The aspect ratio is in fashion thanks to your tool changes automatically. And gamma correction do I need to change in the night time. In this video you can see how it is necessary ))  

 

 

 

 

 

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×