Color cycle: water effect & game dialogs 
Author Message
 Color cycle: water effect & game dialogs

I'm making an RPG, in which I want to use color cycling to
make water animation. My attempts so long haven't had
any good results. Can someone tell me how to write a routine
for cycling, and how to draw the water tile(s)?
I use a sorted palette layout, so I won't need to search for
darker/brighter colors.

Second, I'll have dialogs with NPCs in the game.
I've tried to work out (in my mind) a file format to
save the branching dialog trees, but with not much sucess.
The best result would be a function like this:

FUNCTION dialog (filename$)
        OPEN filename$ FOR INPUT7BINARY...
        Read file with dialog tree
        Interact with player:
                print NPC text
                player select from talk list
        Return result of dialog.
END FUNCTION

Or perhaps:

SUB dialog (filename$)
        OPEN filename$ FOR INPUT/BINARY...
        Read file with dialog tree and
        corresponding action numbers(tags)
        Interact with player:
                print NPC text
                player select from talk list
                if certain tags is activated:
                        call AialogAction tag
END SUB

The second will give much more flexibility.
Can anyone help me a bit here?
Is there other, perhaps easier ways to do this?
I really don't want to make 100's of lines with
do:loop's and select case's for each dialog!

Thanks in advance!
As soon as this is done, I'll probably release a demo.

(if you could please send any answers by email too,
I'd be grateful. I'm going on vacation soon.)

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

http://www.*-*-*.com/



Mon, 25 Dec 2000 03:00:00 GMT  
 Color cycle: water effect & game dialogs


Quote:
>I'm making an RPG, in which I want to use color cycling to
>make water animation. My attempts so long haven't had
>any good results. Can someone tell me how to write a routine
>for cycling,

Yep. Simply, its a matter of setting the palette values, to what you
want, storing them into an array, then cycling them.

I'm not sure how much you know, so check the helpfile for the function
PALETTE. Essentially, if you want to set a colour value to a certain
colour, use the command:

PALETTE c% , red%, green% * 256, blue% * 65536

where red%, green% and blue% are integers between 0 and 63 to
represent the intensity of that colour in the RGB system. And c% is
the colour to be used.

You can set your palette (colours 1 to 63, say in SCREEN 13) to go
from black to red like:

FOR c% = 1 TO 63
PALETTE c%, c%    'increasing the intensity of red with c%
NEXT c%

this is the most simple example. You can do harder things like a blue
to white palette (which is probably what you'll need for water) like:

FOR c% = 1 TO 63
PALETTE c%, c% + (c%*256) + (63*65536)
NEXT c%

in this example, you've got colour 1 as full blue (no red, no green
and full blue) going to white (full red, green and blue).

Once you've got the hang of this, you can store the values into an
array:

DIM pal(63) AS LONG 'need long integers, big numbers

FOR c% = 1 TO 63
pal(c%) = c% + (c%*256) + (63*65536)
NEXT c%

(you'll need to PALETTE these later)

once in an array, you can cycle them using:

DO
FOR x% = 1 TO 62 'Note one less than the colour number
pal(x%) = pal(x%+1) 'eg colour 23 becomes colour 24 etc.
PALETTE x%, pal(x%)
NEXT x%
pal(63) = pal(1) 'cycling the last colour to the first
LOOP WHILE -1

Quote:
>and how to draw the water tile(s)?

Now that's harder, It will have to have its random elements, and I
haven't managed to write a decent water routine within the last hour
or so and so I've given up. :)

Quote:
>I use a sorted palette layout, so I won't need to search for
>darker/brighter colors.

Then what I've written may not help, I need information on what
palette you are using and whether there are any spare colours you can
use specifically for the water (the more the merrier).

For working examples, I've got a few programs I've written which
demonstrate the different effects that you can use with palette
cycling. You can download them from:

http://homepages.nildram.co.uk/~papnic/basic_programming.htm

'Plasma', 'Spinning' and 'Plasma demo' are candidates for this. Any
queries, mail me.

Cheers,

Ali



Wed, 27 Dec 2000 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Realtime Bump mapped water effect in Qbasic

2. need help creating a water effect

3. water effect(for the gurus)

4. Colour cycle effect and others

5. cycling colors

6. vb 3.0, how do I do color cycling ?

7. Color Dialog for 216 colors

8. How do I get/set what customized colors are in the color dialog box

9. Filling the picture box eith the color of a common dialog selected color

10. How to achieve gradient dialog title bar effect

11. How to get Gradient Dialog Title Bar effect

12. Printer Setup Dialog has no effect

 

 
Powered by phpBB® Forum Software