How do I make a plug-in that lets me buy 4 bays in Arpia 2?

Pace once E-mailed me this:

"The reason you can only get 2 Akarui bays is because I limited this on purpose based on the kind of ship. Every ship starts with 2 "bay tokens", and if you have a "large" Arpia vessel, you get additional "bay tokens". The idea is that you shouldn't normally be even able to fit more than 2 bays on a small ship, but I didn't want to change every single ship resource separately (i.e. cause incompatibility issues with "Ship Variants" plug-ins and others).

It basically boils down to this: I felt that the "X tons" criterion wasn't enough, and given the size needed for fighter bays (as opposed to the mere mass), I needed another way to limit the number of bays you can have on a ship.

If you want to get around this restriction, create a plug-in that gives you "g520" (once, twice, etc.), i.e. one (or more) bay token(s). You'll then be able to buy additional bays."

Well, I copied the outfit that gives you cloaking Akaruis to a new plug-in. Outfit 509, Akarui Bay. It apparently has a different name in the Outfitters: Akarui Bay -Cloak-.

Then I put g509 in the field When purchased (NCB set). It became now d520 g509 g509. I started Nova, and saw that my plug-in had no effect. I could still not buy a third bay, because the Buy button was grey.

Even if my plug-in editor saved the new plug-in I created in the Nova Plug-ins folder. That editor was MissionComputer for Windows Alpha 1.

Then I read the E-Mail Pace sent me again, and it says to put g520 instead. I did, and now my plug-in reads: d520 g509 g520.

I changed the line to d520 g509 g520. I started Nova, and still couldn't buy a third bay.

I deleted d520, thinking I maybe lose one bay (d520) for the one I've gained (g520).

Now it reads: g509 g520.

STILL couldn't buy a third bay.

Avaiblity (NCB test) is: b989 & o520. Though that is not much help, since I could actually buy a bay... two of them.

What am I supposed to do anyway? Put one more g520 in When purchased (NCB set):? Then it would be g509 g520 g520. I would like actual instructions instead of having endlessly just to try. Instructions that would actually let me buy that third bay. How can you actually give yourself g520 anyway?

I might, if nothing else works, have to remove the whole system Pace created and which he described in his E-Mail... as far as I know, mission bits just work, always, and never deny you the possiblity to buy something as long as you have enough free space and money. Though I would have to have instructions for that too. Is it as easy as just removing o520 from Avaiblity and then removing g520 from When purchased and then making When sold empty?

Paces instructions of doing a plug-in that gives you g520 sound easy... until you actually do it. He gives me no instructions on how to actually do the plug-in... how to actually give g520 in a way that works. Meaning, a plug-in that actually lets me buy a third bay. And actually a fourth bay. I've talked about a third bay bay because I couldn't buy any bay at all after the first 2.

I have zero knowledge of NCBs besides what the Nova Bible says and what I have seen in MissionComputer for Windows Alpha 1. I have never made a plug-in that has anything to do with NCBs. I think I did manage to do mission bits in a earlier plug-in of mine. I know that when you do a plug-in that gives you g520, then you put in a field in a plug-in. I guess that field is called When Purchased (NCB Set): in the outfit. In the outf resource. However, I have no idea how to actually give yourself g520. Well, besides what I already tried.

If nobody on this forum (EV Developers Corner) can tell me how to make a plug-in that lets me buy four cloaking Akarui bays in Arpia 2, I am going to E-Mail Pace again. I spefically want to know how I can do a plug-in that lets me buy 2 more bays in a way that actually lets me buy 2 more bays in Nova.

Hey. I think the situation is simple: I shall try to explain, and please tell me if it's still unclear.

As you say, the availability test to buy a bay is "b989 & o520". This means "mission bit 989 must be set, and the player must have at least one of outfit id 520". I deduce from context that outfit id 520 is the Bay Token.

It seems that this is how Pace intended for bay tokens to work: You start with two bay tokens and zero bays. In order to buy a bay, you must have at least one bay token. When you buy a bay, you lose a bay token; when you sell a bay, you gain a bay token. (Thus, a player's (number of bay tokens) + (number of bays) should always be 2.) This is implemented by putting "o520" in the Availability test of all bay outfits, "d520" in the "When purchased" field, and "g520" in the "When sold" field of all bay outfits.

Now, let's explain your situation. I believe you had bought two bays before messing around with any plugins; therefore, you have two bays and zero bay tokens. Now, what you put in the "When Purchased" field of the bay outfit is only an effect that would happen after you bought a bay--so, since you still have zero bay tokens, you still won't be able to buy the bay, and it won't make a difference.

So. What can you do? Well, Pace's recommendation is to put "g520" into some field that you can activate easily: this will give you another bay token. For example, you could put g520 into the "When purchased" field of a light blaster, and then buy and sell a light blaster twice; then you would be able to get a total of four bays. I think developers, when they want to execute arbitrary Nova bit-expressions, tend to make an auto-aborting mission from the Mission BBS that is available everywhere, and put the expression into the onAccept field.

Or, if you want, you could turn the onPurchase field of that Akarui Bay outfit (509) back into "d520 g509 g520", and then sell and then buy that bay; you would gain a token by selling it (assuming the onSell field does indeed contain g520), and then, when buying it, you'd end up still having a token. (Then you could buy a third bay, and still have a token, and buy a fourth bay, and still have a token. Then if you sold all the bays, you'd have five tokens, which you could use to buy five other bays.)

