Missing me, this or something in scripts [use: getobject()]

Send us your feedback or ask for features.
Post Reply
mbncp
Regular
Posts:87
Joined:08 Dec 2011 07:25
Missing me, this or something in scripts [use: getobject()]

Post by mbncp » 17 Dec 2011 11:47

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);
Last edited by mbncp on 24 Dec 2011 22:50, edited 1 time in total.

misal
Newbie
Posts:11
Joined:08 Dec 2011 21:35

Re: Missing me, this or something in scripts

Post by misal » 17 Dec 2011 16:10

+1

ruigato
Newbie
Posts:21
Joined:09 Dec 2011 03:46

Re: Missing me, this or something in scripts

Post by ruigato » 18 Dec 2011 14:05

+1

hydrogen
Newbie
Posts:9
Joined:22 Dec 2011 22:30

Re: Missing me, this or something in scripts

Post by hydrogen » 24 Dec 2011 21:33

+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.

nick_liine
Liine Staff
Posts:340
Joined:01 Oct 2010 11:06

Re: Missing me, this or something in scripts

Post by nick_liine » 24 Dec 2011 21:38

Hi guys,

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);
More extensive example attached.

Best regards,
Nick
Attachments
local_getobject_example.jzml.zip
(1.29KiB)Downloaded 129 times

mbncp
Regular
Posts:87
Joined:08 Dec 2011 07:25

Re: Missing me, this or something in scripts

Post by mbncp » 24 Dec 2011 22:44

Thanks, exactly what we were looking for and nice example btw.

Do you have by chance a list of all undocumented functions ? :twisted:

nick_liine
Liine Staff
Posts:340
Joined:01 Oct 2010 11:06

Re: Missing me, this or something in scripts

Post by nick_liine » 25 Dec 2011 09:05

mbncp wrote:Thanks, exactly what we were looking for and nice example btw.

Do you have by chance a list of all undocumented functions ? :twisted:
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.

Best regards,
Nick

areos
Newbie
Posts:9
Joined:21 Dec 2011 18:41

Re: Missing me, this or something in scripts [use: getobject

Post by areos » 25 Dec 2011 09:24

^ this will be true x-mas gift !

tdmusic
Newbie
Posts:13
Joined:28 Dec 2011 15:19

Re: Missing me, this or something in scripts [use: getobject

Post by tdmusic » 28 Dec 2011 23:00

Glad to see there's a workaround for this! Cheers Nick. Look forward to the updated PDF :)

Post Reply