Jump to content

Beginner coding modules


Capt. Hunt

Recommended Posts

I've been doing some tweaking, of modules here and there, and I know a little C++ coding, I'd like to start my first serious mod from scratch, and I need a little help.

The mod I'd like to do is a config file to change all the part costs of the FASA Saturn parts (this is just for personal use for now, I'll ask Frizzank before I ever release it.) and I'd like to do it so that all the changed prices are in one file to make it easier to tweak them as needed, and also so that I don't have to redo it if Frizzank updates FASA.

I guess what I'd like to know is what calls I need to use to point to the cost lines in each part file.

Link to comment
Share on other sites

ok, so I used the code MeCripp posted (subbing the right part name and cost variable), but it doesn't change the prices of any of the parts I changed.

PART[FASAApollo_CM]:HAS[cost[]]
{
cost = 3800
//default cost = 3800
}
PART[FASAApollo_CM_Decoupler]:HAS[cost[]]
{
cost = 700
//default cost = 1000
}
PART[FASAApollo_CM_HeatShield
]:HAS[cost[]]
{
cost = 1000
//default cost = 1000
}
PART[FASAApollo_CM_parachutes]:HAS[cost[]]
{
cost = 2500
//default cost = 5000
}
PART[FASAApollo_CM_RCS]:HAS[cost[]]
{
cost = 500
//default cost = 500
}
PART[FASAApollo_CM_Top]:HAS[cost[]]
{
cost = 300
//default cost = 300
}
PART[FASAApollo_DockingDevice]:HAS[cost[]]
{
cost = 500
//default cost = 1500
}
PART[FASAApollo_LES]:HAS[cost[]]
{
cost = 900
//default cost = 900
}
PART[FASAApollo_SM]:HAS[cost[]]
{
cost = 3000
//default cost = 30000
}
PART[FASAApollo_SM_Dish]:HAS[cost[]]
{
cost = 1100
//default cost = 1100
}
PART[FASAApollo_SM_Engine]:HAS[cost[]]
{
cost = 1200
//default cost = 12000
}
PART[FASAApollo_SM_Light]:HAS[cost[]]
{
cost = 100
//default cost = 100
}
PART[FASAApollo_SM_RCS]:HAS[cost[]]
{
cost = 550
//default cost = 750
}
PART[FASALEM-CSM_deployment]:HAS[cost[]]
{
cost = 1000
//default cost = 3000
}

Link to comment
Share on other sites

Whoops

@PART[WHAT PART]

{

%entryCost = *****

}

Hope you added the @

EDiT- Did not catch it when, I posted.

EDIT- So

@PART[FASAApollo_CM]
{
%cost = 3800
//default cost = 3800
}
@PART[FASAApollo_CM_Decoupler]
{
%cost = 700
//default cost = 1000
}
@PART[FASAApollo_CM_HeatShield
]
{
%cost = 1000
//default cost = 1000
}
@PART[FASAApollo_CM_parachutes]
{
%cost = 2500
//default cost = 5000
}
@PART[FASAApollo_CM_RCS]
{
%cost = 500
//default cost = 500
}
@PART[FASAApollo_CM_Top]
{
%cost = 300
//default cost = 300
}
@PART[FASAApollo_DockingDevice]
{
%cost = 500
//default cost = 1500
}
@PART[FASAApollo_LES]
{
%cost = 900
//default cost = 900
}
@PART[FASAApollo_SM]
{
%cost = 3000
//default cost = 30000
}
@PART[FASAApollo_SM_Dish]
{
%cost = 1100
//default cost = 1100
}
@PART[FASAApollo_SM_Engine]
{
%cost = 1200
//default cost = 12000
}
@PART[FASAApollo_SM_Light]
{
%cost = 100
//default cost = 100
}
@PART[FASAApollo_SM_RCS]
{
%cost = 550
//default cost = 750
}
@PART[FASALEM-CSM_deployment]
{
%cost = 1000
//default cost = 3000
}

Tested and works

Edited by Mecripp2
Link to comment
Share on other sites

That's also missing an operator for cost[]

Do you mean ~cost[] perhaps? That will find things that don't have costs.

He is wanting to change so % ?

EDIT- If #6 post don't work which it should

@PART[FASAApollo_CM]

{

%cost = 800 <--------- change for test

//default cost = 3800

}

This works and have tested Edited by Mecripp2
Link to comment
Share on other sites

MeCripp: I'm talking about the HAS block. HAS needs an operator: # for has, ~ for doesn't-have.

If you plan to use % however, why are you using HAS at all?

Thought sarbian said % did work there ? and ~ just checks if it's missing ? and I have ran them pretty much just as, I posted #6.

EDIT- Sorry Capt. Hunt try'ed to make that harder then it was post #6 as been tested and works.

EDIT- Thanks NathanKell your right as always :)

Edited by Mecripp2
Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...