All clear? đŸ˜‰

I understood everything. Unfortunately, you did not give me actual instructions. Insructions that tell me everything I need to know to actually be able to buy four bays.

I could try though what you already gave me:

For example, you could put g520 into the "When purchased" field of a light blaster, and then buy and sell a light blaster twice; then you would be able to get a total of four bays.

That I think I will try first.

About this part: I think developers, when they want to execute arbitrary Nova bit-expressions, tend to make an auto-aborting mission from the Mission BBS that is available everywhere, and put the expression into the onAccept field.

The mission is made auto-aborting by clicking a checkbox in the misn resource that says the mission auto-aborts, right?

Why would I want to do this - the auto-aborting mission thing - when I could put g520 in a Light Blasters When Purchased field? Because I could then try buying one more bay?

The second method is not as clear. You say: "Or, if you want, you could turn the onPurchase field of that Akarui Bay outfit (509) back into "d520 g509 g520", and then sell and then buy that bay; you would gain a token by selling it (assuming the onSell field does indeed contain g520), and then, when buying it, you'd end up still having a token. (Then you could buy a third bay, and still have a token, and buy a fourth bay, and still have a token. Then if you sold all the bays, you'd have five tokens, which you could use to buy five other bays.)"

So I sell and buy the Akarui Bay (509), but I would only get one token from that. I actually need to have four bays. Does this mean I mean I would have to sell both of my bays and then buy the bay four times?

Yes, the onsell field does indeed contain g520.

The rest is not clear. It begins with this part: "Or, if you want, you could turn the onPurchase field of that Akarui Bay outfit (509) back into "d520 g509 g520", and then sell and then buy that bay; you would gain a token by selling it (assuming the onSell field does indeed contain g520), and then, when buying it, you'd end up still having a token.

How can I still have have a token after buying a bay?

You say I could buy a fourth bay and still have a token. How can I have the two tokens required to buy four bays if I buy two more bays? Buying bays causes you to lose tokens.

@general-cade-smart, on 02 October 2013 - 11:42 AM, said in How do I make a plug-in that lets me buy 4 bays in Arpia 2?:

I understood everything. Unfortunately, you did not give me actual instructions. Insructions that tell me everything I need to know to actually be able to buy four bays.

I could try though what you already gave me:

For example, you could put g520 into the "When purchased" field of a light blaster, and then buy and sell a light blaster twice; then you would be able to get a total of four bays.

That I think I will try first.

Sorry about that. The light-blaster approach should work fine. The other methods I suggested are more like mental exercises than useful advice. So, for a list of instructions:

1. Find the Light Blaster resource. This resource should probably be found in Nova Data 4 from Nova Files, which appears to contain all of Nova's outfit resources. To find Nova Data 4: At least on the Mac, MissionComputer's "File" dialog menu contains an "Open Special" option, which I believe will find Nova Files for you directly. On Windows, I believe the Nova Files folder is in the same folder as the EV Nova executable.
2. Make a new plug-in, and copy and paste the Light Blaster resource into it using MissionComputer.
3. In the new plug-in, put "g520" in the "When Purchased" field of the light blaster.
4. Save the plug-in in the plug-ins folder.
5. Open EV Nova, and buy and sell a light blaster twice. You should now have two more bay tokens and be able to buy two more bays.

