@ Arexack_Heretic:
That's a hell of a make-over you're proposing. Anyway, it seems to be a nice idea
, even if for me it means to waste half of what I put into Anarchies.oxp so far
. But perhaps we should have some more opinions before inventing a
completely new legal rating system?
I would however like to know whether you will go on with the development of this or I shall do it?
And there are some limitations, because we can't do
everything with a script while the engine still works like it used to work. Anyway, a lot of things
are doable by a script. I have to admit though that I'm a bit afraid of that becoming a monster-script (looking at the code you have posted above (which won't work as it is, see below)).
Anyway I like to share all my knowledge, so here are answers to some of your questions (in the order you posted them, without exactly quoting):
- Bribing the police: Scriptable by using a mission screen that pops up randomly when you dock with a main station (let's say d100 < 4): "A shady police officer approaches you, offering to clean your legal status if you pay him ..." You agree, and be clean. You refuse, and he increases your legal status to the max (see below) and launches you immediatly.
- Hacking your legal status in a 7LY radius: Possible, but would need a complete list of all planets in all galaxies that provides the information which planets are in 7LY radius: 2048 * condition (); do () within the buy-Multipass-script. Not impossible, but monstrous.
- Bounties only get upped when the police catch you scooping with your laser red-glowing: Not sure whether this is doable with the policeAIs. Remember: The "thanks for your help"-screen messages are not even sent by their AI, but seem to be hard-coded.
- Bountyhunters hunting the player: That shouldn't be too hard. I think it's basically the same as the BlackMonks hunting you, which is already scripted by LittleBear.
- Global and local reputation: Why should the local reputation in your current system be set to your global reputation anyway? If you in this way make them the same, what's the point in distinguishing them in the first place? No, your local reputation should influence your global reputation, but not the other way round. Next question: What's a "global reputation" good for at all?
- Rating the karma of a kill: Yes, that's the way: comparing the changes in kill_counter and credits_counter. (I somehow missed out on the kill_counter when scripting. That would have been a nice way to getting around the problem that also shooting a lot of asteroids increases your credits. Will implement that.)
- X_numbers: No, they don't work identical to mission_variables. That's why you have a special set of methods to set and influence them. They can
not be set with the set:-method or influenced by add: or subtract:. But you can store the intended change in a mission_variable and then set the X_number to the value of that variable. (see next point and script example below)
- Using variables as values: Yes, possible, I'm doing it all the time (also in the timer I posted in the BlackMonks-thread) and it's a very powerful tool. You have to put them in
square brackets though. (see script example below)
- legalStatus_number (explained that already in the A Pirates Joice-thread): Internally it is a counter that takes values from 0..255. 0=clean, 1..50=offender, 51..255=fugitive. Perhaps you can set it to values out of that range. I'm not sure how the engine handles that. So decrementing it by 1 won't do the job. In Anarchies it's decremented for each jump by 20 if you're above 120, by 10 if you're above 60, again by 10 if you're above 50 (with a small chance only, because that's the barrier between fugitive and offender) and handled the normal way by the engine (divided by 2) if you're below 51. That means that it'll take you an average of 25-or-so jumps to become clean if you start with full 255, compared to 8 jumps if the engine just divides by 2 without the OXP installed.
- Tagging by the police: That's done in their AIs, usually they increment the legalStatus_number by 7 or 15 or 64 or something like that. BTW fining is still something else. And what the engine does here is: If you are fined by the police and then dock and pay the fine you're made clear again. And you cannot choose
not to pay the fine.
And now for some code: These are the relevant parts of Anarchies.oxp.
The first one transfers legalStatus_number into the mission_legal_status variable before each jump, computes it after the jump and returns it to legalStatus_number:
Code: Select all
{
conditions = (
"status_string equal STATUS_ENTERING_WITCHSPACE",
"planet_number greaterthan -1"
);
do = (
"set: mission_legal_status [legalStatus_number]"
);
},
{
conditions = (
"status_string equal STATUS_EXITING_WITCHSPACE",
"planet_number greaterthan -1",
"mission_legal_status lessthan 51"
);
do = (
"set: mission_legal_status [legalStatus_number]"
);
},
{
conditions = (
"status_string equal STATUS_EXITING_WITCHSPACE",
"planet_number greaterthan -1",
"mission_legal_status greaterthan 50",
"mission_legal_status lessthan 61"
);
do = (
{
conditions = (
"d100_number greaterthan 92"
);
do = (
"subtract: mission_legal_status 10",
);
},
"setLegalStatus: [mission_legal_status]"
);
},
{
conditions = (
"status_string equal STATUS_EXITING_WITCHSPACE",
"planet_number greaterthan -1",
"mission_legal_status greaterthan 60",
"mission_legal_status lessthan 121"
);
do = (
"subtract: mission_legal_status 10",
"setLegalStatus: [mission_legal_status]"
);
},
{
conditions = (
"status_string equal STATUS_EXITING_WITCHSPACE",
"planet_number greaterthan -1",
"mission_legal_status greaterthan 120"
);
do = (
"subtract: mission_legal_status 20",
"setLegalStatus: [mission_legal_status]"
);
},
This one rewards you for killing ships with bounties on them (cross-check with kill_count not yet implemented). Initially credits_number is stored in mission_legal_reward. If in the course of flight these two differ--indicating the player has been rewarded a bounty--his mission_legal_status is decreased. (local_legal_reward is used to get a positive difference instead of a negative one.) Depending on how big the bounty was mission_legal_status is decremented by 1, 2, 4, 7 or 20 and its value is returned to legalStatus_number. In the end mission_legal_reward is adjusted to the current credits_number:
Code: Select all
{
conditions = ("status_string equal STATUS_LAUNCHING");
do = ("set: mission_legal_reward [credits_number]");
},
{
conditions = ("status_string equal STATUS_IN_FLIGHT");
do = (
{
conditions = ("mission_legal_reward equal [credits_number]");
do = ();
else = (
"set: local_legal_reward [credits_number]",
"subtract: local_legal_reward [mission_legal_reward]",
{
conditions = ("local_legal_reward greaterthan 1999");
do = (
"subtract: mission_legal_status 20",
{
conditions = ("mission_legal_status lessthan 1");
do = ("set: mission_legal_status 0");
},
"setLegalStatus: [mission_legal_status]",
"reset: local_legal_reward"
);
},
{
conditions = ("local_legal_reward greaterthan 199");
do = (
"subtract: mission_legal_status 7",
{
conditions = ("mission_legal_status lessthan 1");
do = ("set: mission_legal_status 0");
},
"setLegalStatus: [mission_legal_status]",
"reset: local_legal_reward"
);
},
{
conditions = ("local_legal_reward greaterthan 51");
do = (
"subtract: mission_legal_status 4",
{
conditions = ("mission_legal_status lessthan 1");
do = ("set: mission_legal_status 0");
},
"setLegalStatus: [mission_legal_status]",
"reset: local_legal_reward"
);
},
{
conditions = ("local_legal_reward greaterthan 25");
do = (
"subtract: mission_legal_status 2",
{
conditions = ("mission_legal_status lessthan 1");
do = ("set: mission_legal_status 0");
},
"setLegalStatus: [mission_legal_status]",
"reset: local_legal_reward"
);
},
{
conditions = ("local_legal_reward greaterthan 2");
do = (
"subtract: mission_legal_status 1",
{
conditions = ("mission_legal_status lessthan 1");
do = ("set: mission_legal_status 0");
},
"setLegalStatus: [mission_legal_status]",
"reset: local_legal_reward"
);
},
);
},
"set: mission_legal_reward [credits_number]"
);
},
And this final piece of script checks whether the player has used his escape pod. If so, he gets back his legalStatus_number as it was before, stored in mission_legal_status.
The first part also sets mission_legal_status after launching and keeps it up to date while you are flying and doing criminal things (why have another condition-clause if you can do two things at the same time (keep your scripts lean)):
Code: Select all
{
conditions = ("status_string oneof STATUS_IN_FLIGHT, STATUS_LAUNCHING");
do = (
"set: mission_legal_status [legalStatus_number]",
"testForEquipment: EQ_ESCAPE_POD",
{
conditions = ("foundEquipment_bool equal YES");
do = ("set: mission_escape_pod_yes YES");
},
);
},
{
conditions = (
"status_string equal STATUS_DOCKED",
"mission_escape_pod_yes equal YES"
);
do = (
"testForEquipment: EQ_ESCAPE_POD",
{
conditions = ("foundEquipment_bool equal NO");
do = (
"setLegalStatus: [mission_legal_status]",
"reset: mission_escape_pod_yes"
);
},
);
},
So, the biggest unanswered question is: where do we go from here and who shall take the lead?