![]() |
SUBSIM: The Web's #1 resource for all submarine & naval simulations since 1997 |
|
![]() |
#1 |
Ace of the Deep
![]() Join Date: Apr 2002
Location: UK
Posts: 1,278
Downloads: 0
Uploads: 0
|
![]()
* int IRandom(int min, int max);
* Gives an integer random number in the interval min <= x <= max. * (max-min < MAXINT). * The resolution is the same as for Random(). the above an explanation of the irandom code function from microsoft.com /////////////////////////////////////////////////////////////////////// and here an example of it's use in an functioning SOF mission script irandom [num1],$1,$27 ////////////////////////////////////// If <Boolean expression> then one or more statements that are executed if the Boolean expression is true Else one or more statements that are executed if the Boolean expression is false End If the above an explanation of the IF ELSE function from microsoft.com ///////////////////////////////////// and here it's use in a functioning this time entirely STOCK SOF mission script if SetCondition [feind1] then KiSetCommand [ship1],$9,8000,4000,3000,[feind1] else if !Setcondition [order1] then SimSetSpeeddirect [ship1],10 KiSetCommand [ship1],$d,-0.785,10,0,$0 endif endif ////////////////// and here i have combined both functions to randomise the early war campaign # Nah Patrouille 23.08.1914 ( 3001) id mysim int num int num1 int num2 int num3 int num4 int num5 int numT float gt int processed int weather int processed2 int weather2 int processed3 int weather3 phase init SetDescriptionMapTexture "ordermap_nordsee.jpg" SetTimeLimit $0 StartTime 11.0, 15.0 CampaignStartDate ChangeGeoPivot 8,53 irandom [num],$1,$3 if sameint [num],$1 then Weather "sun" endif if sameint [num],$2 then Weather "rainsun" endif if sameint [num],$3 then Weather "sunrise" endif irandom [numT],$1,$27 if sameint [numT],$1 then *SDensity1914 endif if sameint [numT],$2 then *SDensity1914 *TOstengland endif if sameint [numT],$3 then *SDensity1914 *TOstengland *TKanal endif if sameint [numT],$4 then *SDensity1914 *TOstengland *TKanal *PKanal endif if sameint [numT],$5 then *SDensity1914 *TOstengland *TKanal *PKanal *MKanal endif if sameint [numT],$6 then *SDensity1914 *TOstengland *TKanal *PKanal *MKanal *MNordSee endif if sameint [numT],$7 then *TOstengland *TKanal *PKanal *MKanal *MNordSee endif if sameint [numT],$8 then *TKanal *PKanal *MKanal *MNordSee endif if sameint [numT],$9 then *PKanal *MKanal *MNordSee endif if sameint [numT],$10 then *MKanal *MNordSee endif if sameint [numT],$11 then *SDensity1914 *MKanal *MNordSee endif if sameint [numT],$12 then *SDensity1914 *TKanal *PKanal *MKanal endif if sameint [numT],$13 then *SDensity1914 *TOstengland *MNordSee endif if sameint [numT],$14 then *TOstengland *MNordSee endif if sameint [numT],$15 then *TOstengland *PKanal *MKanal endif if sameint [numT],$16 then *TOstengland *PKanal *MKanal *MNordSee endif if sameint [numT],$17 then *TKanal *PKanal endif if sameint [numT],$18 then *TOstengland *TKanal *MNordSee endif if sameint [numT],$19 then *MNordSee endif if sameint [numT],$20 then *MKanal endif if sameint [numT],$21 then *TKanal *MNordSee endif if sameint [numT],$22 then *SDensity1914 *PKanal *MNordSee endif if sameint [numT],$23 then *SDensity1914 *MNordSee endif if sameint [numT],$24 then *SDensity1914 *TKanal *MKanal *MNordSee endif if sameint [numT],$25 then *TOstengland *PKanal *MNordSee endif if sameint [numT],$26 then *PKanal *MKanal endif if sameint [numT],$27 then *TOstengland endif CreateSimulationObject [mysim],"ufp" SetPositionGeo [mysim],8.214,53.5399,0 BindToController [mysim] irandom [num1],$1,$27 if sameint [num1],$1 then DefineMissionGoal $0,"StayArea", 6.353, 55.608, 50000, $2d0 SetMissionGoalText $0,"Patrol in Target Area",$1,"Target Area" endif if sameint [num1],$2 then DefineMissionGoal $0,"StayArea", 5.338, 54.577, 50000, $2d0 SetMissionGoalText $0,"Patrol in Target Area",$1,"Target Area" endif if sameint [num1],$3 then DefineMissionGoal $0,"StayArea", 6.353, 55.608, 50000, $2d0 SetMissionGoalText $0,"Patrol in Target Area",$1,"Target Area" endif if sameint [num1],$4 then DefineMissionGoal $0,"StayArea", 3.483, 52.963, 50000, $2d0 SetMissionGoalText $0,"Patrol in Target Area",$1,"Target Area" endif if sameint [num1],$5 then DefineMissionGoal $0,"StayArea", 3.277, 51.486, 10000, $2d0 SetMissionGoalText $0,"Patrol in Target Area",$1,"Target Area" endif if sameint [num1],$6 then DefineMissionGoal $0,"StayArea", 3.183, 51.744, 30000, $2d0 SetMissionGoalText $0,"Patrol in Target Area",$1,"Target Area" endif if sameint [num1],$7 then DefineMissionGoal $0,"StayArea", 2.455, 51.389, 30000, $2d0 SetMissionGoalText $0,"Patrol in Target Area",$1,"Target Area" endif if sameint [num1],$8 then DefineMissionGoal $0,"StayArea", 3.183, 51.744, 30000, $2d0 SetMissionGoalText $0,"Patrol in Target Area",$1,"Target Area" endif if sameint [num1],$9 then DefineMissionGoal $0,"StayArea", 2.455, 51.389, 30000, $2d0 SetMissionGoalText $0,"Patrol in Target Area",$1,"Targetz Area" endif if sameint [num1],$10 then DefineMissionGoal $0,"StayArea", 4.167, 58.484, 50000, $2d0 SetMissionGoalText $0,"Patrol in Target Area",$1,"Target Area" endif if sameint [num1],$11 then DefineMissionGoal $0,"StayArea", 3.651, 59.862, 50000, $2d0 SetMissionGoalText $0,"Patrol in Target Area",$1,"Target Area" endif if sameint [num1],$12 then DefineMissionGoal $0,"StayArea", 7.466, 57.417, 60000, $2d0 SetMissionGoalText $0,"Patrol in Target Area",$1,"Target Area" endif if sameint [num1],$13 then DefineMissionGoal $0,"StayArea", 3.234, 54.680, 30000, $2d0 SetMissionGoalText $0,"Patrol in Target Area",$1,"Target Area" endif if sameint [num1],$14 then DefineMissionGoal $0,"StayArea", 0.604, 57.668, 50000, $2d0 SetMissionGoalText $0,"Patrol in Target Area",$1,"Target Area" endif if sameint [num1],$15 then DefineMissionGoal $0,"StayArea", -2.840, 58.852, 30000, $2d0 SetMissionGoalText $0,"Go to Target Area",$1,"Target Area" endif if sameint [num1],$16 then DefineMissionGoal $0,"StayArea", 3.901, 52.581, 15000, $2d0 SetMissionGoalText $0,"Go to Target Area",$1,"Target Area" endif if sameint [num1],$17 then DefineMissionGoal $0,"StayArea", -1.141, 56.265, 75000, $2d0 SetMissionGoalText $0,"Patrol in Target Area",$1,"Target Area" endif if sameint [num1],$18 then DefineMissionGoal $0,"StayArea", 10.372, 66.666, 75000, $2d0 SetMissionGoalText $0,"Patrol in Target Area",$1,"Target Area" endif if sameint [num1],$19 then DefineMissionGoal $0,"StayArea",6.788, 64.595, 75000, $2d0 SetMissionGoalText $0,"Patrol in Target Area",$1,"Target Area" endif if sameint [num1],$20 then DefineMissionGoal $0,"StayArea", -3.742, 60.263, 75000, $2d0 SetMissionGoalText $0,"Patrol in Target Area",$1,"Target Area" endif if sameint [num1],$21 then DefineMissionGoal $0,"StayArea", 0.854, 60.847, 75000, $2d0 SetMissionGoalText $0,"Patrol in Target Area",$1,"Target Area" endif if sameint [num1],$22 then DefineMissionGoal $0,"StayArea", -1.425, 56.569, 50000, $2d0 SetMissionGoalText $0,"Patrol in Target Area",$1,"Target Area" endif if sameint [num1],$23 then DefineMissionGoal $0,"StayArea",0.721, 55.679, 50000, $2d0 SetMissionGoalText $0,"Patrol in Target Area",$1,"Target Area" endif if sameint [num1],$24 then DefineMissionGoal $0,"StayArea", 0.253,55.287, 75000, $2d0 SetMissionGoalText $0,"Patrol in Target Area",$1,"Target Area" endif if sameint [num1],$25 then DefineMissionGoal $0,"StayArea", -1.141, 56.265, 75000, $2d0 SetMissionGoalText $0,"Patrol in Target Area",$1,"Target Area" endif if sameint [num1],$26 then DefineMissionGoal $0,"StayArea", -11.069, 53.020, 75000, $2d0 SetMissionGoalText $0,"Patrol in Target Area",$1,"Target Area" endif if sameint [num1],$27 then DefineMissionGoal $0,"StayArea", -0.818, 55.641, 50000, $2d0 SetMissionGoalText $0,"Patrol in Target Area",$1,"Target Area" endif DefineMissionGoal $1,"StayArea", 8.129, 53.49, 3000, $1,$3 SetMissionGoalText $1,"Rückkehr zur Basis",$1,"Heimatgebiet" ApplyStateEngine $0,"FleeNorth#borneo#6.353,55.608,50000,720#0" #Mission ApplyStateEngine $0,"TradeRouteFour#Borneo,1#-1.698,56.719#1.593,53.601#6.840,54.450#-1.698,56.719#12" ApplyStateEngine $0,"TradeRouteFour#Berberis,2#2.380,51.776#4.047,5 5.892#-2.069,58.676#5.218,54.278#15" ApplyStateEngine $0,"Traderoutefour#Prometheus,3#-2.704,56.143#-0.795,56.081#0.858,53.377#1.975,52.607#10" irandom [num2],$1,$11 if sameint [num2],$1 then ApplyStateEngine $0,"ThreePoint#lion#-2.600,58.900,300000000#-0.200,59.900#-0.400,57.700#10" ApplyStateEngine $0,"ThreePoint#zerst3#-2.615,58.900,300000000#-0.200,59.900#-0.400,57.700#10" endif if sameint [num2],$2 then ApplyStateEngine $0,"ThreePoint#iron_duke#-2.600,58.900,300000000#-0.200,59.900#-0.400,57.700#11" ApplyStateEngine $0,"ThreePoint#zerst3#-2.615,58.900,300000000#-0.200,59.900#-0.400,57.700#11" endif if sameint [num2],$3 then ApplyStateEngine $0,"ThreePoint#iron_duke#-2.600,58.900,300000000#-0.200,59.900#-0.400,57.700#12" ApplyStateEngine $0,"ThreePoint#lion#-2.615,58.900,300000000#-0.200,59.900#-0.400,57.700#12" endif if sameint [num2],$4 then ApplyStateEngine $0,"ThreePoint#aylwn#-2.600,58.900,300000000#-0.200,59.900#-0.400,57.700#13" ApplyStateEngine $0,"ThreePoint#zerst2#-2.615,58.900,300000000#-0.200,59.900#-0.400,57.700#13" endif if sameint [num2],$5 then ApplyStateEngine $0,"ThreePoint#aylwn#-2.600,58.900,300000000#-0.200,59.900#-0.400,57.700#14" ApplyStateEngine $0,"ThreePoint#cuba#-2.615,58.900,300000000#-0.200,59.900#-0.400,57.700#14" endif if sameint [num2],$6 then ApplyStateEngine $0,"ThreePoint#cressy#-2.600,58.900,300000000#-0.200,59.900#-0.400,57.700#15" ApplyStateEngine $0,"ThreePoint#zerst2#-2.615,58.900,300000000#-0.200,59.900#-0.400,57.700#15" endif if sameint [num2],$7 then ApplyStateEngine $0,"ThreePoint#iron_duke#-2.600,58.900,300000000#-0.200,59.900#-0.400,57.700#16" ApplyStateEngine $0,"ThreePoint#zerst3#-2.615,58.900,300000000#-0.200,59.900#-0.400,57.700#16" endif if sameint [num2],$8 then ApplyStateEngine $0,"ThreePoint#iron_duke#-2.600,58.900,300000000#-0.200,59.900#-0.400,57.700#17" ApplyStateEngine $0,"ThreePoint#lion#-2.615,58.900,300000000#-0.200,59.900#-0.400,57.700#17" endif if sameint [num2],$9 then ApplyStateEngine $0,"ThreePoint#aylwn#-2.600,58.900,300000000#-0.200,59.900#-0.400,57.700#18" ApplyStateEngine $0,"ThreePoint#zerst2#-2.615,58.900,300000000#-0.200,59.900#-0.400,57.700#18" endif if sameint [num2],$10 then ApplyStateEngine $0,"ThreePoint#aylwn#-2.600,58.900,300000000#-0.200,59.900#-0.400,57.700#19" ApplyStateEngine $0,"ThreePoint#cuba#-2.615,58.900,300000000#-0.200,59.900#-0.400,57.700#19" endif if sameint [num2],$11 then ApplyStateEngine $0,"ThreePoint#cressy#-2.600,58.900,300000000#-0.200,59.900#-0.400,57.700#20" ApplyStateEngine $0,"ThreePoint#zerst2#-2.615,58.900,300000000#-0.200,59.900#-0.400,57.700#20" endif irandom [num3],$1,$3 if sameint [num3],$1 then AddPositionTracker $1,$630,"Von Admiralität.\\To .\U-Boote.\Hostile contact.\\Position: %s\Course: %d\\Instructions,\if possible.\Attack.\if current orders\allow!" endif if sameint [num3],$2 then AddPositionTracker $2,$630,"Von Admiralität.\\To .\U-Boote.\Enemy contact.\\Position: %s\Course: %d\\Instructions,\Confirm this contact.\ And Attack.\if current orders allow\Kaptain!" endif if sameint [num3],$3 then AddPositionTracker $3,$630,"Von Admiralität.\\To .\U-Boote.\British contact.\\Position: %s\Course: %d\\Instructions,\Confirm this contact.\ And Attack.\if current orders allow\Kaptain!" endif irandom [num4],$1,$3 if sameint [num4],$1 then AddRandomShips "Attack#zerst3#6.840,54.450,200000#20",1120 endif if sameint [num4],$2 then AddRandomShips "Attack#zerst3#0.858,53.377,200000#20",1120 endif if sameint [num4],$3 then AddRandomShips "Attack#zerst3#2.380,51.776,200000#20",1120 endif irandom [num5],$1,$3 if sameint [num5],$1 then ApplyStateEngine $0,"TradeRouteFour#Zerst3#-1.679,56.726#1.593,53.601#6.840,54.450#-1.698,56.719#12" endif if sameint [num5],$2 then ApplyStateEngine $0,"TradeRouteFour#Zerst3#2.389,51.789#4.047,55.89 2#-2.069,58.676#5.218,54.278#15" endif if sameint [num5],$3 then ApplyStateEngine $0,"Traderoutefour#zerst3#-2.712,56.148#-0.795,56.081#0.858,53.377#1.975,52.607#10" endif EveryFrame CompleteOnGoal "Willkommen zu Hause!",$2 irandom [weather],$1,$3 if sameint [weather],$1 then GameTime [gt] ifall sameint [processed],$0 greater [gt],36000 then Weather "mgrain" setint [processed],$1 endif endif if sameint [weather],$2 then GameTime [gt] ifall sameint [processed],$0 greater [gt],36000 then Weather "mgfog" setint [processed],$1 endif endif if sameint [weather],$3 then GameTime [gt] ifall sameint [processed],$0 greater [gt],36000 then Weather "mgsun" setint [processed],$1 endif endif irandom [weather2],$1,$3 if sameint [weather2],$1 then GameTime [gt] ifall sameint [processed2],$0 greater [gt],70000 then Weather "mgsun" setint [processed2],$1 endif endif if sameint [weather2],$2 then GameTime [gt] ifall sameint [processed2],$0 greater [gt],70000 then Weather "mgrain" setint [processed2],$1 endif endif if sameint [weather2],$3 then GameTime [gt] ifall sameint [processed2],$0 greater [gt],70000 then Weather "mgfog" setint [processed2],$1 endif endif irandom [weather3],$1,$3 if sameint [weather3],$1 then GameTime [gt] ifall sameint [processed3],$0 greater [gt],280000 then Weather "mgsun" setint [processed3],$1 endif endif if sameint [weather3],$2 then GameTime [gt] ifall sameint [processed3],$0 greater [gt],280000 then Weather "mgrain" setint [processed3],$1 endif endif if sameint [weather3],$3 then GameTime [gt] ifall sameint [processed3],$0 greater [gt],280000 then Weather "mgfog" setint [processed3],$1 endif endif Endphase end showing perfectly how the raw VB code has been combined with the more natural SOF mission script code to randomise the in mission events...the as i have allready stated truly remarkable thing here is that you do not need an external mission generator to do this...the actual SOF mission script it self becomes the mission generator in effect... i DO hope this doesn't freak any one else out.(or perhaps that should be any-one ELSE IF out)..as i'm getting a bit tired of it by now....:rotfl: grow up people a jokes a joke...but rank stupidity is just rank stupidity and i wouldn't want to think that of any-body here...? or should i? the only possible argument is to debate what PRECISE form of code we are talking about here.. visual basic..visual studio..visual net..C++ even perhaps javascript....but that would be nit picking to the extreme as these functions are used in one shape or another by nearly if not all such code if you cannot believe it works.....download the campaign and run it...if you cannot believe it works after that then contact microsoft and inform them of their mistakes ...or consult a doctor..
__________________
the world's tinyiest sh3 supermod- ![]() and other SH3/SH2 stuff http://www.ebort2.co.uk/ The best lack all conviction, while the worst Are full of passionate intensity. W.B.Yeats Last edited by CB..; 09-29-07 at 04:46 PM. |
![]() |
![]() |
![]() |
#2 |
Nub
![]() Join Date: Sep 2007
Posts: 4
Downloads: 0
Uploads: 0
|
![]()
Purchased this game after reading the discussions in this forum. It is a quality product and nothing budget about it.
I have used CB's voice files and random campaign files without problems BUT make sure you delete the 'readme.txt' that came with the files. It crashed SOF when I failed to do so. BTW, MoBo (the maneuvering board software) works fine with this game. |
![]() |
![]() |
![]() |
#3 |
Ace of the Deep
![]() Join Date: Apr 2002
Location: UK
Posts: 1,278
Downloads: 0
Uploads: 0
|
![]()
Cheers...yup nowt wrong with the game ..i'd play it just to see the ship models in action...even if that was all there was to it...the fact it is moddable makes it fun to experiment with as well....sorry to hear about the readme.txt problem.....glad you got it sorted
![]() just had a look at the mobo forum...hadn't been in there before....fascinating stuff ..certainly adds a new level of interest to any subsim..can't be bad
__________________
the world's tinyiest sh3 supermod- ![]() and other SH3/SH2 stuff http://www.ebort2.co.uk/ The best lack all conviction, while the worst Are full of passionate intensity. W.B.Yeats |
![]() |
![]() |
![]() |
#4 | |
Pacific Aces Dev Team
|
![]() Quote:
I would bet on a missing/corrupt file that causes the crash due to the game's engine inability to find it ![]() ![]() Let us track the error...if it is only a missing file we might be able to supply it to you ![]()
__________________
One day I will return to sea ... |
|
![]() |
![]() |
![]() |
#5 |
Nub
![]() Join Date: Sep 2007
Posts: 4
Downloads: 0
Uploads: 0
|
![]()
At first I thougt the 'readme.txt' files in CB's minimods were responsible, but that was coincidental. I experienced random crashes afterwards until I ran SOF under Win2000 compatibilty mode. Program is more stable now.
|
![]() |
![]() |
![]() |
#6 |
Captain
![]() Join Date: Mar 2007
Posts: 508
Downloads: 104
Uploads: 0
|
![]()
After reading the thread here I went ahead and downloaded the game. Initial impressions - runs fine on my kit (E6600 @ 3.0 Ghz, o/c'd 8800GTS, etc) and while not spectacular, the visuals work.
After going through all the training missions, 3 things are bothering me: 1. No exact bearing indication for the binocs or more importantly the scope - enough has been said about that already, and hopefully either the dev or the modders will come up with a solution. 2. Limited external views - doesn't seem to be any real reason for it either. The sub models are are all fully developed... just needs some way to move/rotate the TAB view. 3. The mouse and KP arrow key controls for the views are dog slow. I'm sure that somewhere in all those text files - maybe in the userinterface files? - is a setting for rotation speed or sensitivity. Half of it is in German though... makes it hard to pin down. Have we heard anything from the devs snce release RE a possible patch? I checked out their web site and forums but not much going on there. JD PS. to CB and those trying to polish what could very well be a diamond in the rough... don't let the nay-sayers get you down. Those of us interested in actually playing this game appreciate your efforts. PPS. would it make sense to add a new thread right next to this one where ready for prime time mods could be placed or listed? It's hard to keep track of things with this thread going on 12 pages and sure to grow significantly larger. We'll probably (hopefully) need one for strategy and tactics as well. Just a thought. |
![]() |
![]() |
![]() |
#7 |
Sea Lord
![]() Join Date: May 2005
Location: Under a thermal layer in chilly Olde England
Posts: 1,842
Downloads: 0
Uploads: 0
|
![]()
Yup, it's rough around the edges for sure, but there is an enjoyable game in there all the same. It's nice to have one where mines and the deck gun are the primary weapons for much of the time, that makes for a very different experience.
I feel your pain on the German language issues. I bought the German version before it was released in English, in fact I actually bought three copies and gave two of them to of my buddies. My German is limited to ordering beers and asking for directions, so it's a struggle, and it certainly was when I first got the thing and had to wade through the manual, as they never taught us the words for 'torpedo' and 'blow main ballast' in my school German classes, it was all, 'this is my house' and 'the cat is in the garden' etc, stuff like that. How thoughtless! A quick look through the folders will reveal that it is eminently moddable and I'm on the case with some, with the intention of putting them all in one package when there is something to shout about, at which point, I would start another thread for it. The most annoying thing is that there was the facility to shift the camera about on it before release, as evidenced by the video promo for it, and it beats me why they ditched it, because the models are generally not bad, and some of them are very good indeed, but you don't get to enjoy them as half the time they are sinking when you get close enough to check them out. ![]()
__________________
![]() |
![]() |
![]() |
![]() |
#8 | |
Pacific Aces Dev Team
![]() |
![]()
@ USS Sea Tiger
Quote:
|
|
![]() |
![]() |
![]() |
#9 |
Seasoned Skipper
![]() Join Date: Jan 2002
Posts: 746
Downloads: 62
Uploads: 0
|
![]()
So how dynamic is the campaign? Is it like SH3, where I can go wherever my heart desires, and I will have a chance of coming across something? Or does this happen only in the preset patrol zone for that mission? Is weather random?
I saw the Russian version of this a few months ago, but didn't pick it up because I understood that the campaign was just a string of canned missions. However, if this is not the case, then that's a another matter. Sorry if these questions have already been answered. Thanks |
![]() |
![]() |
![]() |
#10 |
Pacific Aces Dev Team
![]() |
![]()
@AngusJ
Hi CB has done a lot of digging into the campaign structure and is of the opinion that the randomness of the campaign is better done than SH3. This rather over long thread dates back to when the SOF forum was just that - an over long thread, but if you scim back it has a lot of his analysis. |
![]() |
![]() |
![]() |
|
|