Name based commodities plist
Moderators: winston, another_commander
Name based commodities plist
Is possible to have a name based commodities plist instead of a role based. In other words to have deferent commodities plists for stations with a deferent name that have the same role. The wiki is down from yesterday and I cannot search there for an answer
I don't believe it is. Or else it would have made Planetfall a whole lot easier (and better).
My OXPs via Boxspace or from my Wiki pages .
Thargoid TV
Dropbox Referral Link
Thargoid TV
Dropbox Referral Link
Wait, you can! It might not be exactly what you're after, but each station type can have its own commodities definition, and that includes the name for each of the standard items. Copy the standard commodities.plist to a suitable oxp, and you can use that as a starting point: look for where it says 'food' inside the rock hermit definition, and change it to 'daily rations' and it will say that whenever you're docked to a rock hermit, etc...
This way is of course the brute force approach - it can also be used to override standard prices etc, etc, as well as the name for a particular type of commodity.
I'm sure it was handled slightly differently inside the localised language OXPs. If you've got any of them handy, do dive in!
I've got the horrible feeling the most difficult part would be to come up with synonyms!
The first example I had in mind involved gem stones, but I suddenly realised it would just be silly if they suddenly became 'rubies' or 'sapphires' based on which station you were at!
Cheers,
Kaks
edit: stupid typos!
This way is of course the brute force approach - it can also be used to override standard prices etc, etc, as well as the name for a particular type of commodity.
I'm sure it was handled slightly differently inside the localised language OXPs. If you've got any of them handy, do dive in!
I've got the horrible feeling the most difficult part would be to come up with synonyms!
The first example I had in mind involved gem stones, but I suddenly realised it would just be silly if they suddenly became 'rubies' or 'sapphires' based on which station you were at!
Cheers,
Kaks
edit: stupid typos!
Last edited by Kaks on Sat Feb 28, 2009 2:38 pm, edited 1 time in total.
Hey, free OXPs: farsun v1.05 & tty v0.5! :0)
-
- Quite Grand Sub-Admiral
- Posts: 6683
- Joined: Wed Feb 28, 2007 7:54 am
The descriptions.plist can contain keys like this:
"commodity-name food" = "Lays Crisps";
"commodity-name textiles" = "Armani Clothing";
"commodity-name radioactives" = "Gammatron Industrial R/A Sources"; (OK, this one might overflow the available space, but you get my drift)
...
etc.
The downside is that this applies globally, so I doubt you can use it for particular stations.
"commodity-name food" = "Lays Crisps";
"commodity-name textiles" = "Armani Clothing";
"commodity-name radioactives" = "Gammatron Industrial R/A Sources"; (OK, this one might overflow the available space, but you get my drift)
...
etc.
The downside is that this applies globally, so I doubt you can use it for particular stations.
I am not sure that I have understood what you are saying kaks . My idea was every deferent constore type to have deferent prices for commodities. For example Pi-42s to have cheap computers and machinery but expensive food, Tesccos to have cheap narcotics and slaves bot expensive hi-tech commodities like computers ect. Now there is one commodities plist for all constores since all constores have the same role but deferent name. In what you describe above isn’t truth that the last commodities.plist will overwrite all the previous. If yes i do not belive that it will work.Kaks wrote:Wait, you can! It might not be exactly what you're after, but cach station type can have its own commodities definition, and that includes the name for each of the standard items. Copy the standard commodities.plist to a suitable oxp, and you can use that as a starting point: look for where it says 'food' inside the rock hermit definition, and change it to 'daily rations' and it will say that whenever you're docked to a rock hermit, etc...
This way is of course the brute force approach (it could be used to override standard prices etc, etc) as well as the name for a particular type of commodity.
I'm sure it was handled slightly differently inside the localised language OXPs. If you've got any of them handy, do dive in!
I've got the horrible feeling the most difficult part would be to come up with synonyms!
The first example I had in mind involved gem stones, but I suddenly realised it would just be silly if they suddenly became 'rubies' or 'sapphires' based on which station you were at!
Cheers,
Kaks
All is good: each different station can have different names for those items as well as different prices!
You can change names both globally (following a_c's example) and on a station-by-station basis.
Look inside the commodities.plist, and you'll probably see what I mean, honest. If not, do PM me!
edit: more muddled explanation:
any commodities.plist can be overridden by other ones, but as long you also have a specific role for each of the constores, that specific role should not be overridden by any other OXPs. And you'll have to have specific roles for each of the constore variants to actually have them specialise in different products!
You can change names both globally (following a_c's example) and on a station-by-station basis.
Look inside the commodities.plist, and you'll probably see what I mean, honest. If not, do PM me!
edit: more muddled explanation:
any commodities.plist can be overridden by other ones, but as long you also have a specific role for each of the constores, that specific role should not be overridden by any other OXPs. And you'll have to have specific roles for each of the constore variants to actually have them specialise in different products!
Hey, free OXPs: farsun v1.05 & tty v0.5! :0)
That is the problemKaks wrote:any commodities.plist can be overridden by other ones, but as long you also have a specific role for each of the constores, that specific role should not be overridden by any other OXPs. And you'll have to have specific roles for each of the constore variants to actually have them specialise in different products!
All constores have the same role and this cannot be changed easily since it would affect many things in the functionality of youradhere as well as of oohaul oxp. That is the reason why i wanted to have a per name comodities plist instead of per role
I see. In order to do what you had in mind you will have to change the oohaul and youradhere code.Ark wrote:That why i wanted to have a per name comodities plist instead of per role
The changes might not have to be too extensive though (at least in javascript). As long as the generic constore role is still listed in the roles, oohaul can still check if hasRole(generic constore) & work happily with both generic and specific constores (haven't got oohaul though, so I don't really know how many code changes would be needed).
Hey, free OXPs: farsun v1.05 & tty v0.5! :0)
- Disembodied
- Jedi Spam Assassin
- Posts: 6885
- Joined: Thu Jul 12, 2007 10:54 pm
- Location: Carter's Snort
In my one and only (and sadly half-arsed) OXP to date – Free Trade Zones – I managed (I think) to get FTZ commodities lists to vary according to the economy of the planet. The FTZs are supposed to be effectively fencing stolen goods, Agricultural commodities are cheaper in an FTZ in an Industrial world, and vice-versa (because the pirates who supply FTZs are robbing incoming traders). The OXP is pretty limited but I think the commodity pricing variation works reasonably well. To be honest I've forgotten how I did this – well, I've forgotten how a more numerate friend showed me how to do this, with extensive help from various forum members and the wiki – but you're more than welcome to take a look. With the wiki down you can get a copy from here:
http://www.box.net/shared/e43ftmvqmr
http://www.box.net/shared/e43ftmvqmr
Commodities.plist seems to trigger on the primary role (the one the entity is spawned with). So if the OXP can spawn the station with that unique role then it will work. But if they're spawned with a generic role ("constore" for example) then they will only have one plist between them.Kaks wrote:I see. In order to do what you had in mind you will have to change the oohaul and youradhere code.Ark wrote:That why i wanted to have a per name comodities plist instead of per role
The changes might not have to be too extensive though (at least in javascript). As long as the generic constore role is still listed in the roles, oohaul can still check if hasRole(generic constore) & work happily with both generic and specific constores (haven't got oohaul though, so I don't really know how many code changes would be needed).
This is the issue I hit with Planetfall, and ended up having to re-think how I spawned the locations to get around it (the way you mention in fact).
My OXPs via Boxspace or from my Wiki pages .
Thargoid TV
Dropbox Referral Link
Thargoid TV
Dropbox Referral Link
ConfirmedThargoid wrote:Commodities.plist seems to trigger on the primary role (the one the entity is spawned with). So if the OXP can spawn the station with that unique role then it will work. But if they're spawned with a generic role ("constore" for example) then they will only have one plist between them.
This is the issue I hit with Planetfall, and ended up having to re-think how I spawned the locations to get around it (the way you mention in fact).
Commodities plist does not work with the secondary role I gave to the constores (pi42store, tescoostore ect)It works only with the primary role that is the generic one (constore).
- Cmd. Cheyd
- ---- E L I T E ----
- Posts: 934
- Joined: Tue Dec 16, 2008 2:52 pm
- Location: Deep Horizon Industries Manufacturing & Research Site somewhere in G8...
The primary role in this case is the one you spawn it with (not necessarily the first one in the shipdata.plist roles entry). So the script will have to be modified to use "pi42store, tescoostore ect" as the spawning role rather than "constore".
That's what I had to do with Planetfall to be able to use commodities.plist within it. That also involved coding the "randomness" of the choice into the script itself rather than just using weighted role settings and letting the system populator worry about it.
But as you say you can then have "constore" as a secondary role for purposes like locating the thing or performing script actions on it (again as PF does).
That's what I had to do with Planetfall to be able to use commodities.plist within it. That also involved coding the "randomness" of the choice into the script itself rather than just using weighted role settings and letting the system populator worry about it.
But as you say you can then have "constore" as a secondary role for purposes like locating the thing or performing script actions on it (again as PF does).
My OXPs via Boxspace or from my Wiki pages .
Thargoid TV
Dropbox Referral Link
Thargoid TV
Dropbox Referral Link