Re: Scripters cove
Posted: Thu Jul 21, 2022 10:12 pm
For information and discussion about Oolite.
https://bb.oolite.space/
TL99 was used to restrict access to equipment, if, for example, you wanted to hide the equipment generally, and then programmatically give the equipment to the player. But there are limits: using TL99 means there is no where in the galaxy you can go to fix it if it's damaged, and you wouldn't be able to easily repair it. TL99 also means it will *never* appear on the F3 screen, and the only way to get it is programmatically.Slartibartfast wrote: ↑Thu Jul 21, 2022 1:53 pm--> equipment.plist / TL99
hmmm
a "condition-script " as solution
for me that seems to be more a "workaround"
==> for the next time i stay with "99"
and
( linux/bash)Code: Select all
grep -v deprecated Latest.log > Last.log
Code: Select all
(99,0,"Remaining Module-Rackspace","EQ_RACKSPACE","Rackspace bla bla bla",
{
"available_to_all" = yes;
"requires_equipment" = "EQ_Q_BASE_SYSTEM";
"requires_cargo_space" = 0;
"display_color" = "blueColor"; // only for testing
"visible" = yes;
"can_carry_multiple" = yes;
"damage_probability" = 0;
"installation_time" = 0;
"can_carry_multiple" = yes;
"portable_between_ships" = no;
}
Not exactly, as 3 persons tried to tell you, a condition script is standard while TL 99 is a hack.Slartibartfast wrote: ↑Fri Jul 22, 2022 10:49 amHello
O.K.
i understand
the condition script is the "Bentley"
but i only need a backpack
Code: Select all
a condition script is standard while TL 99 is a hack.
In it's most simplest form, using a condition script would look like this:Slartibartfast wrote: ↑Fri Jul 22, 2022 8:32 pmcan someone post a fitting example ( i wanna do it right )
Code: Select all
(
(
5, 1000, "Remaining Module-Rackspace","EQ_RACKSPACE","Rackspace bla bla bla",
{
"available_to_all" = yes;
"condition_script" = "myequipment_conditions.js";
"requires_equipment" = "EQ_Q_BASE_SYSTEM";
"requires_cargo_space" = 0;
"display_color" = "blueColor"; // only for testing
"visible" = yes;
"can_carry_multiple" = yes;
"damage_probability" = 0;
"installation_time" = 0;
"can_carry_multiple" = yes;
"portable_between_ships" = no;
}
),
)
Code: Select all
"use strict";
this.name = "MyEquipment_Conditions";
this.allowAwardEquipment = function (equipment, ship, context) {
if (context == "scripted") return true;
return false;
}
I think the name comes from the function you execute to give equipment to a ship:Slartibartfast wrote: ↑Fri Jul 22, 2022 8:32 pm"allowAwardEquipment" -- for me it sounds like " allow to award equipment"
ship.awardEquipment
. So, what "allowAwardEquipment" is saying is "Allow the 'awardEquipment' function".Code: Select all
I think the name comes from the function you execute to give equipment to a ship: ship.awardEquipment. So, what "allowAwardEquipment" is saying is "Allow the 'awardEquipment' function"
Code: Select all
// test
"use strict";
this.name = "QVE_Rackspace_Conditions";
var context = "scripted"; // added
this.allowAwardEquipment = function (equipment, ship, context) {
if (context == "scripted") return true;
return false;
}
For simple escorts you can useSwiteck wrote: ↑Sat Jul 23, 2022 2:27 amI'm having problems getting the desired escorts for a Boa 2...
Which one of these should work:
"escort_role" = "navy-asp";
"escort-role" = "navy-asp";
"escort-ships" = "navy-asp";
"escort-ship" = "navy-asp";
"escort_ship" = "navy-asp";
"escort_ships" = "navy-asp";
escort_role
(the role of the ship) orescort_ship
(the key of the ship).escorts
and a number might be useful.escort_roles
offers you a variable number of escorts, you can assign only 1 ship (role) with min and max so that in more dangerous systems more escorts will be assigned.That line is unnecessary. "context" is passed into the function by the core code when it's checking the equipment item. If you were encountering situations that made that line of code necessary, then something else is happening, and we'd need a bit of context to help out.
I've updated the wiki a bit to hopefully explain things a bit more. It's a bit tricky: as you say earlier, I find it easy to understand, but I'm a programmer. It's hard to know where exactly to add descriptions, without writing an OXP for every function! (Although, perhaps, in fairness, an OXP for every function is what is needed for non-programmers to get their heads around it).Slartibartfast wrote: ↑Sat Jul 23, 2022 2:01 ambut i did not understand the description in the wiki so far
Neithermontana05 wrote: ↑Sat Jul 23, 2022 4:34 amFor simple escorts you can use
escort_role
(the role of the ship) or
escort_ship
(the key of the ship).
Combining it withescorts
and a number might be useful.
escort_roles
offers you a variable number of escorts, you can assign only 1 ship (role) with min and max so that in more dangerous systems more escorts will be assigned.
escort_role
(the role of the ship) norescort_ship
(the key of the ship)Code: Select all
system.addGroup("navy-asp", 4, [0,0,0], 30E3);