


' ********************************* SPACE TRAVEL PROCEDURE/TIMER ****************************
' ********************************* SPACE TRAVEL PROCEDURE/TIMER ****************************
' ********************************* SPACE TRAVEL PROCEDURE/TIMER ****************************
' ********************************* SPACE TRAVEL PROCEDURE/TIMER ****************************
define procedure <gettraveltime>
set numeric <x1; %currentx%>
set numeric <y1; %currenty%>
set numeric <z1; %currentz%>
if flag <distzero> then flag off <distzero>
' get single distances
if (%x1% <> %x2%) then {
if (%x1% < %x2%) then set numeric <x3; %x2% - %x1%>
else set numeric <x3; %x1% - %x2%>
}
else set numeric <x3; 0>
if (%y1% <> %y2%) then {
if (%y1% < %y2%) then set numeric <y3; %y2% - %y1%>
else set numeric <y3; %y1% - %y2%>
}
else set numeric <y3; 0>
if (%z1% <> %z2%) then {
if (%z1% < %z2%) then set numeric <z3; %z2% - %z1%>
else set numeric <z3; %z1% - %z2%>
}
else set numeric <z3; 0>
' get total distance
if (%x3% = 0) or (%y3% = 0) or (%z3% = 0) then {
if (%x3% > 0) and (%y3% > 0) and (%z3% = 0) then {
set numeric <x3; %x3% * %x3%>
set numeric <y3; %y3% * %y3%>
set numeric <distance; %x3% + %y3%>
}
if (%x3% = 0) and (%y3% > 0) and (%z3% > 0) then {
set numeric <y3; %y3% * %y3%>
set numeric <z3; %z3% * %z3%>
set numeric <distance; %y3% + %z3%>
}
if (%x3% > 0) and (%y3% = 0) and (%z3% > 0) then {
set numeric <x3; %x3% * %x3%>
set numeric <z3; %z3% * %z3%>
set numeric <distance; %x3% + %z3%>
}
if (%x3% > 0) and (%y3% = 0) and (%z3% = 0) then set numeric <distance = %x3%>
if (%x3% = 0) and (%y3% > 0) and (%z3% = 0) then set numeric <distance = %y3%>
if (%x3% = 0) and (%y3% = 0) and (%z3% > 0) then set numeric <distance = %z3%>
if (%x3% = 0) and (%y3% = 0) and (%z3% = 0) then flag on <distzero>
}
else {
set numeric <x3; %x3% * %x3%>
set numeric <y3; %y3% * %y3%>
set numeric <z3; %z3% * %z3%>
set numeric <distance; %x3% + %y3%>
set numeric <distance; %distance% + %z3%>
}
'---------------------------- this will get your distance
if not flag <distzero> then {
for <distancedone; 1; 500; 1> {
set numeric <distancechecker; %distancedone% * %distancedone%>
if (%distancechecker% >= %distance%) then {
dec <distancedone>
set numeric <duration; %distancedone%>
set numeric <distancedone; 501>
}
}
}
else set numeric <duration; 0>
flag off <distzero>
end define
define procedure <reachdestinationproc>
msg <You have arrived at the specified coordinates.>
flag off <destination_engaged>
if (#destinationP# = Mars) then {
msg <You have reached the Mars planet. Your ship is pulled into orbit around the red planet.>
set string <currentplanet; Mars>
timeroff <spacetraveltimer>
flag on <orbit>
}
if (#destinationP# = Earth) then {
msg <You have reached Earth. Your ship slides into orbit around the large and colorful planet.>
set string <currentplanet; Earth>
timeroff <spacetraveltimer>
flag on <orbit>
}
timeroff <spacetraveltimer>
end define
' ******************************* SPACESHIP PROCEDURES ***********************************
' ******************************* SPACESHIP PROCEDURES ***********************************
' ******************************* SPACESHIP PROCEDURES ***********************************
' ******************************* SPACESHIP PROCEDURES ***********************************
' ******************************* SPACESHIP PROCEDURES ***********************************
define procedure <spaceship_stats_proc>
foreground <&HAF8E00>
set string <Computer_Text; system.analysis>
do <Computer_Text_Proc>
set string <Computer_Text; current location_%currentx%.%currenty%.%currentz%>
do <Computer_Text_Proc>
do <destinationQproc>
set string <Computer_Text; current quadrant_#currentQ#>
do <Computer_Text_Proc>
set string <Computer_Text; destination_%xx%.%yy%.%zz%>
do <Computer_Text_Proc>
set string <Computer_Text; missiles_#(currentship):mammo#>
do <Computer_Text_Proc>
set string <Computer_Text; gun turret ammo_#(currentship):gammo#>
do <Computer_Text_Proc>
foreground <white>
end define
define procedure <spaceship_power_proc>
msg <The computer boots up and greets you.>
foreground <&HAF8E00>
flag on <spaceship_power>
set string <Computer_Text; system.on>
do <Computer_Text_Proc>
if (%TLNplayerSex% = 1) then {
set string <Computer_Text; deference sir_>
do <Computer_Text_Proc>
}
else {
set string <Computer_Text; deference maam_>
do <Computer_Text_Proc>
}
foreground <white>
end define
define procedure <lift off>
foreground <&HAF8E00>
if not flag <spaceship_power> then do <spaceship_power_proc>
if (%mcoordinates% = 0 ) then {
set string <Computer_Text; you have not entered coordinates yet_>
do <Computer_Text_Proc>
set string <Computer_Text; i will send you into orbit and await your commands there_>
do <Computer_Text_Proc>
}
set string <Computer_Text; prepare for lift off_>
do <Computer_Text_Proc>
pause <200>
end define
' ******************************* START UNIVERSE ******************************
' ******************************* START UNIVERSE ******************************
' ******************************* START UNIVERSE ******************************
' ******************************* START UNIVERSE ******************************
define procedure <startuniverseproc>
flag on <transport_shuttle>
set string <currentQ; XI>
set string <SunQ; XI>
set string <MercuryQ; XI>
set string <VenusQ; XI>
set string <EarthQ; XI>
set string <MoonQ; XI>
set string <MarsQ; OMICRON>
set string <JupiterQ; BETA>
set string <SaturnQ; ZETA>
set string <UranusQ; IOTA>
set string <NeptuneQ; NU>
set string <PlutoQ; CHI>
set string <currentplanet; Earth>
' ************** BEGINNING COORDINATES *************
set numeric <xx; 0>
set numeric <yy; 0>
set numeric <zz; 0>
set numeric <currentx; 62>
set numeric <currenty; 53>
set numeric <currentz; 68>
' *************** SET PLANET COORDINATES ******************
set numeric <MercuryOrbit; 1>
set numeric <Mex; 54>
set numeric <Mey; 55>
set numeric <Mez; 56>
set numeric <VenusOrbit; 1>
set numeric <Vx; 41>
set numeric <Vy; 51>
set numeric <Vz; 50>
set numeric <EarthOrbit; 1>
set numeric <Ex; 62>
set numeric <Ey; 53>
set numeric <Ez; 68>
set string <MarsQ; OMICRON>
set numeric <Mx; 68>
set numeric <My; 50>
set numeric <Mz; 52>
set string <JupiterQ; BETA>
set numeric <Jx; 51>
set numeric <Jy; 82>
set numeric <Jz; 87>
set string <SaturnQ; ZETA>
set numeric <Sx; 51>
set numeric <Sy; 82>
set numeric <Sz; 87>
set string <UranusQ; IOTA>
set numeric <Ux; 51>
set numeric <Uy; 82>
set numeric <Uz; 87>
set string <NeptuneQ; NU>
set numeric <Nx; 51>
set numeric <Ny; 82>
set numeric <Nz; 87>
set string <PlutoQ; CHI>
set numeric <Px; 51>
set numeric <Py; 82>
set numeric <Pz; 87>
end define
' ******************************* ORBITS ******************************
' ******************************* ORBITS ******************************
' ******************************* ORBITS ******************************
' ******************************* ORBITS ******************************
define timer <changeorbitstimer>
interval <30>
action {
' *************************** MERCURY ORBIT **************************
if (%MercuryOrbit% = 4) then set numeric <MercuryOrbit; 1>
else {
if (%MercuryOrbit% = 3) then set numeric <MercuryOrbit; 4>
if (%MercuryOrbit% = 2) then set numeric <MercuryOrbit; 3>
if (%MercuryOrbit% = 1) then set numeric <MercuryOrbit; 2>
}
if (%MercuryOrbit% = 1) then {
set numeric <Mex; 54>
set numeric <Mey; 55>
set numeric <Mez; 56>
}
if (%MercuryOrbit% = 2) then {
set numeric <Mex; 46>
set numeric <Mey; 53>
set numeric <Mez; 48>
}
if (%MercuryOrbit% = 3) then {
set numeric <Mex; 48>
set numeric <Mey; 45>
set numeric <Mez; 44>
}
if (%MercuryOrbit% = 4) then {
set numeric <Mex; 52>
set numeric <Mey; 47>
set numeric <Mez; 52>
}
if (#currentplanet# = Mercury) then {
set numeric <currentx; %Mex%>
set numeric <currenty; %Mey%>
set numeric <currentz; %Mez%>
}
' *************************** VENUS ORBIT **************************
if (%VenusOrbit% = 4) then set numeric <VenusOrbit; 1>
else {
if (%VenusOrbit% = 3) then set numeric <VenusOrbit; 4>
if (%VenusOrbit% = 2) then set numeric <VenusOrbit; 3>
if (%VenusOrbit% = 1) then set numeric <VenusOrbit; 2>
}
if (%VenusOrbit% = 1) then {
set numeric <Vx; 41>
set numeric <Vy; 51>
set numeric <Vz; 50>
}
if (%VenusOrbit% = 2) then {
set numeric <Vx; 49>
set numeric <Vy; 41>
set numeric <Vz; 50>
}
if (%VenusOrbit% = 3) then {
set numeric <Vx; 59>
set numeric <Vy; 49>
set numeric <Vz; 50>
}
if (%VenusOrbit% = 4) then {
set numeric <Vx; 51>
set numeric <Vy; 59>
set numeric <Vz; 50>
}
if (#currentplanet# = Venus) then {
set numeric <currentx; %Vx%>
set numeric <currenty; %Vy%>
set numeric <currentz; %Vz%>
}
' *************************** EARTH ORBIT **************************
if (%EarthOrbit% = 4) then set numeric <EarthOrbit; 1>
else {
if (%EarthOrbit% = 3) then set numeric <EarthOrbit; 4>
if (%EarthOrbit% = 2) then set numeric <EarthOrbit; 3>
if (%EarthOrbit% = 1) then set numeric <EarthOrbit; 2>
}
if (%EarthOrbit% = 1) then {
set numeric <Ex; 62>
set numeric <Ey; 53>
set numeric <Ez; 68>
}
if (%EarthOrbit% = 2) then {
set numeric <Ex; 46>
set numeric <Ey; 58>
set numeric <Ez; 47>
}
if (%EarthOrbit% = 3) then {
set numeric <Ex; 38>
set numeric <Ey; 45>
set numeric <Ez; 32>
}
if (%EarthOrbit% = 4) then {
set numeric <Ex; 54>
set numeric <Ey; 42>
set numeric <Ez; 53>
}
if (#currentplanet# = Earth) then {
set numeric <currentx; %Ex%>
set numeric <currenty; %Ey%>
set numeric <currentz; %Ez%>
}
' *************************** MARS ORBIT **************************
if (#MarsQ# = PSI) then set string <MarsQ; OMICRON>
else {
if (#MarsQ# = NU) then set string <MarsQ; PSI>
if (#MarsQ# = EPSILON) then set string <MarsQ; NU>
if (#MarsQ# = OMICRON) then set string <MarsQ; EPSILON>
}
if (#MarsQ# = OMICRON) then {
set numeric <Mx; 68>
set numeric <My; 50>
set numeric <Mz; 52>
}
if (#MarsQ# = EPSILON) then {
set numeric <Mx; 51>
set numeric <My; 63>
set numeric <Mz; 47>
}
if (#MarsQ# = NU) then {
set numeric <Mx; 33>
set numeric <My; 50>
set numeric <Mz; 48>
}
if (#MarsQ# = PSI) then {
set numeric <Mx; 49>
set numeric <My; 38>
set numeric <Mz; 50>
}
if (#currentplanet# = MARS) then {
set numeric <currentx; %Mx%>
set numeric <currenty; %My%>
set numeric <currentz; %Mz%>
}
' *************************** JUPITER ORBIT **************************
if (#JupiterQ# = OMICRON) then set string <JupiterQ; BETA>
else {
if (#JupiterQ# = MUSE) then set string <JupiterQ; OMICRON>
if (#JupiterQ# = NU) then set string <JupiterQ; MUSE>
if (#JupiterQ# = BETA) then set string <JupiterQ; NU>
}
if (#JupiterQ# = BETA) then {
set numeric <Jx; 51>
set numeric <Jy; 82>
set numeric <Jz; 87>
}
if (#JupiterQ# = NU) then {
set numeric <Jx; 20>
set numeric <Jy; 48>
set numeric <Jz; 47>
}
if (#JupiterQ# = MUSE) then {
set numeric <Jx; 47>
set numeric <Jy; 50>
set numeric <Jz; 13>
}
if (#JupiterQ# = OMICRON) then {
set numeric <Jx; 79>
set numeric <Jy; 46>
set numeric <Jz; 51>
}
if (#currentplanet# = Jupiter) then {
set numeric <currentx; %Jx%>
set numeric <currenty; %Jy%>
set numeric <currentz; %Jz%>
}
' *************************** SATURN ORBIT **************************
if (#SaturnsQ# = OMEGA) then set string <SaturnQ; ZETA>
else {
if (#SaturnQ# = CHI) then set string <SaturnQ; OMEGA>
if (#SaturnQ# = DELTA) then set string <SaturnQ; CHI>
if (#SaturnQ# = ZETA) then set string <SaturnQ; DELTA>
}
if (#SaturnQ# = ZETA) then {
set numeric <Sx; 51>
set numeric <Sy; 82>
set numeric <Sz; 87>
}
if (#SaturnQ# = DELTA) then {
set numeric <Sx; 51>
set numeric <Sy; 82>
set numeric <Sz; 87>
}
if (#SaturnQ# = CHI) then {
set numeric <Sx; 51>
set numeric <Sy; 82>
set numeric <Sz; 87>
}
if (#SaturnQ# = OMEGA) then {
set numeric <Sx; 51>
set numeric <Sy; 82>
set numeric <Sz; 87>
}
if (#currentplanet# = Saturn) then {
set numeric <currentx; %Sx%>
set numeric <currenty; %Sy%>
set numeric <currentz; %Sz%>
}
' *************************** URANUS ORBIT **************************
if (#UranusQ# = OMICRON) then set string <UranusQ; IOTA>
else {
if (#UranusQ# = PSI) then set string <UranusQ; OMICRON>
if (#UranusQ# = TAU) then set string <UranusQ; PSI>
if (#UranusQ# = NU) then set string <UranusQ; TAU>
if (#UranusQ# = EPSILON) then set string <UranusQ; NU>
if (#UranusQ# = IOTA) then set string <UranusQ; EPSILON>
}
if (#UranusQ# = IOTA) then {
set numeric <Ux; 51>
set numeric <Uy; 82>
set numeric <Uz; 87>
}
if (#UranusQ# = EPSILON) then {
set numeric <Ux; 20>
set numeric <Uy; 48>
set numeric <Uz; 47>
}
if (#UranusQ# = NU) then {
set numeric <Ux; 47>
set numeric <Uy; 50>
set numeric <Uz; 13>
}
if (#UranusQ# = TAU) then {
set numeric <Ux; 79>
set numeric <Uy; 46>
set numeric <Uz; 51>
}
if (#UranusQ# = PSI) then {
set numeric <Ux; 79>
set numeric <Uy; 46>
set numeric <Uz; 51>
}
if (#UranusQ# = OMICRON) then {
set numeric <Ux; 79>
set numeric <Uy; 46>
set numeric <Uz; 51>
}
if (#currentplanet# = Uranus) then {
set numeric <currentx; %Ux%>
set numeric <currenty; %Uy%>
set numeric <currentz; %Uz%>
}
' *************************** NEPTUNE ORBIT **************************
if (#NeptuneQ# = EPSILON) then set string <NeptuneQ; NU>
else {
if (#NeptuneQ# = OMICRON) then set string <NeptuneQ; EPSILON>
if (#NeptuneQ# = PSI) then set string <NeptuneQ; OMICRON>
if (#NeptuneQ# = NU) then set string <NeptuneQ; PSI>
}
if (#UranusQ# = NU) then {
set numeric <Nx; 51>
set numeric <Ny; 82>
set numeric <Nz; 87>
}
if (#UranusQ# = PSI) then {
set numeric <Nx; 51>
set numeric <Ny; 82>
set numeric <Nz; 87>
}
if (#UranusQ# = OMICRON) then {
set numeric <Nx; 51>
set numeric <Ny; 82>
set numeric <Nz; 87>
}
if (#UranusQ# = EPSILON) then {
set numeric <Nx; 51>
set numeric <Ny; 82>
set numeric <Nz; 87>
}
if (#currentplanet# = Neptune) then {
set numeric <currentx; %Nx%>
set numeric <currenty; %Ny%>
set numeric <currentz; %Nz%>
}
' *************************** PLUTO ORBIT **************************
if (#PlutoQ# = NU) then set string <PlutoQ; CHI>
else {
if (#PlutoQ# = DELTA) then set string <PlutoQ; NU>
if (#PlutoQ# = EPSILON) then set string <PlutoQ; DELTA>
if (#PlutoQ# = ZETA) then set string <PlutoQ; EPSILON>
if (#PlutoQ# = OMICRON) then set string <PlutoQ; ZETA>
if (#PlutoQ# = OMEGA) then set string <PlutoQ; OMICRON>
if (#PlutoQ# = PSI) then set string <PlutoQ; OMEGA>
if (#PlutoQ# = CHI) then set string <PlutoQ; PSI>
}
if (#PlutoQ# = CHI) then {
set numeric <Px; 51>
set numeric <Py; 82>
set numeric <Pz; 87>
}
if (#PlutoQ# = PSI) then {
set numeric <Px; 51>
set numeric <Py; 82>
set numeric <Pz; 87>
}
if (#PlutoQ# = OMEGA) then {
set numeric <Px; 51>
set numeric <Py; 82>
set numeric <Pz; 87>
}
if (#PlutoQ# = OMICRON) then {
set numeric <Px; 51>
set numeric <Py; 82>
set numeric <Pz; 87>
}
if (#PlutoQ# = ZETA) then {
set numeric <Px; 51>
set numeric <Py; 82>
set numeric <Pz; 87>
}
if (#PlutoQ# = ESILON) then {
set numeric <Px; 51>
set numeric <Py; 82>
set numeric <Pz; 87>
}
if (#PlutoQ# = DELTA) then {
set numeric <Px; 51>
set numeric <Py; 82>
set numeric <Pz; 87>
}
if (#PlutoQ# = NU) then {
set numeric <Px; 51>
set numeric <Py; 82>
set numeric <Pz; 87>
}
if (#currentplanet# = Pluto) then {
set numeric <currentx; %Px%>
set numeric <currenty; %Py%>
set numeric <currentz; %Pz%>
}
}
enabled
end define
if (%x1% <> %x2%) then {
if (%x1% < %x2%) then set numeric <x3; %x2% - %x1%>
else set numeric <x3; %x1% - %x2%>
}
else set numeric <x3; 0> if (%x1% < %x2%) then set numeric <x3; %x2% - %x1%>
else set numeric <x3; %x1% - %x2%>set numeric <x3; %x1% - %x2%>
set numeric <x3; %x3% * %x3%>
msg <%x3%>Should produce erroneous results... Even with Quest 3.5, I thought negative numbers were handled correctly.
Tr0n wrote:That looks like you're inputting data of where the planets are at different points in the orbit (apart from the fact that pluto seems to be constantly in the same place)..
Am I wrong in that assumption?
Tr0n wrote:could you not just create an algorythm which can produce the planets position? Would that not be easier?
Say, give it a distance from the sun at two points in the orbit (obviously with a time) and as such produce the rest of the orbit.
Freak wrote:Any semblance of astronomical accuracy would be rather silly. Keep in mind that the earth takes a year to make one circuit (compared to the 2 minutes in your sim), and the outer planets take even longer. Unless you have very odd timescales, the movement by the planet is insignificant compared to the distance between planets. Also keep in mind that the outer planets are geometrically farther from the sun.
Yes, quite true.Any semblance of astronomical accuracy would be rather silly.
I guess you don't mean "data structure" there - but more program flow/control/whatever (I can't seem to grip the word)..by using better data structures instead of a SELECT CASE.
planet1 ->
one = x=2,y=5,z=5
two = x=3,y=4,z=5
three = x=4,y=5,z=5
four = x=3,y=4,z=5
planet2 ->
one = x=10,y=10,z=0
two = x=5,y=5,z=0
.... and a loop would just go through, saying (basically) "assign [position of planet] to [planet1].[one]" or "[planet1].[two]" where either the planet or property could be changed.