[GUIDE]Contribute/Require/ScanMask (ZP strikes again!)

How to use the Contribute/Require fields and the ScanMask fields?

These fields allow for interesting and complex behavior, that wasn't possible before Nova. The ScanMask fields allow you to to make some governments consider some mission cargo and "jünk" cargo, as well as outfits, as illegal, while some governments may not, but may consider some other cargo or outfit (that the first government doesn't consider illegal) as illegal. The Contribute/Require fields allow you to make a number of things (possibility to buy outfits/land on planets/have some events activated/have a mission be offered/etc...) depend dynamically on the stuff the player owns/the ship the player is fying/the running events/etc..., in a more dynamic and flexible way than by the use of mission bits. But they have in common that they are quite abstract and thus difficult to grasp. Firstly the simpler ScanMask will be introduced, then the bigger Contribute/Require.

I: ScanMask

The Bible describes this as a 16-bit hexadecimal flag field, but just like the other flags it is probably impemented as 16 checkboxes in your editor (each checkbox being one bit). But they don't have any label, or a minimal label. No one of these checkboxes seems to have any meaning. It's because they don't have any built-in meaning: just like the mission bits, they only have the meaning you give them. To better understand, see how they work. Let's say one pilot transports some jünk cargo or some mission cargo or has some outfit that has one or more ScanMask bit(s) set (i.e. one or more checkbox checked). Then comes a fighter (i.e. a ship in a düde with AI 4 (interceptor), the other AI types will not bother scanning you) from a certain government. If the fighter scans the pilot, and succeeds in scanning the ship (it doesn't succeed at detecting the illegal stuff every time), he will consider the cargo or the outfit the pilot is carrying as illegal if and only if there is a common bit checked in the jünk (or mïsn or oütf) ScanMask and the gövt ScanMask (for instance if the fourth ScanMask bit is checked for both). Each ScanMask bit can therefore be considered as a reason for a cargo/outfit to be considered illegal; in the cargo/outf side of the ScanMask each bit set tells that the cargo/outfit has the corresponding reason to be considered illegal, while on the government side each bit set tells that the government in question will care about the corresponding reason for the cargo/outfit to be considered illegal (and not care about the reasons corresponding to the unset bits). Notice that if you leave all bits unchecked, either the cargo or outfit will not be considered illegal by anyone, or the government will not consider anything illegal.

Let's introduce an example. You want some mission cargo, named "Nuclear Fuel", to be considered illegal by some government, named "Greens". To that end, set the first, most significant, ScanMask bit in both the mïsn resource (of the mission that makes the pilot transport the nuclear waste) and the gövt resource (of the "Green" government). This meaning can now be given to that bit: "radioactive". When put in the ScanMask field of a jünk or a mïsn resource, it means that the considered cargo is radioactive; when put in the ScanMask field of a gövt resource, it means that the government considers radioactive cargo illegal.
Now you can set that bit for other governments or cargo as well. Let's say the next mission makes the pilot transport back cargo named "Nuclear Waste", and that you want the government "Green" to consider this cargo illegal as well. You just need to set the first ScanMask bit in the mïsn resource of the second mission as well, and the government "Green" will once again bother the player about that cargo he's ferrying. Now let's put a third mission, that will make the pilot transport cargo named "Nuclear Weapons". The government "Green" will (obviously) still consider that cargo illegal, but this time we want another government, named "UN", that did not consider the other cargos illegal, to consider the "Nuclear Weapons" cargo illegal. To that end, you set the second bit of the ScanMask field of the "UN" gövt, but not the first one (or the UN would consider non-military radioactive material illegal as well, which it doesn't, and you don't want it to). Then you set the first bit of the ScanMask field of the third mïsn resource so that the "Greens" consider it illegal, and you set the second one as well, so that the Government "UN" can consider it illegal; you can give to the second bit the meaning "prohibited by a UN resolution". A cargo having that bit is prohibited by a UN resolution, while a government having it set "considers cargo prohibited by a UN resolution illegal" (or in short, "enforces UN resolutions"). You can also make some other cargo, let's say "Ivory", just have the second ScanMask bit set, i.e. its trade is just prohibited by a UN resolution, but it's not radioactive, and only the UN will bother you with it (where are the Greens when they are actually needed?* :)).

However, there are things you cannot do. If you want some government to care only about cargo that is both radioactive and prohibited by a UN resolution, you can't do so directly. Indeed, if you set both the first and second bit in the ScankMask field of this new government, it will care about cargo that is just radioactive and cargo that is just prohibited by the UN on top of cargo that is both. You need to introduce a third bit (that can be given the meaning "military nuclear material") that will tell the cargo is both radioactive and prohibited, and the third government will have only this third bit checked. Also, you can't have a government not care if someone transport one kind of cargo (say explosives) alone, not care either for some other kind of cargo (say stuff capable of triggering explosions) carried alone, but care if both are carried at once. There is no known workaround for this.

Notice that, if you're making a TC (actually, if you try to apply the previous example out of the box to a plug for the default scenario, the Feds will consider radioactive cargo to be illegal as well! You'd better use almost unused ScanMask bits, or adapt to already present ones), and have a limited (i.e. ≤ 16) number of "significant" governments (i.e. governments that are existant enough to consider cargo/outfit illegal and have their own particular set of illegal cargo/outfits), you can attribute each a ScanMask bit, give the ScanMask bit the meaning "considered illegal by government x (and the similar ones)", and have each gövt resource have just his ScanMask bit set and no other; a system very close is actually the one implemented in the default scenario, just check the significant gövt resources in Nova Data 1. This sadly makes for no unused ScanMask bit, which makes putting a whole new one to use in a plug-in impossible, you'll have to put an existing one to use and check if it makes sense (or that it does not significantly interfere). However, if you're making a TC, you're free to use all 16 of them as you desire.

