Colourising a textured fill tool
![Mythal82](https://secure.gravatar.com/avatar/1e8662048bd4a4831cbec434b6cebbc7/?default=https%3A%2F%2Fvanillicon.com%2Fd247b7efeb868189fbc1c5bfd81e0b8b_200.png&rating=g&size=200)
Hi everyone!
Sorry if this is answered elsewhere - I Googled, but nothing quite came up. Inspired by the recent Ruins annual, and my experiments texturing the Ferraris city style, I decided to explore making a custom template for future city projects. I'm aiming for something with a pencil-esque finish for the urban blocks and buildings, so I've gone with a fractal shape base tool, with a texture fill. I'm creating an extra entity for the outline (thin black line, which I'm distorting with a watercolour texture and blurring slightly).
What I'd really like to do, though, is colourise the urban block based on the colour selected when I create it. Obviously I can do that if I don't texturise it, and if I didn't have the pencil-esque edge I could do it with an extra entity - but is there a way for me to do it while still having all of those things? (Having my cake and eating it too?) Basically, so I can get the effect below, without colourising an entire layer:
Best Answers
-
Mythal82 🖼️ 19 images Traveler
So, to update, I've managed to sort the issue in a roundabout way. There are three sheets - BCOLOR (lowest), BUILDINGS (mid), BWALLS (top):
i) Main object contains the texture, goes to BUILDINGS layer (which has an edge fade effect and caps at 15% opacity a few units in)
ii) Outline command duplicates the poly, assigns it the currently selected colour, and saves it to the BCOLOR layer (which has a slight texturisation effect from a seamless watercolor bitmap, a wall shadow, and a slight glow)
iii) Macro then SELBYPs the shape, sets width to 0.5, and sends it to BWALLS layer (which has a few effects but, importantly, a colorize effect as I want all wall lines to be pencil-black).
The Macro code is:
SELBYP
COPYSHT BWALLS
CHANGEFS SOLID
CHANGELW 0.5
CHANGEC BLACK (Doesn't seem to work, hence the colorizer effect in BWALLS)
Here's the result when output at a reasonable resolution:
Might seem like a lot of work for minimal return, but I like it!
-
Monsen Administrator 🖼️ 51 images Cartographer
Good work.
CHANGEC requires a color number (black is 0), so unless you have defined a variable called BLACK and set it to 0, that's why it fails for you.
-
Monsen Administrator 🖼️ 51 images Cartographer
GE vshape SELBYP
GV vrandom RANDOM*360
You cannot use the commands like that. SELBYP doesn't return entities that can be stored in a variable, all it does is change the selection mode to be by prior instead of the normal selection procedure. Also note that GE doesn't actually store an entity, it stores a set of coordinates where the entity is located, that can be used to grab the entity but it doesn't store the entity itself.
Likewise, RANDOM doesn't have a return value. The command is used very similar to the GV and similar command, i.e.
RANDOM varname
will cause a random number between 0 and 1 to be stored in varname. You can then manipulate this further.The SHADEPOLY command also need a second argument for the pitch.
Also be careful with those semi-colons. Commands in CC3+ are executed by using either a new line OR a semicolon. Using both means you are basically creating an empty line, and in CC3+ that means repeat the previous command.
You can find the correct syntax of all the commands in the table in the tome, or in the spreadsheet in
@documentation\tome\commands.xlsx
Answers
Further to this, I've made a little progress using draw tool macros. The plan is simple:
Base object has the semi-transparent tile texture (middle layer)
First copy is the colour layer - copies the shape, sets fillstyle to solid, and colorises it (bottom layer)
Second copy is the wall layer - copies the shape, sets fillstyle to solid, sets width to 0.5, and colors it black (top layer)
The steps work individually, but when I combine them there's a selection issue.
The complete macro is:
SELBYP
COPYSHT BCOLOR
CHANGEFS SOLID
CHANGEC
COPYSHT BWALLS
CHANGEFS SOLID
CHANGELW 0.5
CHANGEC BLACK
When I run this, I get an error saying copysht bwalls doesn't have a selection to copy. But if I add another SELBYP just before the second COPYSHT, it doesn't fix the issue. I've tried assigning the initial selection a variable name using STORE, then referencing the variable using SELECT, but that doesn't seem to work either (I'm unsure if I'm declaring the variable correctly - the alphabetical instruction list doesn't have a command for declaring a variable, so I just tried giving it a unique name on the STORE line, then SELECTing that name).
Any and all assistance gratefully received!
So, to update, I've managed to sort the issue in a roundabout way. There are three sheets - BCOLOR (lowest), BUILDINGS (mid), BWALLS (top):
i) Main object contains the texture, goes to BUILDINGS layer (which has an edge fade effect and caps at 15% opacity a few units in)
ii) Outline command duplicates the poly, assigns it the currently selected colour, and saves it to the BCOLOR layer (which has a slight texturisation effect from a seamless watercolor bitmap, a wall shadow, and a slight glow)
iii) Macro then SELBYPs the shape, sets width to 0.5, and sends it to BWALLS layer (which has a few effects but, importantly, a colorize effect as I want all wall lines to be pencil-black).
The Macro code is:
SELBYP
COPYSHT BWALLS
CHANGEFS SOLID
CHANGELW 0.5
CHANGEC BLACK (Doesn't seem to work, hence the colorizer effect in BWALLS)
Here's the result when output at a reasonable resolution:
Might seem like a lot of work for minimal return, but I like it!
Good work.
CHANGEC requires a color number (black is 0), so unless you have defined a variable called BLACK and set it to 0, that's why it fails for you.
Do you happen to know of any way to randomise the alignment of the textures? Or at least make them unique to the object? (Which wouldn’t break the initial solution!)
I haven't tried this, so don't know if it works but you should be able to use a series of commands:
RANDOM - to generate a random number (multiply the result of the command by 360 to get random degrees)
SHADEPOLY - to make it a shaded polygon at the randomized angle
SETFSFLAGS 192 - Turns off shading by light, leaving only rotation.
Thanks for the advice - I've tried it, but I think I'm having some syntax issues (errors with object selection). I've tidied up my macro, and compared my syntax to some of the examples in ToUM and it seems to hang together, but evidently I'm missing something. Here's the macro itself:
SELSAVE
SAVESETTINGS
GE vshape SELBYP
GV vrandom RANDOM*360
SELECT vshape
SHADEPOLY vrandom;
SELECT vshape
SETFSFLAGS 192;
SELECT vshape
COPYSHT BWALLS
CHANGEFS SOLID
CHANGELW 0.2
CHANGEC 0;
GETSETTINGS
SELREST;
GE vshape SELBYP
GV vrandom RANDOM*360
You cannot use the commands like that. SELBYP doesn't return entities that can be stored in a variable, all it does is change the selection mode to be by prior instead of the normal selection procedure. Also note that GE doesn't actually store an entity, it stores a set of coordinates where the entity is located, that can be used to grab the entity but it doesn't store the entity itself.
Likewise, RANDOM doesn't have a return value. The command is used very similar to the GV and similar command, i.e.
RANDOM varname
will cause a random number between 0 and 1 to be stored in varname. You can then manipulate this further.The SHADEPOLY command also need a second argument for the pitch.
Also be careful with those semi-colons. Commands in CC3+ are executed by using either a new line OR a semicolon. Using both means you are basically creating an empty line, and in CC3+ that means repeat the previous command.
You can find the correct syntax of all the commands in the table in the tome, or in the spreadsheet in
@documentation\tome\commands.xlsx
Thanks for this! After a little meddling, following your advice, I've managed to get this working. I've also added a more subtle randomisation to the pitch, which has the added benefit of giving 'similar-but-not-the-same' colorisation when constructing a block of a given colour - which is something that always appeals to me. I've made a tool for each texture using the same macro, which helps further with the variety.
Here's an example of the eventual output: