Charas-Project

Game Creation => Requests => Tutorials => Topic started by: razzy on January 08, 2010, 11:05:30 AM

Title: Dress change menu
Post by: razzy on January 08, 2010, 11:05:30 AM
Another question by me. >.>   :o

I've been trying to make a sort of dress change item for my game.

(http://img685.imageshack.us/img685/3859/dresschange.png)

In the game. You select an item which calls up this image of a phone. And so far. I've been able to have two outfit changes. But I was wondering if I could have the user scroll through images and decide what to wear. I can't scroll more then one time .

Is there a way for me to add more images for the player to scroll through. and be able to select outfit changes ?
I would like the phone item with the clothes images on the world map not a seperate map.

Thank you for your time .
Title: Re: Dress change menu
Post by: A Forgotten Legend on January 08, 2010, 11:17:09 AM
Do you currently have the cellphone and the dress preview on the phone two images?  If so, then you could just use the key input processing and then use condition braches depending on which way the user was scrolling, I'll think about it later unless someone else beats me to posting a more complete solution.
Title: Re: Dress change menu
Post by: Prpl_Mage on January 08, 2010, 05:19:01 PM
In theory, all you have to do is replace the picture of outfit1 with outfit2 and from outfit2 to outfit3 and outfit3 to outfit1 again -  if the player presses one button. (1>2, 2>3, 3>1)
and then have the same thing but reversed if the player press another button. (1>3, 3>2, 2>1)

Should work in theory at least.
Title: Re: Dress change menu
Post by: razzy on January 11, 2010, 07:43:32 PM
In theory, all you have to do is replace the picture of outfit1 with outfit2 and from outfit2 to outfit3 and outfit3 to outfit1 again -  if the player presses one button. (1>2, 2>3, 3>1)
and then have the same thing but reversed if the player press another button. (1>3, 3>2, 2>1)

Should work in theory at least.

How exactly would I put that together with rpg maker 2003 ?

I'm just using a different cell phone image each time.
Title: Re: Dress change menu
Post by: SaiKar on January 11, 2010, 08:13:53 PM
Two images - one, the majority of the cell phone that remains constant and one that is the dress you're currently looking at. You'd swap that second picture for a different picture of a different outfit each time they press a button.

Using one picture with a different cell phone image also works and is easier to program, but it would mean bigger picture files, which you may or may not care about.
Title: Re: Dress change menu
Post by: razzy on January 12, 2010, 01:46:17 AM
How would it have to be put together though... Hoping for an answer to that. 
Title: Re: Dress change menu
Post by: Prpl_Mage on January 12, 2010, 07:17:41 PM
sttttttttttttttttttttuf

edit: holy crap! I can post again!

edit2:

Okay here we go.

It should work in theory so let's put the theory into test.

First when the picture is up you'll need a key input process thingy. First page if i remember it correctly.
It will be used to check what button is pressed.

Then we'll need the conditional branch right after.
It will check the value of the variable you stored the key input in.
If it is one of the desired values: show picture: (whatever clothing you want).
and then you do that for a bunch of different values. And then when you click the action button(or whatever you have planned to accept the choice of clothes) then it will check the value of the variable and then change the sprite association (and class or what you had in mind).

And about what Sai said.
You can have the cellphone as one picture and then the pictures of all the outfits as different pictures. That way you can simply start by showing picture 1: the phone and then simply change picture2(the outfits).

I hope you get it.
Title: Re: Dress change menu
Post by: razzy on January 12, 2010, 07:59:43 PM
I'll be trying this later today.

So for the key input process. Under "keys to process" Should all the boxes be checked ? *Down key , left ket , right key, up key, decision key, and shift key?*

And just store this in a single key code *one variable* .

As for the conditional branch. Do I choose this variable I stored the keys in. * I'm thinking I do*  Do I change anything to the number value ? Or the equal to , less than , greater than options ? How many outfit changes/pictures can I have with this system ?

Thanks for taking the time to read all this.

Title: Re: Dress change menu
Post by: razzy on January 15, 2010, 04:42:28 AM
anyone ? :/
Title: Re: Dress change menu
Post by: Prpl_Mage on January 15, 2010, 02:27:58 PM
Sorry.

Okay to answer the question.
The value of the Variable after the key input process depends simply on what you clicked during it.

I think it's like this:
Down=1
Left=2
Right=3
Up=4
Action key=5
Cancel key(menu)=6
7,8,9 are not used.

Then you have the numbers between 0 and 9.
basically, the value of them is the number you press only you throw in a 1 at the begining.
0 = 10
1 = 11
2 = 12
3 = 13
4 = 14
5 = 15
6 = 16
7 = 17
8 = 18
9 = 19

So If you pressed the cancel key the value of the variable will be 6. In the conditional branch afterwards you have it check if the varaible is equal to 6. Then play whatever should happen if the player pressed the cancel button.

So how many different outfits you want the player to choose from pretty much decides how many different buttons the player should be able to chose from.
And yes, you store the value of the press in a variable and you use that very same variable in the conditional branch.
And then you might want to reset it to 0 afterwards otherwise the commands for balue? 14 will play over and over.

As for the amount of outifts you can have? I'd say 21 or 20 if you just want them click the button to fit the dress.
But if you want them to scroll then you cna do it like this I think. Another theory but might be a bit mroe precise this time around.

------------------------------------------------

We want to shape this kinda like a book. say you want 10 outfits. we go from 1 -> 10
so they will in theory be lined up 1,2,3,4,5,6,7,8,9,10.
The pages, or screens are in fact pictures of the different outfits. Say outfit 1 is a teddy suit and outfit 2 is a basketball. So when you open up the system the picture of the phone will be displayed and above that picture - the picture of the teddy suit.
This is where you start and the only thing that differs the screens/pages is the fact that if you click the action button: you'll start the event that let you change into THAT outfit.
For this entire thing we should only need like 2 variables I suspect.
1 that checks what page you're on(what cloth is displayed) and one that checks what buttons are pressed.

Insert a Loop:

Key input process:
direction keys
Action key
cancel key
[store the value in a variable]

(And here comes the conditional branches based on the key input)

If the value is 3(right)
  If [The page VAR] is lower than or equal to 9
 variable operations: [the page VAR] add 1
(this prevents you from going to page 11 from page 10 when there is no outfit or anything for page 11)

If the value is 2(left)
  If [The page VAR] is greater than or equal to 2
 variable operations: [page VAR] remove 1
(this prevents you from going to page 0 from page 1)

If the value is 5(action key)
   If [the page VAR] is equal to 1
     Change class/sprite association(or whatever you had in mind) to : Teddybear outfit(or whatever you want)
   If [the page VAR] is equal to 2
     Change class/sprite association(or whatever you had in mind) to : basketball outfit(or whatever you want)
   ::::::::::::Rinse and repeat for all the pages with the right change of the character.:::::::::::

If the value is 6(cancel)
Turn off the event(if you want something like that)

Jump to loop:
------------------------------------------------

I might have to explain this a it more I guess.

Basically, the pages is one variable. When you chose an outfit (action key) there will be conditional branches checking the value of the page you're on. In other words: if you're on page one - you add so that you show the picture of outift one and the value of the page VAR is 1.
But if you press right instead of the action key - the varaible will be given 1. So the page VAR will suddenly become 2. So your event swaps the picture of outift 1 to outfit 2.
And if you press left, you will subtract 1 from the page var and you'll go back down to page 1 and the picture of page 1.
The conditional branches under the LEFT and RIGHT clicks are safety. If you're on page 1, nothing happens if you press left. If you're on page 10(or whatever you want your max ammount ot be) you can't go more to the right.
If you want you can change that check instead. So that if you are on page 1 and presses left you SET the variables value EQUAL TO 10 so that you jump to page 10 directly. And if you press right on the 10th page - you set the value to 1.

I hope this makes sense now.


Edit: I kinda realized that I never mentioned the part with the pictures. Basically you add conditional branches under the left and right checks. So if the variable for the page is 1, you have a conditional branch that adds that picture and remove the old one. And you do it for every page. Kinda like the accept thingy only you have it to show the pictures and not change the character's look.
Title: Re: Dress change menu
Post by: Drakiyth on February 10, 2010, 05:29:37 AM
It's really easy man.


You make a common event which brings up the little picture/cell phone thing when you summon it with your item.  (you got that part down so here is the missing link)


To scroll through left or right you need to simply add a variable called "Scroll"   If you have 10 clothes it would be like this.  


You would first need to make sure "Scroll" was set to a middle number when you brought up the interface..  or start at 5 or 6 on the below chart.

1,2,3,4,5,LEFT <--( CELL PHONE PIC)--> RIGHT  6,7,8,9,10       If you push the right key it adds +1 to Scroll and goes to 6. Press it again it's 7.  Press it again it's 8 then 9,10 and then loops back to 1.    If you press left it subtracts -1 to scroll and goes to 5,4,3,2,1 loops back to 10.

TIP:  To make it loop set a conditional branch that says If: variable "Scroll" is higher then 10 set the variable to 1.
                                                                                If: variable "Scroll" is lower then 1 set the variable to 10.

Hope that helps.