Thank you.
Scripters cove
Moderators: winston, another_commander
- phkb
- Impressively Grand Sub-Admiral
- Posts: 4830
- Joined: Tue Jan 21, 2014 10:37 pm
- Location: Writing more OXPs, because the world needs more OXPs.
Re: Scripters cove
The random function would return a number between and 1 and 2, not 1 and 3.
Re: Scripters cove
Thanks for pointing out. Probably an old comment not kept up with a change.
I was young, I was naïve. Jonny Cuba made me do it!
- phkb
- Impressively Grand Sub-Admiral
- Posts: 4830
- Joined: Tue Jan 21, 2014 10:37 pm
- Location: Writing more OXPs, because the world needs more OXPs.
Re: Scripters cove
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
A condition script gives you full control over the equipment item, allowing you to accurately define it's TL, so it can fit into the standard repair mechanisms, while still limiting if and when the equipment item is offered for sale. You could limit by station type, or government, or economy, or anything else.
So, not really a "workaround". A condition_script gives you full control, and better integration with the core game mechanics.
-
- Quite Grand Sub-Admiral
- Posts: 6682
- Joined: Wed Feb 28, 2007 7:54 am
Re: Scripters cove
What phkb said. In fact, TL 99 has always been a hack and the condition script is the proper way to do it. But, as long as the hack is still present, one can use whatever feels easier and simpler for them.
- Slartibartfast
- Deadly
- Posts: 175
- Joined: Mon Jan 21, 2008 3:54 pm
Re: Scripters cove
Hello
O.K.
i understand
the condition script is the "Bentley"
but i only need a backpack
!! its a placeholder - in two ways
------- programming / easy to handle
------ gameplay - its a part of the base_system and holds place for modules
matthias
O.K.
i understand
the condition script is the "Bentley"
but i only need a backpack
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;
}
------- programming / easy to handle
------ gameplay - its a part of the base_system and holds place for modules
matthias
Oolite 1.91 / Imp. Trader ( slighly modified ) on Lubuntu 22.04 LTS on AMD64 2x 3800+ ,
ATI Radeon R7240 XFS / Samsung TV 40" 1080p
C-Media CMI8738 / Yamaha RX-V575 / DIY-Speaker
Logitech Attack3 & standard german keyboard
ATI Radeon R7240 XFS / Samsung TV 40" 1080p
C-Media CMI8738 / Yamaha RX-V575 / DIY-Speaker
Logitech Attack3 & standard german keyboard
- montana05
- ---- E L I T E ----
- Posts: 1166
- Joined: Mon May 30, 2016 3:54 am
- Location: lurking in The Devils Triangle (G1)
Re: Scripters cove
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
Scars remind us where we've been. They don't have to dictate where we're going.
- Slartibartfast
- Deadly
- Posts: 175
- Joined: Mon Jan 21, 2008 3:54 pm
Re: Scripters cove
hi
yes yes -- i already understood
but no matter....
--------------------
i have tried to find an example with the same properties, that i need, in different oxp/oxz
---> no success
btw.
i have problems to understand the information in some wiki pages and
the "names" of a some functions etc.
f.x. "allowAwardEquipment" -- for me it sounds like " allow to award equipment"
--- therefore -i thought - "this must be a condition for ships / not for equipment"
please
can someone post a fitting example ( i wanna do it right )
thx
matthias
Code: Select all
a condition script is standard while TL 99 is a hack.
but no matter....
--------------------
i have tried to find an example with the same properties, that i need, in different oxp/oxz
---> no success
btw.
i have problems to understand the information in some wiki pages and
the "names" of a some functions etc.
f.x. "allowAwardEquipment" -- for me it sounds like " allow to award equipment"
--- therefore -i thought - "this must be a condition for ships / not for equipment"
please
can someone post a fitting example ( i wanna do it right )
thx
matthias
Oolite 1.91 / Imp. Trader ( slighly modified ) on Lubuntu 22.04 LTS on AMD64 2x 3800+ ,
ATI Radeon R7240 XFS / Samsung TV 40" 1080p
C-Media CMI8738 / Yamaha RX-V575 / DIY-Speaker
Logitech Attack3 & standard german keyboard
ATI Radeon R7240 XFS / Samsung TV 40" 1080p
C-Media CMI8738 / Yamaha RX-V575 / DIY-Speaker
Logitech Attack3 & standard german keyboard
- phkb
- Impressively Grand Sub-Admiral
- Posts: 4830
- Joined: Tue Jan 21, 2014 10:37 pm
- Location: Writing more OXPs, because the world needs more OXPs.
Re: Scripters cove
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 )
equipment.plist
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".- Slartibartfast
- Deadly
- Posts: 175
- Joined: Mon Jan 21, 2008 3:54 pm
Re: Scripters cove
thx
==> code
i`ll try now
----------------------------------------
such explanations i miss in the wiki // maybe for experienced developers this is not necessary
-- - but that would help (and did not frustrate newbies like me. )
==> code
i`ll try now
----------------------------------------
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"
-- - but that would help (and did not frustrate newbies like me. )
Oolite 1.91 / Imp. Trader ( slighly modified ) on Lubuntu 22.04 LTS on AMD64 2x 3800+ ,
ATI Radeon R7240 XFS / Samsung TV 40" 1080p
C-Media CMI8738 / Yamaha RX-V575 / DIY-Speaker
Logitech Attack3 & standard german keyboard
ATI Radeon R7240 XFS / Samsung TV 40" 1080p
C-Media CMI8738 / Yamaha RX-V575 / DIY-Speaker
Logitech Attack3 & standard german keyboard
- Slartibartfast
- Deadly
- Posts: 175
- Joined: Mon Jan 21, 2008 3:54 pm
Re: Scripters cove
Hi
this seems to work:
but i did not understand the description in the wiki so far
good night
Slartibartfast
this seems to work:
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;
}
good night
Slartibartfast
Oolite 1.91 / Imp. Trader ( slighly modified ) on Lubuntu 22.04 LTS on AMD64 2x 3800+ ,
ATI Radeon R7240 XFS / Samsung TV 40" 1080p
C-Media CMI8738 / Yamaha RX-V575 / DIY-Speaker
Logitech Attack3 & standard german keyboard
ATI Radeon R7240 XFS / Samsung TV 40" 1080p
C-Media CMI8738 / Yamaha RX-V575 / DIY-Speaker
Logitech Attack3 & standard german keyboard
Re: Scripters cove
I'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";
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";
- montana05
- ---- E L I T E ----
- Posts: 1166
- Joined: Mon May 30, 2016 3:54 am
- Location: lurking in The Devils Triangle (G1)
Re: Scripters cove
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).Combining it with
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.Scars remind us where we've been. They don't have to dictate where we're going.
- phkb
- Impressively Grand Sub-Admiral
- Posts: 4830
- Joined: Tue Jan 21, 2014 10:37 pm
- Location: Writing more OXPs, because the world needs more OXPs.
Re: Scripters cove
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
Re: Scripters cove
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)...seem to work.
Where there is supposed to be 1 escort ship-type, I'm seeing Geckos, Mambas, Sidewinders, Cobra 1's and 3's, etc!
I am using a separate line of:
escorts = 4;
...To define how many escorts to have.
The ships I'm trying to make escorts exist, as I can spawn them separately using this line:
Code: Select all
system.addGroup("navy-asp", 4, [0,0,0], 30E3);