View Single Post
Old 02-18-09, 03:35 AM   #120
RoaldLarsen
Weps
 
Join Date: Jan 2007
Location: Control Room
Posts: 355
Downloads: 8
Uploads: 0
Default

Quote:
Originally Posted by Nedlam
I have a quick question about the random events.

I'm attempting to bypass SH3Weather and just use Sub Commander to randomize the weather at the start of the patrol. (I have a feeling SH3Weather is negating the Weather Fix incorporated in NYGM)

Anywho, it appears the first line of code I use changes the values in all three Campaign files works (example below). All other attempts to change the values after that do not work. I've tried everything I can think of. Any ideas from JScones or anyone else out there?

Basically here I want to force the value of zero for CloudsRand. I manually changed the value to 1 in all the files in SHIII then run Sub Commander. I alt tab out while it's running and check and it does change from 1 to 0. However all the other ones I try to change after these lines of code don't (FogRand, PrecipRand, WindRand). It's like the lines of code are being ignored.

[0:data\Campaigns\Campaign\Campaign_LND.MIS]
Mission|CloudsRand=I|0|0|N

;------------------------------------------------------------------------------

[0:data\Campaigns\Campaign\Campaign_RND.MIS]
Mission|CloudsRand=I|0|0|N

;------------------------------------------------------------------------------

[0:data\Campaigns\Campaign\Campaign_SCR.MIS]
Mission|CloudsRand=I|0|0|N

;------------------------------------------------------------------------------

EDIT: I'm still interested in how to get sub commander to recognize more than the first line but I think initially changing the weather in itself (no matter how you do it) might screw up the weather fix if I'm understanding how the weather fix more or less works.
I know nothing about the weather fix, so can't help you there.

And you don't show the code to change the other lines, so I don't know what you might be doing wrong.

So why am I replying?

I once ran into a simlar problem using SH3 Commander. I wanted to change multiple lines in a .cfg file, but only the first change was being made. Essentially, what I had was code that said:

Change lines in file 'A'
Change lines in file 'B'
Change more lines in file 'A'

This didn't work. But when I changed the code to

Change lines in file 'A'
Change more lines in file 'A'
Change lines in file 'B'


it worked. So, if you are are currently changing all the CloudsRand lines before you change any of the other lines, try changing the order of instructions to change all the lines in Campaign_LND.MIS then all the lines in Campaign_RND.MIS, and finally all the lines in Campaign_SCR.MIS. Use only one instance of

[0:data\Campaigns\Campaign\Campaign_LND.MIS]

and one for each of the other two files.

If I'm wrong about this, or if this is a documented behaviour of SH3 Commander, Jaeson might get upset with me. If I am correct, perhaps he'll want to think about how he manages file I/O, specifically, about when to close files that have been opened for writing.
RoaldLarsen is offline   Reply With Quote