| View previous topic :: View next topic |
| Author |
Message |
MarkShot
Joined: 07 Jul 2002 Posts: 491
|
Posted: Sun May 29, 2005 4:31 pm Post subject: |
|
|
Here is an example of the controlling data file:
* MKPACGPROC (PACG post processor) Data File
*
* Lines 01-16 Comments
* Line 17 Campaign directory path
* Line 18 Number of file iterations
* Line 19 Blank line
*
* Repeating blocks
* Line +1 Search string
* Line +2 Substitute ("yes"|"no")
* Line +3 AirProbability value
* Line +4 Timer value
* Line +5 Blank line
*
* Line Last "*DONE*"
C:\user\mk\Software\Games\SH2\Dev\Test Files\
3
;Carrier Base
yes
150
160
;Column Base
no
n/a
n/a
;Patrol Bomber Base
no
n/a
n/a
;Small Craft Base
yes
170
180
;Merchant Base
no
n/a
n/a
;Tanker Base
no
n/a
n/a
;Patrol Base
no
n/a
n/a
;Q-Ship Base
no
n/a
n/a
;Jap Submarine Base
no
n/a
n/a
;Contact Base
no
n/a
n/a
*DONE* |
|
| Back to top |
|
 |
MarkShot
Joined: 07 Jul 2002 Posts: 491
|
Posted: Sun May 29, 2005 4:33 pm Post subject: |
|
|
Here is the main processing script (formatting will probably be lost):
;*****************************************************
; Pacific Aces 1.1 Post Processing Base Tweak Facility
;
; Mark Kratzer on 05/29/05; modified 05/29/05
;*****************************************************
; -----------------------------------------
; ----- Open Data File and Initialize -----
; -----------------------------------------
DataFile = FileOpen("MKPACGPROC.TXT", "READ")
LinesToSkip = 16
GoSub SkipLines
CampDirPath = FileRead(DataFile)
FileIterations = FileRead(DataFile)
;Message("Debug - CampDirPath", CampDirPath)
;Message("Debug - FileIterations", FileIterations)
FileClose (DataFile)
CountFiles = 0
CountBlocks = 0
CountStrings = 0
;------------------------------------------------
; ----- Process Each PACG Patrol File (SDF) -----
;------------------------------------------------
For IFile = 1 to FileIterations
; Form file name and process
NumStr = StrFixLeft(IFile, "0", 3)
SDFName = StrCat(CampDirPath, "Pacg_", NumStr, ".sdf")
;Message("Debug - SDFName", SDFName)
If FileExist(SDFName) Then
;Message("Debug - SDFName Exists", SDFName)
CountFiles = CountFiles+1
wFileOpen(SDFName)
;Message("Debug - Pause", "Buffer Open")
; Open the SDF into an editor buffer
DataFile = FileOpen("MKPACGPROC.TXT", "READ")
LinesToSkip = 19
GoSub SkipLines
; ------------------------------------
; ------- Process Each Base Block ----
; ------------------------------------
SearchString = "ForceEntry"
While SearchString <> "*DONE*"
SearchString = FileRead(DataFile)
;Message("Debug - SearchString", SearchString)
If SearchString <> "*DONE*" Then ; Process the block
Substitute = FileRead(DataFile)
AirProbabilityValue = FileRead(DataFile)
TimerValue = FileRead(DataFile)
BlankLine = FileRead(DataFile)
If Substitute == "yes" Then
CountBlocks = CountBlocks+1
wTopOfFile() ; position cursor
wFind(SearchString,1,0,0,0)
If WGetLineNo() <> 1 Then
CountStrings = CountStrings+2
wFind("AirProbability",1,0,0,0)
wHome()
wInsString(";")
WEnd()
wInsString(" ; MKPACGPROC Original Value")
wNewLine()
wInsString("AirProbability = ")
wInsString(AirProbabilityValue)
wInsString(" ; MKPACGPROC New Value")
wFind("Timer",1,0,0,0)
wHome()
wInsString(";")
WEnd()
wInsString(" ; MKPACGPROC Original Value")
wNewLine()
wInsString("Time = ")
wInsString(TimerValue)
wInsString(" ; MKPACGPROC New Value")
EndIf
EndIf
EndIf
EndWhile
; Close the modified SDF and reset the data file
wFileSave()
wWinClose()
FileClose (DataFile)
EndIf
Next
; -------------------------------------------
; ----- Report Final Processing Results -----
; -------------------------------------------
FinalStats = ""
FinalStats = StrCat(FinalStats, "SDF Files Processed = ", CountFiles, @CR)
FinalStats = StrCat(FinalStats, "Block Substitutions Processed = ", CountBlocks, @CR)
FinalStats = StrCat(FinalStats, "String Substitutions Processed = ", CountStrings)
Message("MKPACGPROC Completion", FinalStats)
Exit
; ----------------------------------
; ----- Subroutine definitions -----
; ----------------------------------
; ##### Skip Lines #####
:SkipLines
For ILine = 1 to LinesToSkip
IgnoreLine = FileRead(DataFile)
Next
Return |
|
| Back to top |
|
 |
MarkShot
Joined: 07 Jul 2002 Posts: 491
|
Posted: Sun May 29, 2005 4:35 pm Post subject: |
|
|
Here is a sample modified parameter block taken from an SDF during a test run:
[BASE1]
;Carrier Base
Alignment = ALLIES
Location = 0,0
AirRadius = 50000.000000
;AirProbability = 0.70000 ; MKPACGPROC Original Value
AirProbability = 150 ; MKPACGPROC New Value
;Timer = 35.000000 ; MKPACGPROC Original Value
Timer = 160 ; MKPACGPROC New Value
Group=15
NightAir=FALSE
Oneshot=FALSE |
|
| Back to top |
|
 |
