Sophia1,
The first thing I did was to
ADD the
integer variables in the
game.attributes TAB section:
sectorX = 0, sectorY = 0
Plus
ADDing the variables for the x and y coords. for each island:
neosx = 0, neosy = 0, chanrax = 0, chanray = 0, etc.
Then in the
Script tab of
game a Call Function called
randoms was made to randomly create all the islands x and y coords.
This is the Call Function contents for
randoms (in part):
Return type: None
Parameters: <LEAVE BLANK>
game.neosx = GetRandomInt(100,199)
game.neosy = GetRandomInt(100,199)
game.chanrax = GetRandomInt(200,299)
game.chanray = GetRandomInt(200,299)
Etc, plus many more random x and y variables…
Then in the
USE (on its own) section of the
flying craft object it asks for the X and Y coords:
msg ("Enter the Sector X co-ordinate?")
get input {
if (IsInt (result)) {
sectorX = ToInt (result)
wait {
msg ("Enter the Sector Y co-ordinate?")
get input {
if (IsInt (result)) {
sectorY = ToInt (result)
sectorchecks (sectorX, sectorY)
}
else {
msg ("You need to enter a number. Try USE CRAFT again.")
}
}
}
}
else {
msg ("You need to enter a number. Try USE CRAFT again.")
}
}
This checks your input to the
Call Function named
sectorchecks which has two parameters you need to
ADD:
sectorX
sectorY
Call Function sectorchecks contains:
Return type: Integer
Parameters:
sectorX
sectorY
if (sectorX = game.neosx) {
if (sectorY = game.neosy) {
if (not game.pov.parent = landing platform 1) {
msg ("<br/>You fly off to your destination.")
MoveObject (flying craft, landing platform 1)
MoveObject (player, landing platform 1)
}
else {
msg ("You are already at these co-ordinates.")
}
}
else {
msg ("They are not valid co-ordinates. You're going nowhere.")
}
}
else if (sectorX = game.chanrax) {
if (sectorY = game.chanray) {
if (not game.pov.parent = landing platform2) {
msg ("<br/>You fly off to your destination.")
MoveObject (flying craft, landing platform2)
MoveObject (player, landing platform2)
}
else {
msg ("You are already at these co-ordinates.")
}
}
else {
if (sectorY = game.chanray1) {
if (not game.pov.parent = landing platform3) {
msg ("<br/>You fly off to your destination.")
MoveObject (flying craft, landing platform3)
MoveObject (player, landing platform3)
}
else {
msg ("You are already at these co-ordinates.")
}
}
else {
msg ("They are not valid co-ordinates. You're going nowhere.")
}
}
}
else if (sectorX = game.scythonx) {
if (sectorY = game.scythony) {
if (not game.pov.parent = landing platform4) {
msg ("<br/>You fly off to your destination.")
MoveObject (flying craft, landing platform4)
MoveObject (player, landing platform4)
}
else {
msg ("You are already at these co-ordinates.")
}
}
else {
msg ("They are not valid co-ordinates. You're going nowhere.")
}
}
else if (sectorX = game.palamorex) {
if (sectorY = game.palamorey) {
if (not game.pov.parent = landing platform5) {
msg ("<br/>You fly off to your destination.")
MoveObject (flying craft, landing platform5)
MoveObject (player, landing platform5)
}
else {
msg ("You are already at these co-ordinates.")
}
}
else {
msg ("They are not valid co-ordinates. You're going nowhere.")
}
}
else if (sectorX = game.qrelx) {
if (sectorY = game.qrely) {
if (not game.pov.parent = landing platform6) {
msg ("<br/>You fly off to your destination.")
MoveObject (flying craft, landing platform6)
MoveObject (player, landing platform6)
}
else {
msg ("You are already at these co-ordinates.")
}
}
else {
msg ("They are not valid co-ordinates. You're going nowhere.")
}
}
else if (sectorX = game.envahrx) {
if (sectorY = game.envahry) {
if (not game.pov.parent = landing platform7) {
msg ("<br/>You fly off to your destination.")
MoveObject (flying craft, landing platform7)
MoveObject (player, landing platform7)
}
else {
msg ("You are already at these co-ordinates.")
}
}
else {
msg ("They are not valid co-ordinates. You're going nowhere.")
}
}
else {
msg ("They are not valid co-ordinates. You're going nowhere.")
}
Basically, each 'check' compares your x and y inputs with the x and y coordinates of each island. First it checks you're not already at those coordinates and if not sends you (player) and the flying craft to your destination and giving default responses to anything else.
I’m not saying any of this is neat or efficient programming but I’m not advanced like others and if anyone could simplify or make this a bit more prettier than go ahead.
I hope this is OK, Sophia? Any more questions, just ask.