 |
Castle Paradox
|
View previous topic :: View next topic |
Author |
Message |
bis_senchi

Joined: 08 Jun 2004 Posts: 460 Location: Reims, France
|
Posted: Thu Dec 14, 2006 10:31 pm Post subject: How to designate a part of the master palette? |
|
|
I'e read the article How do I customize the master palette? and I would like to know what part of of palette (let's say column2) correspond to what figures.
I know from a previous answer of the Mad Cacti that said Quote: |
" you have to write a script that":
1) Changes the master palette to the modified one
2) Changes the hero sprite to one using the modified row of colours
3) Fades out the rest of the palette
4) Resets the palette (or perhaps fade back in)
5) Resets hero palette |
I explain myself. Let's says that column 2 is free in my master palette. How do I know the numbers am I suppose to key in?
Could somoene post a basic version of this kind of script? (So that I can be sure that the order and the commands are the ones I need to use)
As always thanks in advance for answering!
Last edited by bis_senchi on Thu Jan 04, 2007 12:36 am; edited 2 times in total |
|
Back to top |
|
 |
Bob the Hamster OHRRPGCE Developer

Joined: 22 Feb 2003 Posts: 2526 Location: Hamster Republic (Southern California Enclave)
|
Posted: Fri Dec 15, 2006 8:50 am Post subject: |
|
|
Code: |
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79
80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95
96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111
112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127
128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143
144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159
160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175
176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191
192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207
208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223
224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239
240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255
|
|
|
Back to top |
|
 |
bis_senchi

Joined: 08 Jun 2004 Posts: 460 Location: Reims, France
|
Posted: Sat Dec 16, 2006 12:48 am Post subject: What sould I put in the script... |
|
|
Ok! Now what commands should I use in my script....
Code: |
define script (6, test stored palette, none)
Global variable (9, MyPal)
# Hero palette stored in global variables?
set variable (mypal, me)
variable(loop)
# gradual fade out
for(loop,0,-21,-1) do(
reset palette
tweak palette(loop*2,loop*2,loop*2,16, 255)
# values given by James goes here ??
write color (0,15, my pal)
write color (1,15, my pal)
write color (2,15, my pal)
update palette
wait(2)
tweak palette (-32, -32 , 0)
# light decrease... and my hero is still the same hourra!
wait (2)
update palette
tweak palette (-38, -38 , 0)
wait (2)
update palette
|
Any suggestions of improvement are welcomed! |
|
Back to top |
|
 |
Iblis Ghost Cat

Joined: 26 May 2003 Posts: 1233 Location: Your brain
|
Posted: Sat Dec 16, 2006 3:55 pm Post subject: |
|
|
1) What is the script actually supposed to do in the game? I see a lot of color changing but I don't know what it's for, which makes it harder to determine how to help you.
2) You define the script but don't actually begin it anywhere. You need a "Script, test stored palette, begin" somewhere at the beginning.
3) There doesn't seem to be any end parenthesis for your for loop.
4) I don't understand why you have a "reset palette" command in a loop that's supposed to be changing your palette.
5) The two "tweak palette" commands at the end will take all the color out of your palette except blue. You do know that they both affect your palette independently, right? You've got a total of -70 here which doesn't seem like it could be intentional given that the the highest a color can be is 63.
6) What is "hourra"?
7) Why do you wait before updating your palette? _________________ Locked
OHR Piano |
|
Back to top |
|
 |
bis_senchi

Joined: 08 Jun 2004 Posts: 460 Location: Reims, France
|
Posted: Sun Dec 17, 2006 1:17 am Post subject: sorry for posting the wrong script |
|
|
To iblis
1)and 7) Sorry it seems that I have posted the wrong script. This script was originally a gradual fade out to make day ends. That's why there are wait commands. To make changes gradually. Sorry again for posting it
2) Yes you're write. Ive forgot the line script,test stored palette, begin
and I've also forgot the end
6)Sorry. My bad english came back. I've written "hourra" instead of "hurrah"
Hourra and hurrah have the same meaning but one is written in French and the other one in English.
Anyway, here is my question. I would like to tweak the master palette exept for values 1, 17, 33, 49... until 241 because colors for my heroe are stored here.
What values should I put at the end of the tweak palette command?
Thanks in advance for the help! and sorry for posting the wrong script! |
|
Back to top |
|
 |
