well here we go folks...
spent this morning learning a little about the missions structure and code
and here's a little of what i have picked up so far..
ADDING RANDOM AIRCRAFT ATTACKS TO MISSIONS....example tutorial #1
go to your scripts folder and open the
ServerScript0050.txt--this is the first training mission USCHULE1
here's the contents
/////////////////////////////////
# USchule 1
id mysim
phase init
SetDescriptionMapTexture "ordermap_nordsee.jpg"
SetTimeLimit $0
StartTime 11.0, 15.0
StartDate 1914,5,5
ChangeGeoPivot 10.312,54.554
Weather "sunrise"
EnableTutorial
SetTutorialString "- Steuern Sie die auf der Karte (F3) markierten Zielgebiete an.\- Details entnehmen SieIhrer Missions-Order (F10)\- Die Position der Ziele entnehmen Sie der Karte (F3)"
CreateSimulationObject [mysim],"u35"
SetPositionGeo [mysim],10.312,54.554,0
BindToController [mysim]
DefineMissionGoal $0,"StayArea", 10.446, 54.667, 5000, $1
SetMissionGoalText $0,"Erreichen Sie Zielgebiet 1",$1,"Zielgebiet 1"
DefineMissionGoal $1,"StayArea", 10.557, 54.538, 5000, $1
SetMissionGoalText $1,"Erreichen Sie Zielgebiet 2",$1,"Zielgebiet 2"
DefineMissionGoal $2,"StayArea", 10.266, 54.485, 5000, $1,$3
SetMissionGoalText $2,"Fahren Sie zum Heimathafen",$1,"Heimathafen"
#Mission
AddRandomShips "Airplane#10.446,54.667,150000",010
EveryFrame
CompleteOnGoal "Schulungsmission beendet.",$4
Endphase
end
///////////////////////////////////////
NOTE the code used by the missions does not display correctly in the forum so use it as a editing guide only ..
compare the above to the stock mission and work that way...
i have made TWO alterations to this mission...
ONE/ i have altered the player sub to the U35
thus
CreateSimulationObject [mysim],"u35"
TWO/ I have added random aircraft attacks
thus
#Mission
AddRandomShips "Airplane#10.446,54.667,150000",010
note the location of the aircraft area (compare it to the mission goal location)
10.446,54.667
and the size of the area it covers
150000
and the frequency of the attacks
010
which i have set to ten minutes
tho i'm assuming this "timer" is not clock work and doesn'tt spawn an aircraft every ten minutes but in fact "rolls a dice" every ten minutes
to randomly spawn the attack or not as the case may be..
so there you go....tested it and i get attacked by aircraft...
NOTE YOU WILL NEED TO SET THE SERVERSCRIPT0050.TXT FILE PROPERTIES TO CHANGE THE "READ ONLY" OPTION FOR THE FILE OTHER WISE YOU WON'T BE ABLE TO SAVE YOUR CHANGES (right click on the file select properties)
i now know why the aircraft in the game are easy to shoot down...
it's because they drop a torpedo into the water as they get within range..
so whilst your busy trying to shoot it down--- your actualy allready DEAD !! lol (you just don't realise it yet lol...the torpedo will get you.in a few seconds) so don't shoot at it....DIVE for heavens sake!!!
you have to shoot it down whilst it is still outside normal torpedo range..or maneuver wildy to stay safe...either way it means far greater difficulty and danger from the aircraft..which balances out nicely the fragility of the planes..mind you everything in the game is probably too fragile..but this includes your own uboot..so it is actualy fair..something to look at later on tho...
i have checked ALL the campaign missions and only three or four actualy have aircraft added so there is plenty of room to add the same aircraft to all the other missions...just get the location size of the area and timer right
i have found dynamic contact reports AND radio messages in the mission code (which seems much like VisualBasic 6 to me so i have a meager grasp on that).....i haven't tried to implement it yet tho...
it's great in fact...watching these old biplanes come in low line up then drop their torp into the water ..it's all very well done ...
now you may think that having these relatively small aircraft appearing hundreds of miles of the coast deep into the north sea or atlantic etc..isn't feasible at all (realisiticaly speaking)
BUT
during WW1 there were large numbers of sea plane "carriers" patroling just about every-where..so this is perfectly reasonable historically speaking..and of course gameplay wise it's a hoot
end of tutorial number 1
to download the properly edited mission file
see link below
http://www.ebort2.co.uk/SOF/TUT1.zip