Not logged inOpenClonk Forum
- - By Newton [es] Date 2009-05-31 10:55 Edited 2009-06-02 12:31
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?
Parent - - By Randrian [de] Date 2009-09-03 14:34
I have implemented a base control object which handels all the things of the former CR base.
See: http://bitbucket.org/randrian/openclonk/
Reply
Parent - - By Newton [de] Date 2009-09-03 23:10 Edited 2009-09-03 23:16
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()?
Parent - - By Randrian [de] Date 2009-09-04 09:31
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.
Reply
Parent - By Newton [de] Date 2009-09-05 11:11
or GetAutoSell(obj) { return obj->AutoSell(); }, then one can overload it for vendors etc.
Parent - - By MrBeast [de] Date 2009-09-04 16:48
Shouldn't proplists be used for such things?
Reply
Parent - - By Zapper [de] Date 2009-09-04 17:49
Why? Arrays still work quite well if you need simple lists. Proplists are not the solution to everything now :)
Parent - By Günther [de] Date 2009-09-04 19:04
But they probably should replace func IsClonk() { return 1; } and friends, once their syntax is finalized.
Reply
Parent - - By Clonk-Karl [us] Date 2009-09-04 15:50
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.
Reply
Parent - By Randrian [de] Date 2009-09-04 17:15
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.
Reply
Parent - By Randrian [de] Date 2009-09-04 23:55
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.
Reply

Powered by mwForum 2.29.7 © 1999-2015 Markus Wichitill