Zelaron Gaming Forum

Zelaron Gaming Forum (http://zelaron.com/forum/index.php)
-   RPGMaker (http://zelaron.com/forum/forumdisplay.php?f=188)
-   -   Shop questions (http://zelaron.com/forum/showthread.php?t=29691)

Fledge193 2004-06-01 07:51 PM

Shop questions
 
may sound noobish, but I've had a good idea for some time now....the idea is that you go to a shop and you say buy or whatever....and then a screen shows you the item you are buying...then you can move left and right to buy and stuf....etc. etc.....so can anyone help me on this? I've got the images but i just need the coding...

thanks ^^

BlueCube 2004-06-02 06:07 AM

Why not just use the default shop? That said, I don't know what the setup is going to be like (just one item on the screen at a time? Or a few?) and how big the items basically are.

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

With just one, it's a bit easier to set up. You just need to display the first picture at whatever coordinates you want, and capture the keys that the player is going to need - namely left, right, cancel, and enter. You then just change the one picture accordingly, based on whatever item you're on.

PSEUDOCODE:

<>Display picture of item (probably with price right on the picture)
<>Set variable [0055:ItemNumber] to 1
<>Start Loop
___<>Key input processing -> [0001:KeyCaptured]
___<>Comment: -----------------------------------------------
___<>Branch if Var [0001:KeyCaptured] is 2 (Left Key)
______<>ItemNumber = ItemNumber - 1
______<>
___:End
___<>Comment: -----------------------------------------------
___<>Branch if Var [0001:KeyCaptured] is 3 (Right Key)
______<>ItemNumber = ItemNumber + 1
______<>
___:End
___<>Comment: -----------------------------------------------
___<>Branch if Var [0001:KeyCaptured] is 5 (OK Key)
______<>Comment:------
______<>Comment: Buying Subroutine Goes Here
______<>Comment: Check for amount of gold, add +1 item based on
______<>Comment: ItemNumber variable, take away gold, then continue
______<>Comment: ------
___:End
___<>Comment: -----------------------------------------------
___<>Branch if Var [0001:KeyCaptured] is 6 (Cancel Key)
______<>Break out of loop
______<>
___:End
___<>Comment:-------The Part Below "wraps" the item list around-----
___<>Branch if Var [0055:ItemNumber] is 0
______<> ItemNumber = Maximum number of items
______<>
___:End
___<>Branch if Var [0055:ItemNumber] > Maximum Items
______<> ItemNumber = 1
______<>
___:End
___<>Comment:-----Picture changes happen here, add how many you need-----
___<>Comment:---Yes, picture will "change" even if you buy something instead---
___<>Comment ---of moving (of course, it will "change" to the same item thing)---
___<>Branch if ItemNumber = 1
______<>Change picture to "Potion"
______<>
___:End
___<>Branch if ItemNumber = 2
______<>Change picture to "Sword"
______<>
___:End
___<>Branch if ItemNumber = 3
______<>Change picture to "Shield"
______<>
___:End
___<>
:End (Loop)

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

I just threw that together. I'll have to do more when I get home..

Fledge193 2004-06-02 05:42 PM

well put it this way:

I want to have you go to a guy....select buy from the guy....then it will go to a screen

That sceen will show, let's say, a shield (picture). It will have a button that says buy
left and right.......select left/right it will go to next/previous shield/weapon and buy...adds the item and takes away that much gold....like that....when you press ESC it will exit......is that possible?


The code you showed me MIGHT work...i'll have to try it out later

BlueCube 2004-06-03 01:40 PM

Quote:

Originally Posted by Fledge193
well put it this way:

I want to have you go to a guy....select buy from the guy....then it will go to a screen

That sceen will show, let's say, a shield (picture). It will have a button that says buy
left and right.......select left/right it will go to next/previous shield/weapon and buy...adds the item and takes away that much gold....like that....when you press ESC it will exit......is that possible?


The code you showed me MIGHT work...i'll have to try it out later

Well, the code itself won't work directly - it's pseudocode, which isn't real code (just set up like it). The general setup is there though, where it branches and such.

But if you want left/right buttons displayed on-screen, you can just add another static picture with << and >> arrows on it. Heck, you can even the ESC to quit, ENTER to buy commands on there as well. Basically, dress it up however you want - the real issue is the picture that changes, which should be controlled with a variable that gets +1 or -1 to it, depending on the direction chosen.

And I just got up at 3:00 PM here. I should really get to bed eariler..


All times are GMT -6. The time now is 03:02 AM.

Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
This site is best seen with your eyes open.