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

Joined: 08 Jun 2004 Posts: 460 Location: Reims, France
|
Posted: Sun Oct 08, 2006 4:34 am Post subject: So? |
|
|
So? Would somoene know how to designate a part of the master palette for a (16 color) sprite?
Thanks in advance fo the help! |
|
| Back to top |
|
 |
TMC On the Verge of Insanity
Joined: 05 Apr 2003 Posts: 3240 Location: Matakana
|
Posted: Tue Oct 10, 2006 6:55 pm Post subject: |
|
|
Could you elaborate? I'm not totally sure what you mean. Do you want to be able to modify that part of the master palette with script commands so that you can fade/tint/etc a sprite onscreen? _________________ "It is so great it is insanely great." |
|
| Back to top |
|
 |
bis_senchi

Joined: 08 Jun 2004 Posts: 460 Location: Reims, France
|
Posted: Tue Oct 10, 2006 10:47 pm Post subject: What I would like to do |
|
|
I would like to store the walking grafic palette of my heroe in a part of the master palette. Then, I will fade the colors and my heroe will stay the same. (as "bright" as before the cutescene start)
Feel free to ask further questions if you still don't understand! |
|
| Back to top |
|
 |
TMC On the Verge of Insanity
Joined: 05 Apr 2003 Posts: 3240 Location: Matakana
|
Posted: Fri Oct 13, 2006 1:04 am Post subject: |
|
|
I hope to add the ability to imoprt multiple master palettes into a game at some point. Without that feature, this is a bit trickier:
Have a look at 'How do I customize the master palette?'
Choose a section of the palette. Things are far easier if you use a row of 16 colours somewhere (prehaps you don't need 16 colours) and keep the rest of the palette untouched. It would be a good idea to choose a set of colours you don't use very much.
So start with the default 'Master Palette', and replace a row with the colours you use in the 16 colour palette for your hero. Create a MAS file, import it, and create a 16 colour palette for your hero sprite that uses those 16 colours instead of where they appear elsewhere on the palette.
You need to make sure that none of the rest of the graphics in the scene use that row of colours. One way to do this could be to wipe that row with black, import the .MAS file, and check all your npc and tile sprites.
When you're done, reimport the original OHR .MAS palette (or other palette), it's ohrrpgce.mas.
Ok, now the tricky bit. 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 prehaps fade back in)
5) Resets hero palette
BTW: Important note: You might want to display a textbox when the palette is faded out?
Uh, I'll discuss the rest of the details in another post. What do you want to display onscreen when everything but the hero is faded out? Do you want to fade everything out to black or just make it dimmer/grayscale? _________________ "It is so great it is insanely great." |
|
| Back to top |
|
 |
bis_senchi

Joined: 08 Jun 2004 Posts: 460 Location: Reims, France
|
Posted: Fri Oct 20, 2006 11:45 pm Post subject: Thank you very much. |
|
|
I will see what I can do with that later. Anyway I would like to know how do I use while loop in my autorun map so that my script interpreter don't overload.
I would also like some advice to use correctly global variables in runing and stoping while loops combined with autonumber scripts. Are there important things to know about it?
Thanks in advance for helping! |
|
| Back to top |
|
 |
msw188
Joined: 02 Jul 2003 Posts: 1041
|
Posted: Sat Oct 21, 2006 9:58 am Post subject: |
|
|
Seeing the script in question might help. I have used global variables in my while loops before, I don't think that there is anything wrong with that. The important thing is to avoid calling the script again while the old one is still running (or at least, that is one important thing). For example, if you have a map autorun script that has a while loop to make it run indefinitely, and your map has doors that lead to itself, everytime you go through a door you will call the script again so that you end up with many copies of the same script running on top of each other. My first suggestion would be to have a tag that keeps track of whether a script is running. Something like this:
| Code: |
script, mapautorun, begin
if(checktag(tag:map script is running)==false),then
#make sure script
#isn't already running
begin
set tag(tag:map script is running, true)
#turn on 'script running' tag
while(YOUR STUFF),do
begin
YOUR STUFF
end
set tag(tag:map script is running, false)
#if the while loop runs out
#then we aren't running the script anymore
end
end
|
Does that help at all? I am not sure what you mean by having the globals run and stop the loops "combine with autonumber scripts". What are the autonumber scripts doing? Are they called in the while loop? Do they have while loops in them? It is dangerous to call any script in a while loop if the while loop does not have a 'wait' command somewhere (or else the while loop will keep repeating without waiting for the autonumber script to finish whatever it was doing).
[edit]I tried to make the code a little easier to read.
Last edited by msw188 on Mon Oct 23, 2006 6:36 am; edited 1 time in total |
|
| Back to top |
|
 |
TMC On the Verge of Insanity
Joined: 05 Apr 2003 Posts: 3240 Location: Matakana
|
Posted: Sun Oct 22, 2006 8:13 pm Post subject: |
|
|
| msw188 wrote: | | It is dangerous to call any script in a while loop if the while loop does not have a 'wait' command somewhere (or else the while loop will keep repeating without waiting for the autonumber script to finish whatever it was doing). |
Not true, the OHR currently only supports one active script at once, and it certainly doesn't run multiple script interpreter instances in seperate threads. When a script is called, the calling script is paused until the callee returns.
The rest of your advice looks good. _________________ "It is so great it is insanely great." |
|
| Back to top |
|
 |
|