Development > Newbie Coding
Add production costs value in scriptfiles
Muton:
I tried to add a production costs value into scriptfiles (instead of using a hardcoded value)
It worked, except for airplanes the costs are 0 credits
Did i miss something???
The patchfile is without scriptfiles
I've added the value into aircraftmanagement.ufo the same way as for weapons ....
Mattn:
--- Quote --- Price of this aircraft type at game start, it's evolving on the market.
--- End quote ---
i don't see it evolving anywhere.
Muton:
Got it working
needed to modify cp_aircraft.c too
Line: 1424
static const value_t aircraft_vals[] = {
....
+ {"prodprice", V_INT, offsetof(aircraft_t, prodprice), MEMBER_SIZEOF(aircraft_t, prodprice)},
Shouldnt that be moved to script.c
> i don't see it evolving anywhere.
I've made a quick copy paste operation
Personally i think this is an obsolete comment
because i've never seen a market-price changing
But this was my first code-digging.
Maybe, maybe not.
Who knows ?
Mattn:
the market price evolves - but the produce price not.
would be cool if you could upload a new patch against latest master
geever:
--- Quote from: Mattn on January 11, 2011, 09:44:40 am ---the market price evolves - but the produce price not.
would be cool if you could upload a new patch against latest master
--- End quote ---
Once I merged it manually to the master (not sure I still have the patch). I like the idea, the more scriptable the better the "engine". However I had a few concerns too:
* it add campaign only data into objDef_t which is global, maybe we should move it into technology_t (production requirements are in tech too)
* If production price is not set in script it's 0. This case (market) price value should be copied to production price at parsing stage.
* We do shorten identifiers but not on all cost. prodprice in script isn't nice.
-geever
Navigation
[0] Message Index
[#] Next page
Go to full version