Gameplay coding

Files named “Mission_01”, “Mission_02… is the files that will create missions for “Societe”‘s gameplay. Everything is very easy. So gameplay will be the sequence of shortfiles like that:

#MISSION 01
#Cars in mission (CiM, max=5)
5
#Car 1
Badboy XY-3
#Car 2
Day Tonic
#Car 3
Rossa Targa Turbo
#Car 4
Sharky Shark c3506i
#Car 5
Tristar Lion
#Mission Location (MLoc)
Nevaring
#Mission Type (MTyp)
Hotlap
#Mission Success (MSuc)
72.183
#Mission Info (MInf)
This is your first mission
Try to not fucup
That’s your chance

And we need some code to read “Mission_…” files:

##############################
# READ mission file #
##############################

filename = ‘Mission_’+CurMisNum
filename = filename[:-1]
fi = open(filename,’r’)
s01 = fi.readline() #01 Mission Name
s02 = fi.readline() #02
s03 = fi.readline() #03 CiM – Cars in Mission
s04 = fi.readline() #04
s05 = fi.readline() #05 Car 1 Name
s06 = fi.readline() #06
s07 = fi.readline() #07 Car 2 Name
s08 = fi.readline() #08
s09 = fi.readline() #09 Car 3 Name
s10 = fi.readline() #10
s11 = fi.readline() #11 Car 4 Name
s12 = fi.readline() #12
s13 = fi.readline() #13 Car 5 Name
s14 = fi.readline() #14
s15 = fi.readline() #15 MLoc – Mission Location
s16 = fi.readline() #16
s17 = fi.readline() #17 MTyp – Mission Type
s18 = fi.readline() #18
s19 = fi.readline() #19 MSuc – Mission Success
s20 = fi.readline() #20
s21 = fi.readline() #21 MInf01
s22 = fi.readline() #22 MInf02
s23 = fi.readline() #23 MInf03
fi.close()

print (‘#Mission File Read#’)

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s