Not logged inOpenClonk Forum
Up Topic Development / Developer's Corner / Defcore to Property
- By Maikel Date 2017-07-15 12:54
Since we already made changes that break external packs when releasing 8.0 we might as well have a critical look at DefCore entries again and see which are still used and which may better be properties. I will make one post per entry to be discussed. Please add one if you want to change something.
- By Maikel Date 2017-07-15 12:55
FireTop: I am removing this (already done locally). It is not used and all fire stuff is done in C4Script.
- By Maikel Date 2017-07-15 12:56
AttractLightning: Unused as well currently and lightning is fully implemented in C4Script, could be a property that does not be in the engine instead.
- - By Maikel Date 2017-07-15 12:57

I think it would be good to make this a property, for example you can turn an object into a floating in C4Script or change the floating height. Any objections or potential problems?
Parent - - By Sven2 [us] Date 2017-07-15 18:20
Properties in movement code always have a bit of extra overhead. On the other hand, if it's just read for objects in liquids it's probably not a big deal.

If you replace it, maybe replace it with a density property instead? So something could float in lava, but sink in water.
Parent - - By Maikel Date 2017-07-15 18:25
That would be two properties then? Because objects also need to tell their float height relative to their center.
Parent - - By Sven2 [us] Date 2017-07-15 22:34
Couldn't that be derived from the density as well?
Parent - By Caesar Date 2017-07-16 10:38
If you just assume a constant density distribution among the y axis… Is that a sane approximation?
- - By Marky [de] Date 2017-07-16 19:20
NoBreath: Because BreatheWater already is a property. Needs adjustment in the engine code, though.
Parent - - By Zapper [de] Date 2017-07-16 19:23
Maybe make it a flag-based property (Breathe=0 ~ NoBreath=1; Breathe=1 ~ NoBreath=0 & BreatheWater=0; Breathe=2 ~ NoBreath=0 & BreatheWater=1)
Parent - By Marky [de] Date 2017-07-17 05:42 Edited 2017-07-17 05:47
The  breathing code is simple anyway, why not remove it from the engine and add it to objects that breathe specifically with an effect and/or library? Of course, that would be one more thing that a newcomer would need to keep in mind when adding an animal.

Edit: the flag based approach is good, especially if you can tell the object to breathe air and water
Parent - - By Sven2 [us] Date 2017-07-16 19:32
That was posting 33333!
Parent - By Marky [de] Date 2017-07-16 19:59
Wooot :)
Up Topic Development / Developer's Corner / Defcore to Property

Powered by mwForum 2.29.7 © 1999-2015 Markus Wichitill