Anonymous Login
2020-09-24 08:12 UTC

View Issue Details Jump to Notes ]
IDProjectCategoryView StatusLast Update
0001196OpenClonkEngine - C4Scriptpublic2014-12-28 21:19
Assigned To 
Product Version 
Target VersionFixed in Version 
Summary0001196: Assign values to local variables using functions
DescriptionThis would allow for cleaner code like this:

local PictureTransformation = Trans_Mul(Trans_Rotate(25, 0, 1, 0), Trans_Scale(625));

Instead of this:

protected func Definition(def)
    SetProperty("PictureTransformation", Trans_Mul(Trans_Rotate(25, 0, 1, 0), Trans_Scale(625)), def);
TagsNo tags attached.
Attached Files




Sven2 (developer)

Last edited: 2014-12-28 21:19

View 2 revisions

Sounds potentially very error-prone, since such functions could not use local variables themselves. Also, consider e.g.:

local foo = Random(100);

That would mean script engine initialization would affect and depend on the sync state, which might cause difficulties on stuff like network runtime join synchronization.

So it's probably not hard to implement, but might introduce subtle bugs if not done right.


-Issue History
Date Modified Username Field Change
2014-12-28 20:02 Maikel New Issue
2014-12-28 21:16 Sven2 Note Added: 0003297
2014-12-28 21:19 Sven2 Note Edited: 0003297 View Revisions
+Issue History