Knuckle Cracker

Creeper World 3 => The Coder's Corner => Topic started by: Molay on May 29, 2013, 03:17:30 PM

Title: Changing appearence of core dynamically (not images managed by script)
Post by: Molay on May 29, 2013, 03:17:30 PM
Hello!

I've been wondering if it is possible to change the core appearance itself, without adding images you manipulate?
As in, can I modify the scale, the color, the image etc of the core itself?

I thought about superimposing an image on a very small core as a workaround.
Am I just missing something? :)

Thanks!
Title: Re: Changing appearence of core dynamically (not images managed by script)
Post by: J on May 29, 2013, 03:22:26 PM
Select the core you want to edit and look at the dock. There are a few setting that change the appearance of the core.
Title: Re: Changing appearance of core dynamically (not images managed by script)
Post by: Molay on May 29, 2013, 03:31:15 PM
Yes, that's in the map editor, right?

I meant to change the main image of the core within the script, without making use of custom images. Like, changing it's color or scale if something triggers it.

I tried SetImageColor(self self 0 255 0 255) to get a green emitter, but it's doesn't work with placing the UID as second argument. What would I need to place there so it targets the appearance of the core?
Title: Re: Changing appearence of core dynamically (not images managed by script)
Post by: Michionlion on May 29, 2013, 03:45:51 PM
Quote from: Molay on May 29, 2013, 03:31:15 PM
Yes, that's in the map editor, right?

I meant to change the main image of the core within the script, without making use of custom images. Like, changing it's color or scale if something triggers it.

I tried SetImageColor(self self 0 255 0 255) to get a green emitter, but it's doesn't work with placing the UID as second argument. What would I need to place there so it targets the appearance of the core?

http://knucklecracker.com/wiki/doku.php?id=crpl:crplreference or http://knucklecracker.com/wiki/doku.php?id=crpl:docs:setimagecolor.  And specifically, 'self' gets a UID, not an image slot.  I would imagine the default image is in slot '0', or slot 'default', so why not try that?
Title: Re: Changing appearence of core dynamically (not images managed by script)
Post by: Molay on May 29, 2013, 04:05:00 PM
I found it!
Here: http://knucklecracker.com/wiki/doku.php?id=crpl:docs:addscripttounit (http://knucklecracker.com/wiki/doku.php?id=crpl:docs:addscripttounit)

One got to use "main" as the second parameter.

Would be nice to have that in the wiki.

Am I allowed to modify the appropriate entries of the crplreference page to clarify that, or do we have dedicated personnel for the wiki? :)
Title: Re: Changing appearence of core dynamically (not images managed by script)
Post by: Michionlion on May 29, 2013, 04:17:21 PM
You can do that if you are registered and feel that it is useful information.
Title: Re: Changing appearence of core dynamically (not images managed by script)
Post by: Molay on May 29, 2013, 04:45:34 PM
Okay :)
Well it left me seeking, wondering and opening a thread for it. So I edited it. Makes it more convenient for others in the future :)
Title: Re: Changing appearence of core dynamically (not images managed by script)
Post by: Grauniad on May 29, 2013, 07:23:21 PM
Quote from: Molay on May 29, 2013, 04:05:00 PM


Would be nice to have that in the wiki.

Am I allowed to modify the appropriate entries of the crplreference page to clarify that, or do we have dedicated personnel for the wiki? :)

Yes please, the wiki free for all to contribute.