(As it happens, Arpia itself doesn't provide a light blaster resource, which is why you have to get it from Nova Files.)

General Cade Smart said:

About this part:

scavenger said:

I think developers, when they want to execute arbitrary Nova bit-expressions, tend to make an auto-aborting mission from the Mission BBS that is available everywhere, and put the expression into the onAccept field.

The mission is made auto-aborting by clicking a checkbox in the misn resource that says the mission auto-aborts, right?

Why would I want to do this - the auto-aborting mission thing - when I could put g520 in a Light Blasters When Purchased field? Because I could then try buying one more bay?

Yes, that's right. Why would you want to do this? Well, I can imagine situations where it would be inconvenient to buy and sell a light blaster: you could be on a planet without an outfitter, or all your gun slots are full and you don't want to sell your expensive guns and buy them back and lose half their price, or you could have a Vell-os ship and can't buy weapons, or something. Having an auto-aborting mission in the BBS is somewhat more versatile. However, it is also more complicated to set up. So if buying and selling a light blaster is easy, then take that approach.

Disregard the stuff about turning the OnPurchase field back into "d520 g509 g520". It's playing around with a needlessly complex hypothetical situation.

All right, I tried your instructions.

You tell me that I should copy and paste the Light Blaster resource. But you don't tell me if I should copy and paste the Light Blaster outfit or the Light Blaster weapon. I assume you mean the outfit, because you wrote: ...which appears to contain all Nova's outfit resources. Or perbaps I need to copy both?

So I copied the outfit of the Light Blaster into a new plug-in, and followed your instructions. Meaning I did everything exactly as you said.

I tried to buy a Light Blaster... but the Light Blaster disappeared after I pressed Buy. It reappeared in a lower place on the list of outfits. I bought it again. The Sell button was still grey.

It seems I never actually bought the Light Blaster because I don't have the number 1 next to the outfit picture of the Light Blaster.

I can, however, buy and sell a Medium Blaster just fine. I don't remember the part about buying, but I know the Sell button was pressable with the Medium Blaster so I have bought it.

What is wrong? I have never seen any outfit that can't actually be bought before. Aka, does not come with 1 above the picture of the outfit. And can also not be sold, only bought...

What do I need to do now? I would actually like instructions even more than before, because this is probably more complicated to fix than it's complicated to just make a Light Blaster have a g520.

Is the problem I never copied the Light Blaster weapon resource into my plug-in?

@general-cade-smart, on 23 October 2013 - 08:05 AM, said in How do I make a plug-in that lets me buy 4 bays in Arpia 2?:

You tell me that I should copy and paste the Light Blaster resource. But you don't tell me if I should copy and paste the Light Blaster outfit or the Light Blaster weapon. I assume you mean the outfit

That is correct.

Quote

So I copied the outfit of the Light Blaster into a new plug-in, and followed your instructions. Meaning I did everything exactly as you said.

I tried to buy a Light Blaster... but the Light Blaster disappeared after I pressed Buy. It reappeared in a lower place on the list of outfits. I bought it again. The Sell button was still grey.

It seems I never actually bought the Light Blaster because I don't have the number 1 next to the outfit picture of the Light Blaster.

Hmm, I see. That is an unanticipated consequence. (I haven't actually used outfits to deliberately execute Nova bit-expressions before.) I have duplicated the results on my own computer. Sorry about that; that must look rather weird. Let's see.

First, it appears that, on outfit id NNN, a blank OnPurchase field is treated as equivalent to "gNNN", and if you put anything in the OnPurchase field, then there is no longer any implicit "gNNN". I expected otherwise; I expected that buying the outfit would both execute the OnPurchase field and give you the outfit, always. I must now update my understanding.

Anyway, the result is that your light-blaster plugin causes purchasing a light blaster to execute g520 and not give you a light blaster, rather than executing g520 and giving you a light blaster.

(The fact that it also changes the order of the outfits seems rather surprising to me, but harmless. I suppose maybe Nova has some ordering algorithm that puts more complicated outfits--with non-empty OnPurchase fields meaning "complicated"--later.)

Since you've purchased a light blaster twice, you should now have two more bay tokens than you did before. You can remove the light blaster plugin now. (Although it wouldn't hurt to leave it in, unless you actually want to buy a light blaster.) Meanwhile, you should currently be able to buy a total of four bays.

Thanks! I was now able to buy a new bay. A third one.

However, I still can't buy a fourth one because I only had 55 tons of free mass.

I now have now 0 tons of free mass.

I can't sell anything either - I already sold ALL my weapons to make space for two bays.

Now I either need to cheat to buy a fourth bay or use the Hogun Cheat plug-in I once got.

I wanted a fourth bay because it's with 16 fighters I destroyed the Uhgnsys (or however they are spelled?).

I am not sure I can destroy the Uhgnsys with only 12 fighters.

Well, I'll try that first.

Then I will try the Hogun Cheat plug-in, which makes the alien figters weaker.

Then I will simply make a plug-in a to make the Uhngsys possible to fight. Amongst others - and the most important - I will change the weapon they have to not do 140 damage per shot. More like 2 per shot.

I do not tolerate missions that are impossible to complete with normal means. Normal means means possible by using primary and secondary weapons. As far as I know, the Uhngsys cannot be won with those. You - any of the persons that posts on the EV Developers Corner are welcome to prove me otherwise. For example, are Hellhound Missiles good enough to destroy them?`

Again, thanks for helping me how to make a plug-in that lets me buy one more bay.

I believe I have a saved starter file before any significant plot where I captured Pace's Sylvatha, so I never had to worry about that mission very much, but I do predominantly play all three lines normally, and I have completed that mission on all three branches. I just don't remember how.

The only one I remember is the Regular line, which did in fact involve copious amounts of HH missiles, TH Lances, and a lot of fancy flying.