PropertyMenu select L, XL or L + XL ships

The place to discuss scripting and game modifications for X Rebirth.

Moderators: Scripting / Modding Moderators, Moderators for English X Forum

jth
Posts: 296
Joined: Tue, 3. Jan 06, 23:31
x3

PropertyMenu select L, XL or L + XL ships

Post by jth »

Hi

I would like to give my Recycle Ship mod a quick overhaul.

To make the mod work I need to make sure that that L ships are only recycled by Capital shipdealers L or XLV and XL ships by Capital shipdealers XLV.

At the moment to select the ship to be recycled I am using the PropertyMenu and passing in 'sellship' with parameters ['cArch_sellshipselected', $BuildModule] which doesn't care what size the ship is.

I am then having to check the result to see if the selected ship was the right size and popping up an error message and telling the player to try again. That is making things a lot messier than I would like.

What I would like to do is to limit the selected ship so that the player can only select one that will fit.

From the smallshipdealer script it appears that PropertyMenu will also take

'selectobject', ['cSmallshiptrader_repairship', null, null, null, false, true, true, false, null, true, true, true, null, null, null, null, null, false]

from menu_property.lua
"selectobject", param: { returnsection, refcomponent, nil, nil, potentialsubordinate, disablestations, disablecapships, disablesmallships, canhavedrones, nosubordinate, noorder, haspilot, hascargocapacity, checkforbuildmodule, hasbuildingmodule, hascontrolentity, allowbuildingmodules }

I have played about a bit and come to the conclusion that a Rahanas appears to be a capship but I just can't find the right combination of parameters or maybe its the syntax that I am not getting. I feel that it should be possible to use the buildmodule (CV XL) or lack of it plus the cargo (Rahanas L) or lack of it (Taranis XL) to do the business

There also appear to be 18 parameters for the smallshipdealer example and 17 parameters in the lua file from 3.61 :(

My question is will the PropertyMenu do the business and if so what is the right syntax for the following three queries ?

All three need the ships to move so I am assuming that a pilot is also a requirement

1) L only

2) XL only

3) L + XL only ???
'selectobject', ['cArch_sellshipselected', null, null, null, null, true, false, true, null, null, true, true, null, null, null, null, null, false]

Thanks

jth
PS I can find just the CV with
'selectobject', ['cArch_sellshipselected', null, null, null, null, true, false, true, null, null, true, true, null, true, null, null, null, false]

but the Taranis and Rahanas are proving to be a lot more elusive
jth
Posts: 296
Joined: Tue, 3. Jan 06, 23:31
x3

Post by jth »

Thanks to UniTrader pointing me at the lua script that contains the function

http://forum.egosoft.com/viewtopic.php? ... 99#4566199

I have been able to look at the code and have come to a few conclusions

The checkObjectSelectConditions function is a series of trip wire conditions for ships, if you trip any of them then the return value is false and you cannot select that ship. Its basically a long list of conditions which are NOR'd together. Its designed to eliminate objects.

looking at what the individual tests are

1) To select Rahanas by itself - not possible

2) To select CV and Taranis together without also selecting Rahanas - not possible.

which answers my question and alleviates any guilt about considering designing yet another mk2 wheel :)

So it looks like its leave the Recycle ship script alone or do some lua scripting

I think that I am leaning towards having a play with some lua scripting

jth

Return to “X Rebirth - Scripts and Modding”