TMC On the Verge of Insanity
Joined: 05 Apr 2003 Posts: 3240 Location: Matakana
|
Posted: Mon Dec 18, 2006 5:36 pm Post subject: |
|
|
To tweak the part of the palette you want, this should work:
Code: | variable(i, j)
for (i, 1, 16)
for (j, -1, 15) do (
tweak palette(-4, -4, -4, j * 16 + 2, j * 16 + 16)
)
update palette
wait
) |
That would fade the palette out in about 1 second. _________________ "It is so great it is insanely great." |
|
Back to top |
|
 |
bis_senchi

Joined: 08 Jun 2004 Posts: 460 Location: Reims, France
|
Posted: Tue Dec 19, 2006 12:06 am Post subject: Thanks! But as always I still have another question |
|
|
I will make some tests but its seems to be what I need!
I have some problems with the write color command. I write color but when I tweak the hero's palette the hero stay all black. I've composed the palette in question using the free colors).
May be my hero is black because I've made black the 16 choosen colors in my master palette (so that I know I don't have to use it)
Could somoene give an example showing how to use the write color (and its oposite read color command)?
As always thanks very much for the help! |
|
Back to top |
|
 |
TMC On the Verge of Insanity
Joined: 05 Apr 2003 Posts: 3240 Location: Matakana
|
Posted: Wed Dec 20, 2006 3:29 pm Post subject: |
|
|
Remember that you have to write a updatepalette command after using write color (and possibly also a wait as well). So your code to change the master palette will look something like this:
Code: | write color(1, color:red, X)
write color(1, color:green, X)
write color(1, color:blue, X)
write color(17, color:red, X)
...
write color(241, color:blue, X)
update palette |
_________________ "It is so great it is insanely great." |
|
Back to top |
|
 |
bis_senchi

Joined: 08 Jun 2004 Posts: 460 Location: Reims, France
|
Posted: Thu Dec 21, 2006 9:06 pm Post subject: Hey that's really interesting! |
|
|
Ok! Could explain me why we use color:red, color:blue and color:green when we "write a color" ?
Code: |
write color(17, color:red, X)
write color(17, color:blue, X)
write color(17, color:green, X)
|
As always thanks very much for the help! |
|
Back to top |
|
 |
bis_senchi

Joined: 08 Jun 2004 Posts: 460 Location: Reims, France
|
Posted: Thu Jan 04, 2007 12:34 am Post subject: Could someone tell me where the bugs are? |
|
|
Here is a version of my script in which I store the colors of the hero in my palette and then fade it
Code: |
define script, TestColorsFadeAway, begin
set variable (mypal, get hero palette (me)) # on stoke notre palette
write color(1, color:red, 0) # color 1 (number 0 transparent)
write color(1, color:green, 0)
write color(1, color:blue, 0)
write color (17,color:red, 18) # color 2 (number 18)
write color(17, color:green, 18)
write color(17, color:blue, 18)
write color (33, color:red, 249) # color 3 (number 249)
write color(33, color:green, 249)
write color(33, color:blue, 249)
write color(49, color:red, 240) # color 4 (number 240 dark blue) foncé)
write color(49, color:green, 240)
write color(49, color:blue, 240)
write color (65,color:red, 4) # color 5 (number 4)
write color (65,color:green, 4)
write color (65,color:blue, 4)
write color (81,color:red, 6) # color 6 (number 20)
write color (81,color:green, 6)
write color (81,color:blue, 6)
write color (97,color:red, 86) # color 7 (number 86)
write color (97,color:green, 86)
write color (97,color:blue, 86)
write color (113,color:red, 86) # color 8 (number 190)
write color (113,color:green, 86)
write color (113,color:blue, 86)
write color (129,color:red, 55) # color 9 (number 55)
write color (129,color:green, 55)
write color (129,color:blue, 55)
write color (145,color:red, 55) # color 10 (number 255)
write color (145,color:green, 255)
write color (145,color:blue, 255)
write color (161,color:red, 88) # color 11 (number 88)
write color (161,color:green, 88)
write color (161,color:blue, 88)
write color (177,color:red, 90) # color 12 (number 90)
write color (177,color:green, 90)
write color (177,color:blue, 90)
write color (193,color:red,222) # color 13 (number 222)
write color (193,color:green,222)
write color (193,color:blue,222)
write color (209,color:red, 63) # color 14 (number 63)
write color (209,color:green, 63)
write color (209,color:blue, 63)
write color (225,color:red, 63) # color 15 (number 95)
write color (225,color:green, 63)
write color (225,color:blue, 63)
write color (241,color:red,253) # color 16 (number 253)
write color (241,color:green,253)
write color (241,color:blue,253)
update palette
set hero palette (me, 119)
#palette 119 pre defined for storing hero colors while fading
update palette
wait (35)
variable(i, j)
for (i, 1, 16) do, begin
for (j, -1, 15) do, begin
tweak palette(-4, -4, -4, j * 16 + 2, j * 16 + 16)
end
end
update palette
wait (35)
reset palette
set hero palette (me, mypal)
fade screen in
end #end of the script
|
My problem is the following : when I test the script, my hero became black and white . It was as if the write colors had no effect. Could someone tell me what's wrong with my script?
Thanks very much fo the help! |
|
Back to top |
|
 |
