It has been implemented a couple of times and by a couple of people but I think now is the time to put the base homebase behaviour into script. It should be easily extendable since it may be used for other buy-sell-objects like vendors in Adventures with the possilibity to add different ware types than defined in the scenario.txt, just single menus at the start of the game (like e.g. in Hazard: Weapon Choice) and finally the possibility to add certain functionality like selling certain objects automatically, healing & extinguishing or blocking entrance for home bases.
I know it has been done more or less hacky and extendable before, but I don't know who did it. So, any takers?
I know it has been done more or less hacky and extendable before, but I don't know who did it. So, any takers?
I have implemented a base control object which handels all the things of the former CR base.
See: http://bitbucket.org/randrian/openclonk/
See: http://bitbucket.org/randrian/openclonk/
After a short glance: Looks good! But:
Why not a callback -
Plus, how would individual buy/sell menus work? (For vendors, weapon choice,...)
Edit: Overload GetBuyObjects()?
public func GetAutoSell() { return [GOLD]; }
Why not a callback -
if(obj->AutoSell()) Sell(obj);
?Plus, how would individual buy/sell menus work? (For vendors, weapon choice,...)
Edit: Overload GetBuyObjects()?
Yes GetBuyObjects() is ment to be overloaded by vendors. And they should call OpenBuyMenu and OpenSellMenu directly without the contextmenu.
All upper functions are ment to be overloadable. So that you can also make a base which changes the value of objects when less are avaibile or things like that.
Hmm well, a callback would probably better. Noone wants different bases that autosell different things. That would be confusing. I'll change that.
All upper functions are ment to be overloadable. So that you can also make a base which changes the value of objects when less are avaibile or things like that.
Hmm well, a callback would probably better. Noone wants different bases that autosell different things. That would be confusing. I'll change that.
Have you committed this to the mesh branch by intention? Not sure if that's a good idea, but maybe it isn't too harmful since this stuff should be pretty orthogonal to the experimental engine code changes anyway.
No, this wasn't intention. I have commited it to the normal OC repos now. But they are still in my fork in the mesh branch too. If I find out how, I'll delete the changes there.
Powered by mwForum 2.29.7 © 1999-2015 Markus Wichitill