Limit Colour palette

Discussion and feedback on Construct 2

Post » Fri Feb 06, 2015 8:32 am

Hey guys, anyone who any way to limit the colour palette that Construct 2 uses?

I'm making a 8-bit game using the NES colour palette, and I'm using the inverse effect for enemy sprites, but the inversed colours aren't consistent to the colour palette. Anybody know how to limit the colour palette that effects use?

EDIT: Alternatively, anybody know how to do something like,
Set Animation to | "CurrentAnimationName + X" and have it play that? And then "CurrentAnimationName - X" and again, play that?

Double Edit: Or anyone know a plugin that can change specific colours to other colours and can be enabled and disabled?
The moderators are corrupt and ban for no reason, especially that condescending neckbeard asshole Kyatric. The forums are filled with fanboys.
Banned User
B
22
S
7
G
1
Posts: 558
Reputation: 2,925

Post » Fri Feb 06, 2015 9:06 am

I think in this case the easiest thing to do is just make a new animation of your sprites that are inverted


And to aswer your Edit ? do exactly what you typed do set animation by name "Animation" +1 or -1 and set your animation names to Animation0 animation1 ect...
B
42
S
17
G
2
Posts: 850
Reputation: 6,209

Post » Fri Feb 06, 2015 9:48 am

volkiller730 wrote:I think in this case the easiest thing to do is just make a new animation of your sprites that are inverted


And to aswer your Edit ? do exactly what you typed do set animation by name "Animation" +1 or -1 and set your animation names to Animation0 animation1 ect...


I mean like, Play Animation "X + Y" and have it play "XY", I tried using & and + but I can't make it connect the words to form just the one word so it selects the XY animation.


Also, I got a new effect RGBrighter, but the best I can do with that is just make the sprite completely blue.


The point of this is to have the enemy sprites change colour, exactly how they would in the Metroid games when shot with the ice beam. So far I've managed to get them to freeze and unfreeze and flash before unfreezing, I just need the colour change.
The moderators are corrupt and ban for no reason, especially that condescending neckbeard asshole Kyatric. The forums are filled with fanboys.
Banned User
B
22
S
7
G
1
Posts: 558
Reputation: 2,925

Post » Fri Feb 06, 2015 1:57 pm

Try this, it uses a bit of text manipulation on the sprite.animationname value and should work with any numbered animation names. I suggest putting it into a function that, when called, will toggle the animation from Animation0 to Animation1 and back again.


Code: Select all
left(Sprite.AnimationName, len(Sprite.AnimationName) - 1) & ((int(mid(Sprite.AnimationName, len(Sprite.AnimationName) - 1, 1) ) + 1) % 2)
B
63
S
16
G
63
Posts: 2,170
Reputation: 39,987

Post » Fri Feb 06, 2015 3:39 pm

Colludium wrote:Try this, it uses a bit of text manipulation on the sprite.animationname value and should work with any numbered animation names. I suggest putting it into a function that, when called, will toggle the animation from Animation0 to Animation1 and back again.


Code: Select all
left(Sprite.AnimationName, len(Sprite.AnimationName) - 1) & ((int(mid(Sprite.AnimationName, len(Sprite.AnimationName) - 1, 1) ) + 1) % 2)


Do I put this in an event or? Never used text before in that way. This is just for numbered animations, not animations with words?
The moderators are corrupt and ban for no reason, especially that condescending neckbeard asshole Kyatric. The forums are filled with fanboys.
Banned User
B
22
S
7
G
1
Posts: 558
Reputation: 2,925

Post » Fri Feb 06, 2015 3:43 pm

If you label your animations "Animation0" and "Animation1" - any word followed by a zero or a one - then this code will change the animation from one to the other. See the attached - I hope this is clearer...!! I should have added above that you insert this code into the set animation event for a sprite.
You do not have the required permissions to view the files attached to this post.
B
63
S
16
G
63
Posts: 2,170
Reputation: 39,987

Post » Fri Feb 06, 2015 7:11 pm

@Colludium

You are a brilliant genius, thank you so much! You get a special thanks credit in my games credits :)
The moderators are corrupt and ban for no reason, especially that condescending neckbeard asshole Kyatric. The forums are filled with fanboys.
Banned User
B
22
S
7
G
1
Posts: 558
Reputation: 2,925

Post » Fri Feb 06, 2015 8:18 pm

:)
B
63
S
16
G
63
Posts: 2,170
Reputation: 39,987

Post » Fri Feb 06, 2015 8:23 pm

You can also use TokenAt() to pick a name.

NumberToChangeTo=2
Set Animation to tokenat("Default,AnimB,AnimC,AnimD",NumberToChangeTo,",")

would set the animation to "AnimC"
B
209
S
54
G
30
Posts: 897
Reputation: 37,131

Post » Fri Feb 06, 2015 9:31 pm

Paradox wrote:You can also use TokenAt() to pick a name.

NumberToChangeTo=2
Set Animation to tokenat("Default,AnimB,AnimC,AnimD",NumberToChangeTo,",")

would set the animation to "AnimC"


Sorry but I can't really understand that, even though I've been using Construct 2 since June, I'm still pretty green.
The moderators are corrupt and ban for no reason, especially that condescending neckbeard asshole Kyatric. The forums are filled with fanboys.
Banned User
B
22
S
7
G
1
Posts: 558
Reputation: 2,925

Next

Return to Construct 2 General

Who is online

Users browsing this forum: Yahoo [Bot] and 2 guests