Missing me, this or something in scripts [use: getobject()]
Maybe it's there but I don't see a way for an object to reference itself, tried getfirst/next with fake values, but no luck.
This would make it easier to re-use or duplicate objects, no need to edit each script again.
Could be simply done by calling getfirst(0), returning the reference to the current object.
this code would then work with pretty much any object without any extra editing.
decl me;
me = getfirst(0);
setattribute(me, 'color', 0);
This would make it easier to re-use or duplicate objects, no need to edit each script again.
Could be simply done by calling getfirst(0), returning the reference to the current object.
this code would then work with pretty much any object without any extra editing.
decl me;
me = getfirst(0);
setattribute(me, 'color', 0);
Last edited by mbncp on 24 Dec 2011 22:50, edited 1 time in total.
Re: Missing me, this or something in scripts
+1 being able to create a template container and duplicate it would be perfect. Then being able to adjust it from script would be perfect for me.
-
- Liine Staff
- Posts:340
- Joined:01 Oct 2010 11:06
Re: Missing me, this or something in scripts
Hi guys,
This exists already, use getobject() to refer to the object within which the script is contained. For example:
More extensive example attached.
Best regards,
Nick
This exists already, use getobject() to refer to the object within which the script is contained. For example:
Code: Select all
setattribute(getobject(),'color',some_variable);
Best regards,
Nick
- Attachments
-
- local_getobject_example.jzml.zip
- (1.29KiB)Downloaded 129 times
Re: Missing me, this or something in scripts
Thanks, exactly what we were looking for and nice example btw.
Do you have by chance a list of all undocumented functions ?
Do you have by chance a list of all undocumented functions ?
-
- Liine Staff
- Posts:340
- Joined:01 Oct 2010 11:06
Re: Missing me, this or something in scripts
I'm in the process of reviewing the parser code and double-checking that everything is covered in the documentation. I've found a couple little things so far, will updated the PDF manual soon.mbncp wrote:Thanks, exactly what we were looking for and nice example btw.
Do you have by chance a list of all undocumented functions ?
Best regards,
Nick
Re: Missing me, this or something in scripts [use: getobject
^ this will be true x-mas gift !
Re: Missing me, this or something in scripts [use: getobject
Glad to see there's a workaround for this! Cheers Nick. Look forward to the updated PDF