I'm having a bit of trouble with one aspect of the palette-tweaking commands "get color" and "set color" and was hoping someone could shed some light on the matter. What's happening is that during a certain period, I'm running a while loop that causes 6 colors from my master palette to change positions with one another (such that the color at the 1st position jumps to the 2nd, the color at the 2nd position jumps to the 3rd,... the 6th to the 1st, and so on). This part works perfectly.
Code:
plotscript, titleanimate, begin
#this is just a reference to the 6 color's original index values
#color1: 253
#color2: 251
#color3: 199
#color4: 151
#color5: 39
#color6: 227
variable(color1)
variable(color2)
variable(color3)
variable(color4)
variable(color5)
variable(color6)
variable(t)
while(checktag(19)==0), do,
begin
for (t,1,6,1), do,
begin
color1:=getcolor(253)
color2:=getcolor(251)
color3:=getcolor(199)
color4:=getcolor(151)
color5:=getcolor(39)
color6:=getcolor(227)
setcolor(227,color5)
setcolor(39,color4)
setcolor(151,color3)
setcolor(199,color2)
setcolor(251,color1)
setcolor(253,color6)
updatepalette
wait(1)
end #end for loop
end #end while loop
end #end script
plotscript, titleanimate, begin
#this is just a reference to the 6 color's original index values
#color1: 253
#color2: 251
#color3: 199
#color4: 151
#color5: 39
#color6: 227
variable(color1)
variable(color2)
variable(color3)
variable(color4)
variable(color5)
variable(color6)
variable(t)
while(checktag(19)==0), do,
begin
for (t,1,6,1), do,
begin
color1:=getcolor(253)
color2:=getcolor(251)
color3:=getcolor(199)
color4:=getcolor(151)
color5:=getcolor(39)
color6:=getcolor(227)
setcolor(227,color5)
setcolor(39,color4)
setcolor(151,color3)
setcolor(199,color2)
setcolor(251,color1)
setcolor(253,color6)
updatepalette
wait(1)
end #end for loop
end #end while loop
end #end script
Like I said, that works perfectly. What DOESN'T work is that when I break the while loop by turning tag 19 on and using a door, the master palette does not return to its original settings, no matter what I do.
I've tried storing the original RGB values of the 6 colors in variables before the tweaking script is run, then writing them back in after the fact, but no go. Maybe I was just doing this wrong?
Right now, I've gotten so frustrated that I've imported a 2nd copy of the original master palette and was just trying to switch over to it after the tweaking script. To my knowledge, this 2nd master palette should have been uncorrupted, but for some reason, when I load it, it retains the tweaks caused by the tweaking script, instead of the original default values!
Code:
plotscript, titlenewgame, begin
settag(19,on)
loadpalette(2)
updatepalette
usedoor(0)
resumeplayer
end
plotscript, titlenewgame, begin
settag(19,on)
loadpalette(2)
updatepalette
usedoor(0)
resumeplayer
end
Any ideas what is going wrong?
Thanks in advance!
SPELLSHARD: THE BLACK CROWN OF HORGOTH now COMPLETE! Grab it today!



