Join us at the Oolite Anniversary Party -- London, 7th July 2024, 1pm
More details in this thread.

[OXP Request] Reversed Engineered Thargoid Laser

Discussion and information relevant to creating special missions, new ships, skins etc.

Moderators: winston, another_commander

User avatar
Norby
---- E L I T E ----
---- E L I T E ----
Posts: 2577
Joined: Mon May 20, 2013 9:53 pm
Location: Budapest, Hungary (Mainly Agricultural Democracy, TL10)
Contact:

Re: [OXP Request] Reversed Engineered Thargoid Laser

Post by Norby »

Nexus-Hex wrote:
how can I make that when you buy the equipment pops up a screen containing something written?
In playerBoughtEquipment event handler. A short message:

Code: Select all

this.playerBoughtEquipment = function(equipment)
{
     if( equipment.equipmentKey == "EQ_WEAPON_CANNON_REV_THARGOID_LASER" ) {
          player.consoleMessage("Thank you for your purchase!", 10);
     }
}
If your message is longer than a line then display a whole screen with mission.runScreen where you can insert line breaks with \n characters.
Nexus-Hex
Competent
Competent
Posts: 44
Joined: Sat Dec 31, 2016 5:36 pm

Re: [OXP Request] Reversed Engineered Thargoid Laser

Post by Nexus-Hex »

Norby wrote:
Nexus-Hex wrote:
how can I make that when you buy the equipment pops up a screen containing something written?
In playerBoughtEquipment event handler. A short message:

Code: Select all

this.playerBoughtEquipment = function(equipment)
{
     if( equipment.equipmentKey == "EQ_WEAPON_CANNON_REV_THARGOID_LASER" ) {
          player.consoleMessage("Thank you for your purchase!", 10);
     }
}
If your message is longer than a line then display a whole screen with mission.runScreen where you can insert line breaks with \n characters.
Little help over here.
I dont know how to present a missions creen with title, message and "press space, commander.
SHow me an example or a template.
Thanks in advance
User avatar
tsoj
Deadly
Deadly
Posts: 199
Joined: Wed May 18, 2016 8:19 pm
Location: Berlin
Contact:

Re: [OXP Request] Reversed Engineered Thargoid Laser

Post by tsoj »

I think this could help you:http://wiki.alioth.net/index.php/Oolite ... _callbacks

If youre searching for a special method but you dont know what name it could have then you could take a look in an oxp-script from an oxp where you know this method/property is used. At least this helps me.
User avatar
Norby
---- E L I T E ----
---- E L I T E ----
Posts: 2577
Joined: Mon May 20, 2013 9:53 pm
Location: Budapest, Hungary (Mainly Agricultural Democracy, TL10)
Contact:

Re: [OXP Request] Reversed Engineered Thargoid Laser

Post by Norby »

After wiki the best examples are the source code of oxps which do similar things, you can learn a lot while read the packaged files. I can not create better templates.
Post Reply