Not logged inOpenClonk Forum
Up Topic Änderungen an OCScript?

This board is threaded (i.e. has a tree structure). Please use the Reply button of the specific post you are referring to, not just any random button. If you want to reply to the topic in general, use the Post button near the top and bottom of the page.

Post Reply
In Response to Günther

> Der Grund für diese Warnung ist, dass bei einer solchen Funktion inherited einmal die vorige Kopie und einmal, so vorhanden, eine Engine-Funktion aufruft. Oder vielleicht auch nicht, ich kann mich nicht mehr erinnern was genau der Fall ist obwohl ich den Code erst vor wenigen Monaten geschrieben habe.


Sven2 hat mich dazu gebracht*, den Quelltext zu lesen. Globale Funktionen werden durch #include/#appendto nicht kopiert. Und die Warnung ist dazu da, globale Funktionen aus #appendto-Scripten zu verjagen, damit die Engine aufhören kann, diese alleinstehend zu kompilieren - denn das führt in den meisten Fällen nur zu Fehlermeldungen, dass Funktionen aus dem appendto-Ziel nicht vorhanden sind.

*#openclonk-dev Auszug:
<Sven2> Btw, Guenther: It seems that every #appendto script is also parsed "standalone" without being appended
<Guenther> Sven2: That's always been the case
<Sven2> So it generates parser errors for every function that is used from the script it is appended to
<Guenther> Maybe the silence-the-errors-for-those hack broke
<Sven2> Yes, I remember. We had a workaround hack :)
<Sven2> Why did you keep that behavious then?
<Sven2> *behaviour
<Guenther> So that global functions in those scripts worked as before?
<Sven2> Why would global functions not work if they are parsed only once? (when appended)
<Guenther> I think I considered changing that, but then opted not to think through whether it would break something and do something more important
<Guenther> ah, yes, reading the code, global functions are only generated when they are parsed as part of their origin script
<Guenther> not when they appear due to include/appendto
<Guenther> I think because that maintains the invariant that the code for all functions is in their origin script
<Guenther> er, owner script
<Guenther> normal functions are copied for every script they appear in
<Guenther> global functions aren't
<Sven2> Makes sense
<Guenther> So, the "vielleicht auch nicht" option from my forum answer is the correct one :-)
<Guenther> I think it'd make more sense to keep the bytecodes in the functions itself
<Sven2> We'll think about it during dinner :-)
<Guenther> But that's yet another change

Powered by mwForum 2.29.7 © 1999-2015 Markus Wichitill