TMC On the Verge of Insanity
Joined: 05 Apr 2003 Posts: 3240 Location: Matakana
|
Posted: Fri Jan 05, 2007 4:19 am Post subject: |
|
|
Oh, you misunderstand writecolor. You don't use it to make one colour in the palette a copy of another, it's used to set the RGB value of a colour, so you can create new colours. But ok, see what you want to do, so use this script:
Code: | script, copy color, dest, source, begin
write color(dest, color:red, read color(source, color:red))
write color(dest, color:green, read color(source, color:green))
write color(dest, color:blue, read color(source, color:blue))
end |
Trivial point, you don't need to updatepalette after setheropalette.
Also, you don't seem to have copied the other code I pasted correctly. Here's what the whole script would look like (complete this):
Code: | define script (autonumber, copy color, 2, 0, 0)
script, copy color, dest, source, begin
write color(dest, color:red, read color(source, color:red))
write color(dest, color:green, read color(source, color:green))
write color(dest, color:blue, read color(source, color:blue))
end
script, TestColorsFadeAway, begin
set variable (mypal, get hero palette (me)) # on stoke notre palette
copy color(1, 0) # color 1 (number 0 transparent)
copy color(17, 18) # color 2 (number 18)
copy color(33, 249) # color 3 (number 249)
... ETC
update palette
set hero palette (me, 119) #palette 119 pre defined for storing hero colors while fading
wait (35)
variable(i, j)
for (i, 1, 16) do, begin
for (j, -1, 15) do, begin
tweak palette(-4, -4, -4, j * 16 + 2, j * 16 + 16)
end
update palette
wait
end
wait (35)
reset palette
fade screen in
set hero palette (me, mypal)
wait
end #end of the script |
Oh, I don't remember what you want to happen at the end. The hero fades to black, and you want it to fade back in instantly or gradually? As the script is above, they should pop back instantly. I'm not totally sure whether the script is correct, I haven't tested it. _________________ "It is so great it is insanely great." |
|
Back to top |
|
 |
bis_senchi

Joined: 08 Jun 2004 Posts: 460 Location: Reims, France
|
Posted: Sat Jan 06, 2007 8:53 pm Post subject: I've made some tests and... |
|
|
The Mad Cacti Quote: | I don't remember what you want to happen at the end |
What I would like to happen at the end is that the screen became black gradually but my hero stays the same (thanks to its special palette)
Anyway a big thanks to the Mad Catci for posting scripts that are so closed to what I need! |
|
Back to top |
|
 |
TMC On the Verge of Insanity
Joined: 05 Apr 2003 Posts: 3240 Location: Matakana
|
Posted: Tue Jan 09, 2007 12:56 am Post subject: |
|
|
But what after that? If you want the scene to fade back in, more plotscripting is required. _________________ "It is so great it is insanely great." |
|
Back to top |
|
 |
bis_senchi

Joined: 08 Jun 2004 Posts: 460 Location: Reims, France
|
Posted: Wed Jan 10, 2007 10:02 pm Post subject: Some more explanations |
|
|
Ok no problem. I don't mind explain what I want clearly. What I would like to
do is the following.
1) Here colors (and ref) are stored. New colors are written in the master palette
2) The screen gradually fade until black BUT the hero is still the same (thanks to what we have done before.
3) A fight start
4) Colors goes back to normal
So what I need is to adpat the gradual fade out script (see below) and redden the master (so that the master palette came back as normal)
Code: |
variable(loop)
# gradual fade out
for(loop,0,-21,-1) do(
reset palette
tweak palette(loop*2,loop*2,loop*2)
update palette
wait(2)
)
|
Feel free to ask futher questions if you still don't understand what I would like to do. _________________ It's time to make games! |
|
Back to top |
|
 |
bis_senchi

Joined: 08 Jun 2004 Posts: 460 Location: Reims, France
|
Posted: Sat Jan 20, 2007 5:31 am Post subject: So? |
|
|
So? If it is not possible feel free t tell it here and explain why! _________________ It's time to make games! |
|
Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|