Castle Paradox Forum Index Castle Paradox

 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 Gamelist   Review List   Song List   All Journals   Site Stats   Search Gamelist   IRC Chat Room

Problem with the load menu command
Goto page Previous  1, 2, 3
 
Post new topic   Reply to topic    Castle Paradox Forum Index -> HELP!
View previous topic :: View next topic  
Author Message
bis_senchi




Joined: 08 Jun 2004
Posts: 460
Location: Reims, France

PostPosted: Sun Oct 08, 2006 4:34 am    Post subject: So? Reply with quote

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
View user's profile Send private message Visit poster's website MSN Messenger
TMC
On the Verge of Insanity




Joined: 05 Apr 2003
Posts: 3240
Location: Matakana

PostPosted: Tue Oct 10, 2006 6:55 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
bis_senchi




Joined: 08 Jun 2004
Posts: 460
Location: Reims, France

PostPosted: Tue Oct 10, 2006 10:47 pm    Post subject: What I would like to do Reply with quote

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" Idea as before the cutescene start)

Feel free to ask further questions if you still don't understand!
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
TMC
On the Verge of Insanity




Joined: 05 Apr 2003
Posts: 3240
Location: Matakana

PostPosted: Fri Oct 13, 2006 1:04 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
bis_senchi




Joined: 08 Jun 2004
Posts: 460
Location: Reims, France

PostPosted: Fri Oct 20, 2006 11:45 pm    Post subject: Thank you very much. Reply with quote

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
View user's profile Send private message Visit poster's website MSN Messenger
msw188




Joined: 02 Jul 2003
Posts: 1041

PostPosted: Sat Oct 21, 2006 9:58 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
TMC
On the Verge of Insanity




Joined: 05 Apr 2003
Posts: 3240
Location: Matakana

PostPosted: Sun Oct 22, 2006 8:13 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    Castle Paradox Forum Index -> HELP! All times are GMT - 8 Hours
Goto page Previous  1, 2, 3
Page 3 of 3

 
Jump to:  
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