Home   Help Search Login Register  

Author Topic: Loading ingame data to external program/file  (Read 755 times)

0 Members and 1 Guest are viewing this topic.

idleness

  • Guest
Loading ingame data to external program/file
« 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.

 

Offline Fragorl

  • Coding Team
  • Former Staff
  • ****
Re:Loading ingame data to external program/file
« Reply #1 on: 08 Sep 2005, 06:05:56 »
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.

From the fwatch comref:
Quote
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

idleness

  • Guest
Re:Loading ingame data to external program/file
« Reply #2 on: 08 Sep 2005, 10:50:57 »
yes i did download the file but i can't get the file to work. =( .

anyone out there has any ideas?

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re:Loading ingame data to external program/file
« Reply #3 on: 08 Sep 2005, 17:56:34 »
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...
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.

Offline Fragorl

  • Coding Team
  • Former Staff
  • ****
Re:Loading ingame data to external program/file
« Reply #4 on: 09 Sep 2005, 01:58:50 »
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.
« Last Edit: 09 Sep 2005, 02:05:47 by Fragorl »

idleness

  • Guest
Re:Loading ingame data to external program/file
« Reply #5 on: 15 Sep 2005, 08:57:51 »
finally got it to work... thanks guys