
- Functions can declare that they want one as a parameter. Engine-defined functions get a pointer to the internal C++ type instead of a plain pointer to a proplist.
- Some properties behave differently. For example, foo_effect.Name=42 throws an error, where foo_proplist.Name=42 just puts 42 into the Name property.
For other kinds of data, like the global variables or the actmap, the engine uses ordinary proplists and merely reads and writes the properties.
The reason you can call engine-defined functions on objects is that every object has a definition as a prototype, every definition has the
Global
proplist as a prototype, and the engine puts the functions into properties of the Global
proplist.It'd be cleaner to split the
Global
proplist into one with just the object functions and one with the global functions, and make the former the prototype of the definitions and the latter the source of global functions.For new engine functions that aren't intended to be called on objects we might want to consider putting them into a new proplist, and making that the prototype of the proplists the script works on.
I am actually working on something, so it's only sorta-dead. Hibernating? The sleeping beauty :D
Yes :D Although I really need someone to explain to me how the release process works. The wiki pages were not that clear, and I'll announce something when it is in a desired stage.
I tried my luck on separating the object functions proplist from the global functions, without success. The game just crashes :D
https://github.com/gitMarky/openclonk/commit/04b83d21fa42dd8b7afc586c196d32db6d04bbb2
https://github.com/gitMarky/openclonk/commit/04b83d21fa42dd8b7afc586c196d32db6d04bbb2
Powered by mwForum 2.29.7 © 1999-2015 Markus Wichitill