[Tutor] My first script within a game program

tonycervone tonycervone@netzero.net
Sat, 13 Oct 2001 06:38:16 -0400


This is a multi-part message in MIME format.

------=_NextPart_000_0005_01C153B1.A3BA58E0
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

I am learning Python and am trying to write a script that uses =
specific(game ) program functions for additional functionality withing =
the game play. The program is a flight sim and the two functions that I =
am trying to use are: LoadMetar() and EndSituation(). The LoadMetar() =
will call a text file, and the EndSituation() will reset the particular =
situation so that a new situation can be loaded without having to start =
the game.   Here's the script so far:
from fly import *


metarFlag =3D 0

def Main(dt):

global metarFlag

if (metarFlag =3D=3D 0):

LoadMetar("Metar\InfoMetar.txt")

NoticeToUser(" loading InfoMetar Weather v1.0", 10.0)

metarFlag =3D 1

With this script placed in the program, I can successfully load the =
InfoMetar.txt when I load my first situation. The question is that if I =
want to load a new situation I need to add the EndSituation() function =
somewhere in the script in order to reset, I suspect, some flag so that =
when I start a new situation the loadMetar() function is loaded again. =
Presently, I need to restart the Game whenever I want to load a new =
situation.  I hope I have provided enough clues. Unfortunately, I don't =
have any docs, thus the difficulty. tony cervone




------=_NextPart_000_0005_01C153B1.A3BA58E0
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2600.0" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>I am learning Python and am trying to =
write a=20
script that uses specific(game )&nbsp;program functions for additional=20
functionality withing the game play. The program is a flight sim and the =
two=20
functions that I am trying to use are: LoadMetar() and EndSituation(). =
The=20
LoadMetar() will call a text file, and the EndSituation() will reset the =

particular situation so that a new situation can be loaded without =
having to=20
start the game.&nbsp;&nbsp; Here's the script so far:</FONT></DIV>
<DIV><FONT size=3D2>
<P>from fly import *</P>
<P></P>
<P>metarFlag =3D 0</P>
<P>def Main(dt):</P>
<P>global metarFlag</P>
<P>if (metarFlag =3D=3D 0):</P>
<P>LoadMetar("Metar\InfoMetar.txt")</P>
<P>NoticeToUser(" loading InfoMetar Weather v1.0", 10.0)</P>
<P>metarFlag =3D 1</P>
<P><FONT face=3DArial>With this script placed in the program, I can =
successfully=20
load the InfoMetar.txt when I load my first situation. The question is =
that if I=20
want to load a new situation I need to add the EndSituation() function =
somewhere=20
in the script in order to reset, I suspect, some flag so that&nbsp;when =
I start=20
a new situation the loadMetar() function&nbsp;is loaded&nbsp;again. =
Presently, I=20
need to restart the Game whenever I want to load a new situation.&nbsp; =
I hope I=20
have provided enough clues. Unfortunately, I don't have any docs, thus =
the=20
difficulty. tony cervone</FONT></P>
<P><FONT face=3DArial></FONT>&nbsp;</P></FONT></DIV></BODY></HTML>

------=_NextPart_000_0005_01C153B1.A3BA58E0--

----------------------------------------------------
Sign Up for NetZero Platinum Today
Only $9.95 per month!
http://my.netzero.net/s/signup?r=platinum&refcd=PT97