Quote:
Originally Posted by Nanaki
The trickiest part is matching the references... Each turret, GKGun, and GKTurret has a reference, each reference MUST be unique, and than match the references to the INI. For example, the 'down_left' reference in the IMD file must match to the 'down_left' reference in the INI file.
|
I know that and I make each unique but it doesn't help. Could you upload your ship files, PLEASE!!! I can check them myself and find what I'm doing wrong.
Quote:
I will look through it and ponder, I tend to prefer to review code slowly and carefully. Best way to debug it.
|
I've copied this function from mission 13c file SavingFriend_c_XT24.script. Maybe you check there and find out how to implement similar function.
Other problem may be activation of this function during dialog. I would like that dialog will close immediately after player choose the answer and ships will pop up.
Below fully working mothership buying function with price check. Price is set to 666 credits

and must be set separately for each ship here. Script doesn't check the price in carcasses.xml. I've changed Elio maintenance station so portal reactivation is set for 4 portals there.
Quote:
function DialogR_buy_Rhino()
local N=GetPlayerCredits();
if (N>=666) then
NewFlight("myGroup_5", "nm", "Mothership_corporate_pl1", "BasePilot", mothership:GetPosition() + Vector3(0, 0, -70), Vector3(0, 0, 1));
mothership_old = mothership;
mothership = SetPlayerMotherShip(ship_nm_1);
SubPlayerCredits(666);
PortalTrigger_PORTAL_R:SetObject(mothership);
PortalTrigger_PORTAL_L:SetObject(mothership);
PortalTrigger_PORTAL_U:SetObject(mothership);
PortalTrigger_PORTAL_D:SetObject(mothership);
PortalsActivate_Action();
GetShipName(mothership);
CreateTradeStationDocking(TRADE_STATION,mothership );
CreateRepairStationDocking(STO_Station,mothership, 140,5);
OutputToScreenLog("#UI_MothershipBuy",7);
else
OutputToScreenLog("#UI_MothershipBuyFail",7);
end;
end;
|