Not logged inOpenClonk Forum

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?

After a short glance: Looks good! But:
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.

or
GetAutoSell(obj) { return obj->AutoSell(); }
, then one can overload it for vendors etc.
Shouldn't proplists be used for such things?

Why? Arrays still work quite well if you need simple lists. Proplists are not the solution to everything now :)

But they probably should replace func IsClonk() { return 1; } and friends, once their syntax is finalized.
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.

Ok, I deleted my bitbucket fork and started it again and try to keep the changes seperated. Now the base control is only in the OC repos.
Powered by mwForum 2.29.7 © 1999-2015 Markus Wichitill