OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: idleness on 08 Sep 2005, 04:49:41
-
hey all, i'm new in the world of ofp programming/scripting and while i'm alright with the basic scripting commands and stuff, i can't find a way to stream output, lets say player's position to an external file(text file).
i've read the scripting "api" and can't seem to find a "function" that performs the task.
one more thing to note, a similar topic was posted on SinewsofWar.
http://www.flashpoint1985.com/cgi-bin/ikonboard311/ikonboard.cgi?s=5e4d44f849d7b3a2af35804ea3a8d183;act=ST;f=7;t=46245
But i can't understand the part abt using "hooks" and dll files. i'd appreciate if someone could shed some light on the matter.
-
Hello, and Welcome to the forums!
Unfortunately, there is no 'function' that performs the task, within operation flashpoint.
I don't claim to understand Kegetys' Fwatch program either, but I do know what it does. I assume you downloaded it, if not then the post where kegetys links to it is here (http://www.flashpoint1985.com/cgi-bin/ikonboard311/ikonboard.cgi?s=af4c25eb9f4a3ad3e9418ae6b15e6805;act=ST;f=7;t=46245;st=96).
From the fwatch comref: Write var=val to file fwatcher/mdb/name
Return value: -1 if failed, 1 if succeeded
example:
call loadFile format[":file write test.db %1 %2", "foo", 1]
File fwatcher/mdb/test.db would contain foo=1
So presumably you could say (I havent tried this feture yet)
call loadfile format[":file write info.txt %1 %2", "playerpos", getpos player]
And, of course the fwatch directory resides inside the operation flashpoint, so presumably you'll find your file inside there somewhere (this is untested).
No doubt someone will correct me if i'm wrong here, this was just a quick answer in passing
-
yes i did download the file but i can't get the file to work. =( .
anyone out there has any ideas?
-
You need to rename your OFP .exe to Flashpointresistance.exe, afaik, to get the fwatch to work right (it can be named differently if you use a beta patch instead of the 'officially released' one..)...
Then just execute the fwatch.exe (after installing it into the OFP directory) and then execute OFP...
Should work just fine..
And I think Fragorls example should then do the trick...
-
From the readme:
Note that Fwatch searches for the following executable names:
flashpointresistance.exe (launched by running fwatch.exe)
flashpointbeta.exe
operationflashpoint.exe
ofpr_server.exe
so any of these should be fine. I don't actually know if resistance is required for fwatch. (But you'd have resistance anyway, wouldn't you?)
A set of complete installation instructions would be:
1.) Extract the contents of the zip to your ofp directory. The files fwatch.exe, fwatch.dll and the folder 'fwatch' should all be sitting in the same directory as you flashpointresistance.exe file.
2.) Create a shortcut to fwatch and add whatever params you want ofp to run with. Adding -nomap is mandatory I think (well not mandatory but highly recommended). If you don't know how to do this: right click on the shortcut, go to properties. Find the 'target' box. Add the folowing text: -nomap -nosplash after the last quote mark of "\codemasters\Operation flashpoint\flashpointresistance.exe", along with any mod folders you want run. They are all passed to ofp when it runs.
3.) run the shortcut.
-
finally got it to work... thanks guys