Home   Help Search Login Register  

Author Topic: count thislist into a .txt file?  (Read 577 times)

0 Members and 1 Guest are viewing this topic.

Tlokein

  • Guest
count thislist into a .txt file?
« on: 10 Mar 2004, 17:15:56 »
Is there a way to do a count (such as count thislist) and dump the results into a text file?  

Also, is there a way to do a count and save it as a variable?

Here's what I'm trying to do.  Basically I'm trying to find a way to carry your losses over to the next mission in a campaign.  Say you start with a platoon of 36 soldiers and 9 are killed in the first battle, is there a way to save it as a variable so that in the next mission you start with 27 guys instead of 36?

Alternately if I can dump the results into a file on my hard drive I can just tweak the next mission manually (working on a SP campagin for Command Engine).

Thanks in advance for you help.  I've cruised and searched about every forum on OPFP using various keywords but haven't come up with an answer. IIRC in one of the missions for the I44 demo there was a splash screen at the beginning of a mission that gave you your losses so far, but after unpacking the mission and the campaign I haven't been able to figure it out how it was done.

Tlok

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:count thislist into a .txt file?
« Reply #1 on: 10 Mar 2004, 17:32:56 »
Trigger-

On activation: var1=count thislist; [] exec "script1.sqs"

Then just use the variable var1 in the script as you like.  

There are campaign tutorials in the Editors Depot, though I think they predate Resistance which added new commands for carrying things over from one mission to the next.

Plenty of reviewed ArmA missions for you to play

Tlokein

  • Guest
Re:count thislist into a .txt file?
« Reply #2 on: 10 Mar 2004, 17:42:39 »
Thanks macguba, I'll play around with that and see if I can get it work between missions.

Haven't checked the camp tutes in a while, but I think you are correct in that they predate resistance.  Guess I'll crack open the resistance camp and have another go at it.

Tlok

Offline Artak

  • The old beanbag shaker
  • Former Staff
  • ****
  • You want to talk about it, yes?
    • OFP Team Finlanders
Re:count thislist into a .txt file?
« Reply #3 on: 10 Mar 2004, 18:07:14 »
I don't think OFP's script language is capable in creating new files.. nor is it capable in reading them.

However, you shouldn't have any reason to do so. Many problems have a work-a-round solution.

This is from the official command reference 1.85
Quote
saveVar varName
Operand types:
    varName: String
Type of returned value:
    Nothing
Description:
    Save variable value into the campaign space. This variable is available to all following missions in the campaign.

Example:
    saveVar "varOne"
Not all is lost.

Tlokein

  • Guest
Re:count thislist into a .txt file?
« Reply #4 on: 10 Mar 2004, 19:17:05 »
Thanks Artak!

I use the command references (off and unoff), but must have missed that one...

Cheers,

Tlok

DBR_ONIX

  • Guest
Re:count thislist into a .txt file?
« Reply #5 on: 12 Mar 2004, 23:09:31 »
Hmm... How did the camera.sqs manage to make clipboard.txt
(this exec "camera.sqs" and press crtl.. Alt-Tab and look at the ofp dir, clipboard or another .txt file is there until you next launch ofp)
The script for cam.sqs is the script.pbo.. I've looked at it, but there nothing there link ""data" saveto clipboard.txt", sadly..  :'( ..... ::)

Could be usefull for saving stats of how you've done in a mission (Don't ask me why.... I don't know :P)
And scripting, to sort... hmmm... Like there's a helo flight recorder, that instread of puting it in a dialog box, it could put it in a .txt file ready to be copy-pasted to the mission folder and ran.. or is it run... I don't know/care anymore...

This could be usefull...
Oh, and savevariable would work fine...
Script would be something like :
Is teammate1 dead? Yea, then deletevehicle teammate1
Is teammate2 dead? Yea, then deletecehicle teammate 2
etc.
There must be a better way to write that, but it would work (Would suck when you need to add stuff up to ?(alive teammate63):deletevehicle teammate63

Hmm..
- Ben