II: Contribute/Require

Firstly, you'll notice these are bigger: the Bible describes them as two 32-bit flag fields each, making 64 bits in total (64-bit hex fields do not exist in ResEdit), so there are probably 64 checkboxes in your editor; there is obviously more room for people to play with than with ScanMask. Also, just like ScanMask has actually two sides (the enforcing government side in gövt resources and the suspected stuff side in the mïsn, jünk and oütf resources), there is a Contribute side for stuff that allows and a Require side for stuff that needs some stuff that allows; contrary to ScanMask, the two sides have different names as some resources (such as oütf) have both Contribute and Require fields.
The again, none of the 64 bits has a built-in meaning, just the ones you give them. The principle is different than with ScanMask however. Suppose there is an outfit, that has one (or more) Require bit set. If all the other conditions are met (there is enough free mass in the ship, the ncb test expression in the "Availability" evaluates to true, there is one gun or turret slot free if necessary, the pilot hasn't already the max number if it, and pilot has enough money), the pilot will be able to buy the outfit if and only if the corresponding bit(s) are set at least once in the Contribute fields of the stuff he currently owns. The stuff the pilot owns is made of the ship the pilot is flying, the outfits it is equipped with, his currently active ranks, and the currently running cron events (not exactly stuff the player owns, but hey, you get the idea), which all have Contribute fields. Notice that the Contribute bits for all the stuff the player owns are combined, they all contribute together (hence contribute), for instance if an outfit has the first and second require bit set in its Require fields, and the pilot has a ship that has the first bit set in its Contribute fields, and a rank that has the second bit set in its Contribute fields, then the pilot will be able to buy the outfit. Each Contribute/Require bit can thus be considered a particular permission. Each bit set in a Contribute field tells that, with the object in question active, the pilot has the considered permission, while each bit set in a Require field tells that, in order to be able to do something (told in the Bible description), the pilot has to have the permission corresponding to that bit, and if there is more than one set, the pilot needs to meet them all (and not just one of them, contrary to the ScanMask where one is enough for illegality). If you leave all Require bits unset, then the thing in question will require no permission, and if you leave all Contribute bits unset, then the thing in question will not provide any permission for stuff that may require some.

This is obviously more complicated than ScanMask. Let's introduce an example once again. Say you want to make some hand gun*, the Smith&Wesson; model B, only available with a permit from the government that the pilot needs to buy. To that end, set the first bit in the Require field of the "Smith&Wesson; model B" outfit, and make an outfit, named "buyable basic gun permit", that has the first bit set in its Contribute field. That bit can now be given the meaning "basic gun permit"; when in a Contribute field, it means "when active the resource grants the basic gun permit", while in a Require bit, it means "in order to make the thing specified, the pilot needs to have a basic gun permit". Notice the thing specified needs to be checked in the Bible, for instance the Require field in the gövt resource needs to be met for the pilot to be able to land on any planet, station or moon belonging to the government ("the Require field (or bits) are met" means that the corresponding bits are checked at least once in the Contribute fields of the stuff the pilot owns, but a shorter way!). Notice the "basic gun permit" needs not be granted only by the "buyable basic gun permit" outfit: say you have some criminal organisation that makes fake basic gun permit cards, fooling gun shops that you have the basic gun permit, and sells them for much less than the buyable ones cost. As far as the game is concerned, it's as if you had the basic gun permit (but this fake one can have drawbacks, such as being illegal via ScanMask...), so this fake permit outfit should have the first Contribute bit set as well. We can even imagine that a ship company decides some commercial offer on one of its ships "the basic gun permit comes free with this ship!" (actually it's included in the ship price, but I digress...). To that end, you just need to set the first Contribute bit of the shïp resource, and it will allow the pilot to buy basic guns with its ship acting as the permit. You can make some other guns that require the basic gun permit as well. Notice that, depending on the flags of the guns outfits, they may be shown of not when the pilot has not the permit yet. It's considered bad behavior to hide stuff that people could buy but just need a permit before doing so (no one wants to buy the permits just to check the stuff they allow!). Also, notice that the engine does not warn people of the reason they can't buy an outfit that's shown, other than "can't have" and "can't hold", so you need to tell it in the description of the outfit just like is done in the default scenario ("Requires: Heavy Weapons License", for instance).

Now, imagine you decide to introduce some other gun, a big gun such as a rifle, that requires the pilot to have a more advanced permit, that is not just sold: the pilot has to sign up to a governmental safety course (that he pays) so that it can be checked he can safely own the big gun. Technically, it can be easily implemented by a "start course" outfit that costs the price of the course, and that uses an ncb operator to start the course mission, that grants the advanced permit outfit on completion (what to put in the mission is up to you). Then this advanced gun permit outfit, that isn't sold in outfitters, has its second Contribute bit checked, and the big gun outfit has its second Require bit set. Notice that if you wish the advanced gun permit to allow for basic guns as well, you should check the first Contribute bit of the advanced gun permit outfit. The same way as above, you can decide to include a fake advanced gun outfit sold by some shady guy; it should then have its second Contribute bit set as well for the desired effect. You can also introduce other big guns that also require the advanced gun permit.

You can introduce some more advanced behavior. Say for instance you want to reserve the advanced gun course to people who already own the basic gun permit. You can do so by setting the first Require bit of the start course outfit; it won't work if you do so for the course mïsn nor the permit outfit as missions started by ncb operators and stuff granted by missions are given regardless of requirements. Also, outfits can both contribute and require: for instance, you may want to make a mission, "Join the NRA (National Rifle Association)" available only if the pilot currently owns a gun. You can do so by having all guns set the third Contribute bit (i.e. have the third bit set in their Contribute field), and the joining mission have its third Require bit set. You can also decide that, if he's a police officier, the pilot does not need to buy a basic gun permit, he will have it as long as he's an officier. To that end, you can set the first Contribute bit of the "fed police officier" ränk, and as long as the ränk is active, the pilot will automatically be permitted to buy basic guns.

However, there are some things Contribute/Require bits can't do or aren't best suited to do. Indeed, it should be remembered they are best suited for dynamic contributing. Let us say you want the advanced gun permit not be allowed for people who have ever been sentenced for a crime in the past. It's a very bad idea to attempt to use Contribute/Require for that, for two reasons. Firstly, this is not a dynamic condition, once you have been sentenced, there is no coming back to a never-been-sentenced situation; therefore, it is a way better job for the event-driven Nova Control Bits, that when changed by an event (say being sentenced for a crime) remain to their state unless changed again. Second, you can't have something uncontribute or remove a contribution; as the name contribute implies all contributions are added and something that does not contribute cannot prevent other things from contributing. Then again, it's a way better job for an NCB, that can be checked NOT to have ever been set for something to be allowed. Therefore, to achieve the desired effect, it's best to have any crime sentence set some ncb, say b6743, and have the start course outfit have !b6743 in its Availability field, thus being offered only if that bit has NOT been ever set.

There is an exception to the second reason not to use Contribute/Require, though. If you want that some ships cannot be equipped with some outfits, you can do so negatively, i.e. all other ships will contribute a certain bit, while the ships that can't be equipped with the outfits will not contribute that bit, and some outfits will require that bit; contrary to outfits, it works with ships as you always have one and only one ship at the same time. This is actually the way implemented in the default scenario to prevent Vell-os ships from being equipped with most outfits (that just don't fit with a mental projection): all ships save from Vell-os ones contribute the last bit while the Vell-os ships don't, and almost all outfits require that last bit (which can be considered to have the meaning "the owned ship is a physical, hard one"). This has an important consequence: if you're doing a whole new ship from scratch, you will need to set its last contribute field, unless you want it to be a mental projection that cannot be equipped with anything as well. Contribute/Require is also used in the default scenario for the Federation licenses: each kind of license, including its fake copies, contributes a certain bit, while outfits that require a license have the corresponding bit required, more than one if the outfit requires multiple licenses (on top of the aforementioned last require bit). As there are 64 Contribute/Require bits, some are not in use in the default Nova scenario, and you can freely put them to use. If you're making a TC, all 64 are yours to use.

Any comments? By the way, if you're still bored, orca, you are more than welcome to HTML-ise this one as well.

*Disclaimer: I did not intend this to be so political; the examples above have been the first I thought of, and I beleived to change them afterwards. But because I built the actual things to make around them, and as they are actually quite easy to understand, they have been kept. Especially for the guns thing, I may be inaccurate. If you happen to disagree with me, that's fine, but if you wish to voice it, please take it to Just Chat. Thank you.

------------------
The (url="http://"https://secure.ambrosiasw.com/cgi-bin/store/hazel.cgi?action=serve&item;=breakdown.html&BREAKDOWN;_SKUID=1480")Ambrosia Mac CD(/url) with other registrations - 5$. Paying for (url="http://"http://www.ambrosiasw.com/games/evn/")EV Nova(/url) as it's such a great game - 30$.
The (url="http://"http://www.ambrosiasw.com/games/evn/tshirts.html")1337 EV Nova T-shirt(/url)(url="http://"http://www.ambrosiasw.com/webboard/Forum25/HTML/000003.html#ZachaPedro05-18-200409:42AM") (/url) - 22$. The (url="http://"http://w00tware.ev-nova.net/")NovaTools(/url) by wOOtWare to tinker with your Nova - FREE!
The feeling you're a Nova geek - priceless.
There are things money can't buy or that are free, for everything else, there's indeed Mastercard.

Thumbs up, Zacha Pedro. That's a very clear guide to those fields. I must admit I didn't quite understand them before (and it took me a while to understand why the ships I created couldn't buy any other outfits in fact, it took me a whole afternoon if I remember well), and I only vaguely had a notion of what they do. But now, it's all crystal clear.
Very well explained, good illustrative examples, and I like the "however"s ;).

Thanks, I'm sure it's going to help many people.

Once again, thumbs up.

------------------
Pace
(haldora)
-- Cartman: I hate hippies! I mean, the way they always talk about "protectin' the earth" and then drive around in cars that get poor gas mileage and wear those stupid bracelets - I hate 'em! I wanna kick 'em in the nuts!

Was someone compiling all of these guides somewhere? I want to link to them (eventually when I have it done) on my TCs website.

------------------
Drinking causes hangovers.
(url="http://"http://www.freewebs.com/rmx256/index.htm")Kemet T.C. Website(/url)

I was, at (url="http://"http://www.evula.org/infernostudios/plugdev/")http://www.evula.org...tudios/plugdev/(/url) .

Nice work, again, ZP. BTW, I got the BFD up (url="http://"http://www.evula.org/infernostudios/plugdev/guides/bfd.php")here(/url) a while ago. I hadn't linked it yet... Oops. 😉

I'll get this one redone in php and post it as well.

~ SpacePirate

------------------
Fear the SpacePirate,
He made a (url="http://"http://www.evula.org/infernostudios/search.html")plug-in search page(/url)...
And he'll board your ship!
-mrxak
*** (url="http://"http://www.evula.org/infernostudios/")InfernoStudios(/url) was last updated 06 June, 2004. ***

(This message has been edited by SpacePirate (edited 07-26-2004).)

So you decided to make it PHP? What was the point of giving me the SSI option? 😛

Be careful to make sure that any corrections you make sound mostly consistent with the many, many, many, many, many I made (did I mention "many"? :)), or it may sound choppy.

------------------
The programmer's code of entomology: there's always another bug.
There are 10 types of people in the world: those who understand binary and those who have friends.
Windows users: stop asking for plugins. (url="http://"http://www.aznt.com/EVN/EVNEW/")Make one yourself.(/url)
(url="http://"http://www.cwssoftware.com")Sephil Saga Website(/url) | (url="http://"http://www.evula.org/infernostudios/search.html")Add-ons Search Engine(/url)

Heh. SSI doesn't allow relative linking to the extent I wanted. So I changed it up.

------------------
Fear the SpacePirate,
He made a (url="http://"http://www.evula.org/infernostudios/search.html")plug-in search page(/url)...
And he'll board your ship!
-mrxak
*** (url="http://"http://www.evula.org/infernostudios/")InfernoStudios(/url) was last updated 06 June, 2004. ***

Quote

Originally posted by Zacha Pedro:
**As there are 64 Contribute/Require bits, some are not in use in the default Nova scenario, and you can freely put them to use. If you're making a TC, all 64 are yours to use.
**

Is there a list of used bits somewhere? I couldn't find one... it would probably be helpful to include such a list if it exists.....

Interesting question, I attempted to determine it myself, but it seemed too big a task. Maybe using ConText and a spreadsheet... hmm... (ZP goes to try).

------------------
The (url="http://"https://secure.ambrosiasw.com/cgi-bin/store/hazel.cgi?action=serve&item;=breakdown.html&BREAKDOWN;_SKUID=1480")Ambrosia Mac CD(/url) with other registrations - 5$. Paying for (url="http://"http://www.ambrosiasw.com/games/evn/")EV Nova(/url) as it's such a great game - 30$.
The (url="http://"http://www.ambrosiasw.com/games/evn/tshirts.html")1337 EV Nova T-shirt(/url)(url="http://"http://www.ambrosiasw.com/webboard/Forum25/HTML/000003.html#ZachaPedro05-18-200409:42AM") (/url) - 22$. The (url="http://"http://w00tware.ev-nova.net/")NovaTools(/url) by wOOtWare to tinker with your Nova - FREE!
The feeling you're a Nova geek - priceless.
There are things money can't buy or that are free, for everything else, there's indeed Mastercard.

Quote

Originally posted by brindyblitz:
Is there a list of used bits somewhere? I couldn't find one... it would probably be helpful to include such a list if it exists.....

It's on my list to write an application to scan through the resources and write up where the used bits were found, and of course, which bits are used, and free.

~ SP

------------------
Fear the SpacePirate,
He made a (url="http://"http://www.evula.org/infernostudios/search.html")plug-in search page(/url)...
And he'll board your ship!
-mrxak
*** (url="http://"http://www.evula.org/infernostudios/")InfernoStudios(/url) was last updated 06 June, 2004. ***

FYI, I'm still trying to get AppleWorks' spreadsheet to compute the unused Contrib/Require bits; there is a nice C function, bitwise OR, that would allow me to go faster, but that doesn't exist in a mostly financial program, and I have to convert from hex to decimal, then decimal to binary, then convert to 32 true/false values, on which I can at last apply a massive OR... and I'm not done yet (plus, there are errors when fields use the most significant bit (first hex number is ≥8)!).

By the way, thanks for your "newb" feedback, Pace, that's what most important for such guides but is alas difficult to obtain. Notice that the simpler ScanMask is useful for introducing some concepts that will then be required by Contrib/Req (and thus makes understanding the latter easier, since there is less to understand at once).

------------------
The (url="http://"https://secure.ambrosiasw.com/cgi-bin/store/hazel.cgi?action=serve&item;=breakdown.html&BREAKDOWN;_SKUID=1480")Ambrosia Mac CD(/url) with other registrations - 5$. Paying for (url="http://"http://www.ambrosiasw.com/games/evn/")EV Nova(/url) as it's such a great game - 30$.
The (url="http://"http://www.ambrosiasw.com/games/evn/tshirts.html")1337 EV Nova T-shirt(/url)(url="http://"http://www.ambrosiasw.com/webboard/Forum25/HTML/000003.html#ZachaPedro05-18-200409:42AM") (/url) - 22$. The (url="http://"http://w00tware.ev-nova.net/")NovaTools(/url) by wOOtWare to tinker with your Nova - FREE!
The feeling you're a Nova geek - priceless.
There are things money can't buy or that are free, for everything else, there's indeed Mastercard.

Quote

Originally posted by SpacePirate:
Heh. SSI doesn't allow relative linking to the extent I wanted. So I changed it up.

How so? I never have any problems with simple includes...

------------------
(url="http://"http://www.evula.com/")EVula,(/url) your friendly (url="http://"http://www.evula.com/")self-promoting(/url) EV & EVO Boards/Newswire/Chronicles moderator
(url="http://"http://www.evula.com/")com(/url) | (url="http://"http://www.evula.net/")net(/url) | (url="http://"http://www.evula.org/")org(/url) | (url="http://"http://www.ev-nova.net/")evn(/url) // (url="http://"http://forums.evula.com/")forums(/url) | (url="http://"http://store.evula.com/")store(/url) | (url="http://"http://blog.evula.net/")blog(/url)
(url="http://"http://pftn.evula.net")pftn(/url) | (url="http://"http://dreamwave.evula.net")dreamwave(/url) | (url="http://"http://davidarthur.evula.net")davidarthur(/url) | (url="http://"http://ucplugs.evula.net")ucplugs(/url) | (url="http://"http://stark.evula.net")stark(/url)

Quote

Originally posted by EVula:
**How so? I never have any problems with simple includes...

**

Well, using ../ to refer to the previous directory doesn't work at all. I'm sure there's an SSI equivalent, but it does work in php.

Also, about SSI not working in php files, thus making <!--#exec cgi="/cgi-bin/banner.cgi"--> not working in php files, using <?php virtual("/cgi-bin/banner.cgi") ?> achieves the same effect. I hope you don't mind if I'm doing that...

------------------
Fear the SpacePirate,
He made a (url="http://"http://www.evula.org/infernostudios/search.html")plug-in search page(/url)...
And he'll board your ship!
-mrxak
*** (url="http://"http://www.evula.org/infernostudios/")InfernoStudios(/url) was last updated 06 June, 2004. ***

(This message has been edited by SpacePirate (edited 07-27-2004).)

Are you crazy? You're using exec? exec won't work for /, if I recall correctly. Use <!--#include virtual="/cgi-bin/banner.cgi"-->, which is probably the same as the virtual() function in PHP. Do remember to make sure that the script outputs "Document-type: document-type/browser-parse-typenn" (where document-type and browser-parse-type are the type of document, such as text or image, and how the browser should parse and display the document, respectively) headers, though.

------------------
The programmer's code of entomology: there's always another bug.
There are 10 types of people in the world: those who understand binary and those who have friends.
Windows users: stop asking for plugins. (url="http://"http://www.aznt.com/EVN/EVNEW/")Make one yourself.(/url)
(url="http://"http://www.cwssoftware.com")Sephil Saga Website(/url) | (url="http://"http://www.evula.org/infernostudios/search.html")Add-ons Search Engine(/url)

(This message has been edited by orcaloverbri9 (edited 07-27-2004).)

Quote

Originally posted by orcaloverbri9:
Are you crazy? You're using exec? exec won't work for /, if I recall correctly. Use <!--#include virtual="/cgi-bin/banner.cgi"-->, which is probably the same as the virtual() function in PHP.

Yeah, I used virtual includes. Works like a charm.

------------------
(url="http://"http://www.evula.com/")EVula,(/url) your friendly (url="http://"http://www.evula.com/")self-promoting(/url) EV & EVO Boards/Newswire/Chronicles moderator
(url="http://"http://www.evula.com/")com(/url) | (url="http://"http://www.evula.net/")net(/url) | (url="http://"http://www.evula.org/")org(/url) | (url="http://"http://www.ev-nova.net/")evn(/url) // (url="http://"http://forums.evula.com/")forums(/url) | (url="http://"http://store.evula.com/")store(/url) | (url="http://"http://blog.evula.net/")blog(/url)
(url="http://"http://pftn.evula.net")pftn(/url) | (url="http://"http://dreamwave.evula.net")dreamwave(/url) | (url="http://"http://davidarthur.evula.net")davidarthur(/url) | (url="http://"http://ucplugs.evula.net")ucplugs(/url) | (url="http://"http://stark.evula.net")stark(/url)

Quote

Originally posted by orcaloverbri9:
**Are you crazy? You're using exec? exec won't work for /, if I recall correctly. Use <!--#include virtual="/cgi-bin/banner.cgi"-->, which is probably the same as the virtual() function in PHP. Do remember to make sure that the script outputs "Document-type: document-type/browser-parse-typenn" (where document-type and browser-parse-type are the type of document, such as text or image, and how the browser should parse and display the document, respectively) headers, though.

**

Hey, now, that's what was on the Code page. 😉 It works flawlessly, so long as the page is not php. But using php, <?php virtual works fine.

~ SP

------------------
Fear the SpacePirate,
He made a (url="http://"http://www.evula.org/infernostudios/search.html")plug-in search page(/url)...
And he'll board your ship!
-mrxak
*** (url="http://"http://www.evula.org/infernostudios/")InfernoStudios(/url) was last updated 06 June, 2004. ***

There, it's done. It has been a hard work to obtain that the used Contribute/Require bits form the hex number 0x000003FFC0000071, that is, the 23rd to 34th, the 58th, 59th, 60th and 64th bits are in use. That's only 16 out of 64.

If you're interested by the way I obtained them, I first exported all the Nova Data Files to text using ConText, exporting only crön, gövt (actually, none of those two use any C/R bit, though they have C/R fields), mïsn, oütf, ränk and shïp. Then, I opened the tabbed text file as a speadsheet in AppleWorks. I erased everything but the contribute and require fields, and put 0x00000000es when there was not one of them (for instance missions only have require field, so I filled the two contribute columns with these 0es). Just next to these 4 columns (and 1534 lines!), I put 4 other columns that compute and hold the hex numbers just next converted to binary (three functions actually: cut the 0x at the beginning, convert the hex to decimal, and convert the decimal to binary as there is no function to do it directly). Then I saw that there were errors in some binary fields. They matched the hex fields in which there was 8 or more as the first digit (i.e. where the first binary digit should have been 1). I though for a second, then found the reason: it's probably that AppleWorks normally represents integers as signed 32-bits integers, and therefore if I ask it to convert something superior to 2^31 into an integer, it puts it as a floating point number, that it fails to convert back to binary. After thinking for a while, I ended up cutting the first three chars instead of the first two, which forced me to determine the status (i.e. used or not) of the first 4 bits of each field (therefore, the 1st, 2nd, 3rd, 4th, 33rd, 34rd, 35th, and 36th) by hand. Then I though about the best way to compute that mass of 28-bits binary numbers. I ended up making 2 × 28 columns to be filled with true or false; to convert from the binary number to 28 true or false values, I made that it extracts the nth char of the binary string, and check if it's equal to one. As I was at it, I ORed the the corresponding con/req bits. But when it came to massively copy that function, I had a problem as it was moving the reference cell! It's the normal (and good) behavior, and it was good in that case for copying to the down, but not at all for copying to the right! Plus, I needed to have the rank of the compared char increase. I ended up filling the 56 functions myself, with good help from copy/paste, then copy to the down (for 1543 lines!) automatically; it took a little time for AppleWorks to do. I had already taken the precaution to increase the memory (it's on OS9, I'm doing plug works on my OS9 iMac) of AppleWorks like mad, and to disactivate autocompute. So I told to compute. After one or two minutes, I had a massive true/false matrix. Then I just needed to fill the 1544th line with a function that ORed all that was above, and copy it to the right for 56 columns. And sum up the result as an hex for compacity.

By the way, AppleWorks's spreadsheet is somewhat buggy when it comes to its line and column labels, that can get corrupted easily (but are easy to refresh), is somewhat slow and prone to crashes (though they were clean as I have been able to cmd-alt-esc each time and relaunch it each time without problem). I hope it computes well, and that we can trust its results...

Tomorrow I may have corrections on what I posted, I've been busy lately and AppleWork work has eaten my free time.

------------------
The (url="http://"https://secure.ambrosiasw.com/cgi-bin/store/hazel.cgi?action=serve&item;=breakdown.html&BREAKDOWN;_SKUID=1480")Ambrosia Mac CD(/url) with other registrations - 5$. Paying for (url="http://"http://www.ambrosiasw.com/games/evn/")EV Nova(/url) as it's such a great game - 30$.
The (url="http://"http://www.ambrosiasw.com/games/evn/tshirts.html")1337 EV Nova T-shirt(/url)(url="http://"http://www.ambrosiasw.com/webboard/Forum25/HTML/000003.html#ZachaPedro05-18-200409:42AM") (/url) - 22$. The (url="http://"http://w00tware.ev-nova.net/")NovaTools(/url) by wOOtWare to tinker with your Nova - FREE!
The feeling you're a Nova geek - priceless.
There are things money can't buy or that are free, for everything else, there's indeed Mastercard.

After careful check of my guide, I just have this to add:

-after "(for instance if the fourth ScanMask bit is checked for both", add: "; the position is very important, it identifies the bit, so much so that I'll refer to the bits by their position in the future."

-before "If you're making a TC..." (at the end), put " The ones already in use are the 23rd to 34th, 58th to 60th and the last, 64th bit (ordered in order of significance, most significant bit first, with the first field considered most significant so coming first); never forget that many electrons have been harmed to bring you this information. Notice that, though crön and gövt have Contribute and/or Require fields, they are all blank for all cröns and gövts in the default scenario."

It's now good to ship. By the way, prepare a list of issues and newbie mistakes in plug deving as there will be a list of common problems in the testing/debugging/troubleshooting guide I'm now writing; soon I'll make a topic about it where I will ask you those you know.

------------------
The (url="http://"https://secure.ambrosiasw.com/cgi-bin/store/hazel.cgi?action=serve&item;=breakdown.html&BREAKDOWN;_SKUID=1480")Ambrosia Mac CD(/url) with other registrations - 5$. Paying for (url="http://"http://www.ambrosiasw.com/games/evn/")EV Nova(/url) as it's such a great game - 30$.
The (url="http://"http://www.ambrosiasw.com/games/evn/tshirts.html")1337 EV Nova T-shirt(/url)(url="http://"http://www.ambrosiasw.com/webboard/Forum25/HTML/000003.html#ZachaPedro05-18-200409:42AM") (/url) - 22$. The (url="http://"http://w00tware.ev-nova.net/")NovaTools(/url) by wOOtWare to tinker with your Nova - FREE!
The feeling you're a Nova geek - priceless.
There are things money can't buy or that are free, for everything else, there's indeed Mastercard.

A quick note to let you know that I probably won't have any Internet access for the next month, i.e. all August. Okay, I know it's already August for me, but not for you yet, so it still stands. However, I will have my computer with me with all my plugdev stuff, so I will remain restless, and you can expect a whole load of guides and annoted templates to be dumped on you september the first. But before that, I'm unlikely to post at all.

------------------
The (url="http://"https://secure.ambrosiasw.com/cgi-bin/store/hazel.cgi?action=serve&item;=breakdown.html&BREAKDOWN;_SKUID=1480")Ambrosia Mac CD(/url) with other registrations - 5$. Paying for (url="http://"http://www.ambrosiasw.com/games/evn/")EV Nova(/url) as it's such a great game - 30$.
The (url="http://"http://www.ambrosiasw.com/games/evn/tshirts.html")1337 EV Nova T-shirt(/url)(url="http://"http://www.ambrosiasw.com/webboard/Forum25/HTML/000003.html#ZachaPedro05-18-200409:42AM") (/url) - 22$. The (url="http://"http://w00tware.ev-nova.net/")NovaTools(/url) by wOOtWare to tinker with your Nova - FREE!
The feeling you're a Nova geek - priceless.
There are things money can't buy or that are free, for everything else, there's indeed Mastercard.