I want to set up a dart ammo tally for AMS; for when you go to the manifest screen(F5-F5), you can read a message like "AMS dart ammo available: <darts in magazine>". I recon it would be useful to quickly tell how much ammo is remaining in the AMS, and since it doesn't use missile stores like other ammo...
I know the AMS uses a mission variable, amCount, to keep track of it's ammo, and it would be swell to read the amCount variable for the manifest message.
The thing is, I'm completely at a loss on how to make that happen. Some assistance, please
AMS ammo counter
Moderators: winston, another_commander
- Cmdr Wyvern
- ---- E L I T E ----
- Posts: 1649
- Joined: Tue Apr 11, 2006 1:47 am
- Location: Somewhere in the great starry void
AMS ammo counter
Running Oolite buttery smooth & rock stable w/ tons of eyecandy oxps on:
ASUS Prime X370-A
Ryzen 5 1500X
16GB DDR4 3200MHZ
128GB NVMe M.2 SSD (Boot drive)
1TB Hybrid HDD (For software and games)
EVGA GTX-1070 SC
1080P Samsung large screen monitor
ASUS Prime X370-A
Ryzen 5 1500X
16GB DDR4 3200MHZ
128GB NVMe M.2 SSD (Boot drive)
1TB Hybrid HDD (For software and games)
EVGA GTX-1070 SC
1080P Samsung large screen monitor
The mission javascript element is your friend here, specifically mission.setInstructionsKey()
That said I must admit I'm highly dubious about using the manifest screen for such things, simply because very very quickly it seems to fill up once you get a few OXPs in the game and becomes indecipherable and messy. That's why I've avoided using it for just this kind of consideration, and use a pop-up message on launch instead.
That said I must admit I'm highly dubious about using the manifest screen for such things, simply because very very quickly it seems to fill up once you get a few OXPs in the game and becomes indecipherable and messy. That's why I've avoided using it for just this kind of consideration, and use a pop-up message on launch instead.
My OXPs via Boxspace or from my Wiki pages .
Thargoid TV
Dropbox Referral Link
Thargoid TV
Dropbox Referral Link
- Cmdr Wyvern
- ---- E L I T E ----
- Posts: 1649
- Joined: Tue Apr 11, 2006 1:47 am
- Location: Somewhere in the great starry void
Sorry bud, that's not a lot of help. I'm hopelessly ignorant on how to make this go. I tried studying the code from mission oxps, and got lost in the code and even more confused.Thargoid wrote:The mission javascript element is your friend here, specifically mission.setInstructionsKey()
Noted. I don't have a lot of mission oxps installed myself, just UPS and RH at the moment. I tend to uninstall one-shot missions once I play them through.Thargoid wrote:That said I must admit I'm highly dubious about using the manifest screen for such things, simply because very very quickly it seems to fill up once you get a few OXPs in the game and becomes indecipherable and messy. That's why I've avoided using it for just this kind of consideration, and use a pop-up message on launch instead.
But what the hell, I thought it would be a handy widget to have. Normally AMS only displays a hud message when you launch or it shoots off a dart.
For anyone who gives a flip, here's the code I'm tinkering with.
Code: Select all
this.startUp = this.shipLaunchedFromStation = this.shipExitedWitchspace = this.shipDockedWithStation = function() { // Displays dart ammo count on the manifest screen. No ammo display if AMS N/A.
if(player.ship.hasEquipment("EQ_AMS") && missionVariables.amCount > 0) {
mission.setInstructionsKey("ams_ammo_status" + (this.amCount));
}
else if(player.ship.hasEquipment("EQ_AMS") && missionVariables.amCount < 1) {
mission.setInstructionsKey("ams_ammo_status_empty");
}
}
Running Oolite buttery smooth & rock stable w/ tons of eyecandy oxps on:
ASUS Prime X370-A
Ryzen 5 1500X
16GB DDR4 3200MHZ
128GB NVMe M.2 SSD (Boot drive)
1TB Hybrid HDD (For software and games)
EVGA GTX-1070 SC
1080P Samsung large screen monitor
ASUS Prime X370-A
Ryzen 5 1500X
16GB DDR4 3200MHZ
128GB NVMe M.2 SSD (Boot drive)
1TB Hybrid HDD (For software and games)
EVGA GTX-1070 SC
1080P Samsung large screen monitor
- JensAyton
- Grand Admiral Emeritus
- Posts: 6657
- Joined: Sat Apr 02, 2005 2:43 pm
- Location: Sweden
- Contact:
The good news is, mission screens will be far simpler in 1.74.Cmdr Wyvern wrote:Sorry bud, that's not a lot of help. I'm hopelessly ignorant on how to make this go. I tried studying the code from mission oxps, and got lost in the code and even more confused.
E-mail: [email protected]
@Wyvern - looks in the right kind of lines.
Grab my Planetfall taxi add-on and have a look in there, that uses the manifest screen to show where the destination is, and the script's reasonably small.
Not much time at the moment (off on hols on Monday, so manic sorting out etc) but if this goes on until next weekend I'll look at it for you).
Grab my Planetfall taxi add-on and have a look in there, that uses the manifest screen to show where the destination is, and the script's reasonably small.
Not much time at the moment (off on hols on Monday, so manic sorting out etc) but if this goes on until next weekend I'll look at it for you).
My OXPs via Boxspace or from my Wiki pages .
Thargoid TV
Dropbox Referral Link
Thargoid TV
Dropbox Referral Link
Wyvern, it looks ok, but what have you got inside missiontext.plist?
As Ahruman said, the whole mission stuff is going to be simpler to handle in 1.74.
In this specific case, in 1.74 you will also be able to just do
mission.setInstructions("AMS dart ammo available: " + (this.amCount));
without adding all the various instructions key definitions inside missiontext.plist.
As Ahruman said, the whole mission stuff is going to be simpler to handle in 1.74.
In this specific case, in 1.74 you will also be able to just do
mission.setInstructions("AMS dart ammo available: " + (this.amCount));
without adding all the various instructions key definitions inside missiontext.plist.
Hey, free OXPs: farsun v1.05 & tty v0.5! :0)
- Cmdr Wyvern
- ---- E L I T E ----
- Posts: 1649
- Joined: Tue Apr 11, 2006 1:47 am
- Location: Somewhere in the great starry void
Thank, Thargy. This puts me on the right track, methinks.Thargoid wrote:@Wyvern - looks in the right kind of lines.
Grab my Planetfall taxi add-on and have a look in there, that uses the manifest screen to show where the destination is, and the script's reasonably small.
Not much time at the moment (off on hols on Monday, so manic sorting out etc) but if this goes on until next weekend I'll look at it for you).
Running Oolite buttery smooth & rock stable w/ tons of eyecandy oxps on:
ASUS Prime X370-A
Ryzen 5 1500X
16GB DDR4 3200MHZ
128GB NVMe M.2 SSD (Boot drive)
1TB Hybrid HDD (For software and games)
EVGA GTX-1070 SC
1080P Samsung large screen monitor
ASUS Prime X370-A
Ryzen 5 1500X
16GB DDR4 3200MHZ
128GB NVMe M.2 SSD (Boot drive)
1TB Hybrid HDD (For software and games)
EVGA GTX-1070 SC
1080P Samsung large screen monitor