Hi all, maybe this is a strange (perhaps stupid) question,
but can you add fields to a type at runtime?
I'm creating a game like Freelancer (sort of space sim),
where I use an array (filled with types) to hold all data about sectors, spacestations, planets, ...
When I've completed the game, I want the game to be able to use Mod-packs.
For example:
On a station, you can buy and sell commodities like Water, Fuel, computers, ...
I want each station to be able to buy/sell some specific commodities (not all).
Therefore I use fields like WaterSells and WaterPrice in the type StationCommodities.
I use that type in an array, so I can refer to a specific station (each one has a number) with the index of the array.
But when a Mod-pack comes out, I may have added some new commodities.
And their fields (new commodity: Crystals, fields: CrystalSells and CrystalPrice) must be added to that type.
Is this possible, without recompiling the exe, which holds the edited types?
but can you add fields to a type at runtime?
I'm creating a game like Freelancer (sort of space sim),
where I use an array (filled with types) to hold all data about sectors, spacestations, planets, ...
When I've completed the game, I want the game to be able to use Mod-packs.
For example:
On a station, you can buy and sell commodities like Water, Fuel, computers, ...
I want each station to be able to buy/sell some specific commodities (not all).
Therefore I use fields like WaterSells and WaterPrice in the type StationCommodities.
I use that type in an array, so I can refer to a specific station (each one has a number) with the index of the array.
But when a Mod-pack comes out, I may have added some new commodities.
And their fields (new commodity: Crystals, fields: CrystalSells and CrystalPrice) must be added to that type.
Is this possible, without recompiling the exe, which holds the edited types?