Not logged inOpenClonk Forum
Up Topic Development / Developer's Corner / C4Script changes
- - By DerDude [de] Date 2009-09-09 22:17
Hello everybody!
I was wondering if somebody documents the changes to the C4Script.
Something like a "Script changes list" (and maybe a "Planned changes list") would be really helpfull I think.
Old and new developers could quickly check the list and adjust old scripts.
Of course, this only makes sense if the changes aren't toooo big (they aren't, right? =)
Reply
Parent - - By Isilkor Date 2009-09-09 22:43 Edited 2009-09-10 17:35
c1c542ea4b8c:
  • Added keyword 'nil', representing an uninitialized value; nil is only equal to itself.

4cfa1c35dc2f:
  • Removed target object parameter of several functions that defaulted to this anyway (for a full list see changed docs files in the changeset). Calling those functions outside of object context raises an exception at runtime.

  • Renamed GetColorDw to GetColor and SetColorDw to SetColor. Old functions have been removed completely.

5e902ff52ab4:
  • Removed numbered Vars, Locals, Globals.

6df28415dac6:
  • Associative arrays! (We call them proplist. You'll probably not need the prototyping, so I'm not explaining this here.)
    var data = { key: "value", key2: 47 }; data["key2"] == 47

  • Objects and definitions are now proplists. Actmaps are proplists. Most of it is overridable at runtime. See dynamite script or Clonk script for examples.

4870be5588d7:
  • Post-test loop "do-while" implemented.

43a154afa674:
  • Allow negative subscripts into arrays. foo[-1] == foo[GetLength(foo)-1]
Reply
Parent - - By DerDude [de] Date 2009-09-10 14:55
Thats really helpfull, thanks!
What about planned changes?
Reply
Parent - By Isilkor Date 2009-09-10 17:39
I'm currently not aware of any planned C4Script changes that will happen in the near future. There might be unplanned changes though, depending on what is needed to make new features work.
Reply
Parent - By Günther [de] Date 2009-09-11 12:48
I'll probably replace named local variables with proplists. The namespace collisions between them and the properties interfacing with the engine are unfortunate, but probably worth the simplification. And the Definition()-Function will go away, it's just too hard to maintain in the face of savegames. Instead, I'll add initialization of local variables/properties. That's a bit more work on the script side, but will make savegame restore way easier.
Reply
Up Topic Development / Developer's Corner / C4Script changes

Powered by mwForum 2.29.7 © 1999-2015 Markus Wichitill