Hitman
Joined: 14 Sep 2002 Posts: 3059 Location: Spain
|
Posted: Mon May 30, 2005 3:17 am Post subject: |
|
|
This modified one will cause the base to ALWAYS spawn an aircraft when the timer kicks in....weren't you looking for the opposite?
In any case, this one is probably -unless I'm wrong- the airbase linked to carriers, so it had a default high probability and low radius. |
|
| Back to top |
|
 |
MarkShot
Joined: 07 Jul 2002 Posts: 491
|
Posted: Mon May 30, 2005 8:12 am Post subject: |
|
|
The 150 and 160 you see there are just test values which I was using. My script will take whatever values I put in the configuration file and use them for the replacement.
I understand that: 1.0 = 100% and 0.10 = 10% and 0.01 = 1%. I will probably change the value on things like tankers from 0.03 to 0.005 (a 1/6 reduction). Later, I may increase patrol frequency and/or do something else to put two destroyers in a patrol.
Basically my goals are:
(1) Finding a lone tanker should be a rare and uncommon lucky break.
(2) Finding and avoiding patrols should be a regular and common reality.
(3) If you want to sink ships, you have to deal with screens and after the attack evasion/escape.
Thanks. |
|
| Back to top |
|
 |
MadMike
Joined: 22 Nov 2002 Posts: 533
|
Posted: Fri Aug 05, 2005 7:53 am Post subject: |
|
|
So... would it possible to create an "Aces" style campaign as in SH2?
Yours, Mike
IYAAYAS! |
|
| Back to top |
|
 |
Chapeau
Joined: 17 Oct 2005 Posts: 38 Location: near USS Constellation
|
Posted: Wed Nov 02, 2005 11:31 pm Post subject: Usual dumbass question |
|
|
| What is PACG? |
|
| Back to top |
|
 |
TLAM Strike
Joined: 30 Apr 2002 Posts: 4866 Location: Rochester, New York
|
Posted: Wed Nov 02, 2005 11:43 pm Post subject: Re: Usual dumbass question |
|
|
| Chapeau wrote: | | What is PACG? | Pacific Aces Campaign Generator |
|
| Back to top |
|
 |
Chapeau
Joined: 17 Oct 2005 Posts: 38 Location: near USS Constellation
|
Posted: Wed Nov 02, 2005 11:49 pm Post subject: |
|
|
I guess by now you guys have figured out that I tend to ask questions first and *then* look for the answers that are right in front of me.
So now, where can I get it? This isn't the usual "ask first and then look for it" lazy-bonehead question. I have looked for it and not found it. Thanks very much. |
|
| Back to top |
|
 |
MarkShot
Joined: 07 Jul 2002 Posts: 491
|
Posted: Thu Nov 03, 2005 10:12 am Post subject: |
|
|
PACG is part of the whole PA install.
PACG is just one component that creates a new campaign each time you run it so that you don't end up replaying the same campaign over and over again. |
|
| Back to top |
|
 |
Floater
Joined: 14 Sep 2002 Posts: 2300 Location: England
|
Posted: Thu Nov 03, 2005 5:54 pm Post subject: |
|
|
PACG itself will run with any SH2 installation, and was designed and written to be as moddable as possible (within reason), in anticipation of people wanting to use it for other projects. You can even skin it if you want - as much as possible is held externally in config and graphics files.
The hard part is setting up the data - groups, units, weather, etc. Hitman did a wonderful job of working out the formats and creating the PA data, but AFAIK there isn't really anything in the way of user documentation on either that side or for the generator itself.
If I can be of any help (I wrote the software to Hitman's data design), let me know. |
|
| Back to top |
|
 |
The Old Man
Joined: 12 Jul 2003 Posts: 181 Location: Dallas, Tx.
|
Posted: Thu Nov 03, 2005 6:12 pm Post subject: |
|
|
So now, where can I get it? This isn't the usual "ask first and then look for it" lazy-bonehead question. I have looked for it and not found it. Thanks very much.
You could order the super cd
or download the lite version if you already own Destroyer Command?
Roy |
|
| Back to top |
|
 |
Chapeau
Joined: 17 Oct 2005 Posts: 38 Location: near USS Constellation
|
Posted: Fri Nov 04, 2005 3:37 am Post subject: |
|
|
See? What'd I tell you? The answer was right in front of me. I have the Super CD.
Why couldn't God have made me smart and rich instead of just incredibly good-looking?  |
|
| Back to top |
|
 |
Chapeau
Joined: 17 Oct 2005 Posts: 38 Location: near USS Constellation
|
Posted: Fri Nov 04, 2005 3:44 am Post subject: |
|
|
| Floater wrote: | The hard part is setting up the data - groups, units, weather, etc. Hitman did a wonderful job of working out the formats and creating the PA data, but AFAIK there isn't really anything in the way of user documentation on either that side or for the generator itself.
If I can be of any help (I wrote the software to Hitman's data design), let me know. |
If I can come to understand the generator and the formats, etc., then I can write the documentation - I did it for some years for the DoD. Looks like I'm going to drop whatever else I'm doing and study PACG. I'll be in touch. |
|
| Back to top |
|
 |
The Old Man
Joined: 12 Jul 2003 Posts: 181 Location: Dallas, Tx.
|
Posted: Fri Nov 04, 2005 10:03 am Post subject: |
|
|
Why couldn't God have made me smart and rich instead of just incredibly good-looking?
LOL
I hear you |
|
| Back to top |
|
 |
|