A rather long question about the Planetfall.oxp
Posted: Wed Nov 03, 2010 2:40 pm
Hi all.
I am new to oxp scripting. However I have been reading through the files for the planetfall.oxp and some of it actually makes sence to me.
I can see from the script file that a screen will pop up if you land on an 'open field' or 'waste ground (dump)'.
Going through the files, I can see that this.lastPlanetType = "Prime" checks to make sure you are landing on a prime planet.
Then I see that this.landingChoice = (Math.random()*10) creates a randon number. This number determines where you are on a planet... Capital City, Military Base, Shipyard, ect...
I know there are other variables that check to see if you are on a sub planet or a moon too.
Now, this works fine and when I land on a prime planet I see the F5 screen says... Lave Prime - Shipyard, ect...
Now what I tried to do was set it up so that I ALWAYS landed on an 'Open Field' by changing this.landingChoice = (Math.random()*10) to this.landingChoice = 9.8.
This would then activate if(this.landingChoice >= 9. // spawn open fields or waste dump.
This works because the F5 screen says... Lave Prime - Open Fields.
Looking at the other variable, I see that...
if(!player.ship.dockedStation.hasRole("planetFall_noTrade")) // if we're at a location where trading is not possible
{ return; }
and
// no-one to trade with in empty fields
if(player.ship.dockedStation.hasRole("planetFall_mainSurface_fields") || player.ship.dockedStation.hasRole("planetFall_subSurface_fields"))
{
if(guiScreen == "GUI_SCREEN_EQUIP_SHIP" || guiScreen == "GUI_SCREEN_MARKET")
{
mission.runScreen({title:"Nothing but fields...", messageKey:"planetFall_noTrade", background:"planetFall_fields.png"});
}
}
...are true, so when I land on a main planet and arrive at an open field, then a screen should appear with an open field image for the background and then some text from the missiontext.plist file.
However that didn't work.
All that happened was that the F5 screen had my location on it as Lave Prime - Open Field.
The strange thing is that I know that the screen function with the background image works because it worked when I landed on a moon once.
It just don't seem to work when I change this.landingChoice = (Math.random()*10) to this.landingChoice = 9.8 to make me always land there.
The reason I was testing this out is because I was hoping to write a small oxp (or edit the existing one) so that a new background image was displayed for each possible landing location.
So a city image for Capital City, a miltiary base image for the Military Base, a shipyard image for the Shipyard, ect....
Can anyone help me with this as it's doing my head in lol.
Other than that, if someone could write a small script to work with Planetfall that would display a background image for a location, I can then duplicate that for each other location and make background images for each one.
Idealy I'd love to see a different background image on the F5 screen for each location on a planet or moon but I think that would not be possible.
Thanks.
I am new to oxp scripting. However I have been reading through the files for the planetfall.oxp and some of it actually makes sence to me.
I can see from the script file that a screen will pop up if you land on an 'open field' or 'waste ground (dump)'.
Going through the files, I can see that this.lastPlanetType = "Prime" checks to make sure you are landing on a prime planet.
Then I see that this.landingChoice = (Math.random()*10) creates a randon number. This number determines where you are on a planet... Capital City, Military Base, Shipyard, ect...
I know there are other variables that check to see if you are on a sub planet or a moon too.
Now, this works fine and when I land on a prime planet I see the F5 screen says... Lave Prime - Shipyard, ect...
Now what I tried to do was set it up so that I ALWAYS landed on an 'Open Field' by changing this.landingChoice = (Math.random()*10) to this.landingChoice = 9.8.
This would then activate if(this.landingChoice >= 9. // spawn open fields or waste dump.
This works because the F5 screen says... Lave Prime - Open Fields.
Looking at the other variable, I see that...
if(!player.ship.dockedStation.hasRole("planetFall_noTrade")) // if we're at a location where trading is not possible
{ return; }
and
// no-one to trade with in empty fields
if(player.ship.dockedStation.hasRole("planetFall_mainSurface_fields") || player.ship.dockedStation.hasRole("planetFall_subSurface_fields"))
{
if(guiScreen == "GUI_SCREEN_EQUIP_SHIP" || guiScreen == "GUI_SCREEN_MARKET")
{
mission.runScreen({title:"Nothing but fields...", messageKey:"planetFall_noTrade", background:"planetFall_fields.png"});
}
}
...are true, so when I land on a main planet and arrive at an open field, then a screen should appear with an open field image for the background and then some text from the missiontext.plist file.
However that didn't work.
All that happened was that the F5 screen had my location on it as Lave Prime - Open Field.
The strange thing is that I know that the screen function with the background image works because it worked when I landed on a moon once.
It just don't seem to work when I change this.landingChoice = (Math.random()*10) to this.landingChoice = 9.8 to make me always land there.
The reason I was testing this out is because I was hoping to write a small oxp (or edit the existing one) so that a new background image was displayed for each possible landing location.
So a city image for Capital City, a miltiary base image for the Military Base, a shipyard image for the Shipyard, ect....
Can anyone help me with this as it's doing my head in lol.
Other than that, if someone could write a small script to work with Planetfall that would display a background image for a location, I can then duplicate that for each other location and make background images for each one.
Idealy I'd love to see a different background image on the F5 screen for each location on a planet or moon but I think that would not be possible.
Thanks.