Not logged inOpenClonk Forum
Up Topic Development / Developer's Corner / Some Notes on PropLists
- - By Günther Date 2020-01-05 13:37
There are two ways objects, definitions and effects differ from proplists:
- 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.
Reply
Parent - By Zapper [de] Date 2020-01-05 14:06
Hi Günther .o/
Parent - - By Clonkonaut [de] Date 2020-01-06 12:03
Hi Günther .o/

OC is dead /o\
Reply
Parent - - By Zapper [de] Date 2020-01-06 13:21
Parent - By Clonkonaut [de] Date 2020-01-06 15:29
This is an ex-Clonk!
Reply
Parent - - By Marky [de] Date 2020-01-06 17:13
I am actually working on something, so it's only sorta-dead. Hibernating? The sleeping beauty :D
Parent - - By Clonkonaut [de] Date 2020-01-06 17:28
Barely hanging on to life support?
Reply
Parent - - By Marky [de] Date 2020-01-06 17:28
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.
Parent - By Luchs Date 2020-01-08 13:19
Well, currently it doesn't work - we just have the snapshots. But actually having something to release would most likely motivate Isilkor and me enough to fix it. :)
Parent - By Marky [de] Date 2020-01-09 20:34
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
Up Topic Development / Developer's Corner / Some Notes on PropLists

Powered by mwForum 2.29.7 © 1999-2015 Markus Wichitill