![]() |
||||||||||||||
|
||||||||||||||
blade2k
» articles & tutorialsCustom Item Menu
This isn't to say that coding my custom item menu didn't take me away from everything else in the world for multiple nights back to back. It's just a hell of a lot of work. Those of you new to this, don't be discouraged. It isn't hard to do. Uncle stick will break it down for you, even: 1. Know beforehand how many items you're going to use in your game. This is essential to creating a Final Fantasy type item menu with tons of items. If you have to, plan for more items than you think you're going to need - just in case. 2. Layout your menu in Photoshop, paint, or whatever. Get the layout down before you start coding and you'll be much better off. Also use this time to design your menu's cursors, sound effects, and any other graphics that will be needed. This way, when you finally do start to coding, you'll have everything you need to work with. 3. Come up with a coding plan before you set to work. Exactly how do you plan on doing this? This can be a tough cookie to think up. I'll just let you know how my item menu works, and then you can work from there. Let's say my item cursor is on the "leather hat." If that's the case, then the switch <b>INV - HLM 1</b> will be turned on. Each item in my CMS has its own switch. The only time that switch is on is when that item is highlighted. The moment the cursor moves to the next item, that switch turns off and the next item’s switch turns on. This is why its important for you have your items planned out beforehand. <b>INV - HLM 1</b> turns on a PP event which tells my game what to do in case: a. The up button is pressed b. The right button is pressed c. The down button is pressed d. The left button is pressed e. The enter button is pressed f. The cancel button is pressed To set this code up, you need to use ENTER PASSWORD, which will set a variable (we’ll use a variable called ENTERPASS, for example) to a certain number. <> enter password [0014: ENTERPASS] <> fork optn: Varb[0014: ENTERPASS]-1 <b>what to do if the DOWN key is pressed</b> <> fork optn: Varb[0014: ENTERPASS]-2 <b>what to do if the LEFT key is pressed</b> <> fork optn: Varb[0014: ENTERPASS]-3 <b>what to do if the RIGHT key is pressed</b> <> fork optn: Varb[0014: ENTERPASS]-4 <b>what to do if the UP key is pressed</b> <> fork optn: Varb[0014: ENTERPASS]-5 <b>what to do if the ENTER key is pressed</b> <> fork optn: Varb[0014: ENTERPASS]-6 <b>what to do if the CANCEL key is pressed</b> As you can tell, the ENTER PASSWORD command sets a specific variable to a specific number according to which direction/action key is pressed. The variable will be set as follows: Down = 1 Left = 2 Right = 3 Up = 4 Enter = 5 Cancel = 6 If you use the code above, you can determine what your game will do in any situation. Here’s how mine works: <> enter password [0014: ENTERPASS] <> fork optn: Varb[0014: ENTERPASS]-1 <b>switch this event’s switch off, turn on the switch of the event below this one</b> <> fork optn: Varb[0014: ENTERPASS]-2 <b>switch this event’s switch off, turn on the switch of the event to the left of this one</b> <> fork optn: Varb[0014: ENTERPASS]-3 <b>switch this event’s switch off, turn on the switch of the event to the right of this one</b> <> fork optn: Varb[0014: ENTERPASS]-4 <b>switch this event’s switch off, turn on the switch of the event above this one</b> <> fork optn: Varb[0014: ENTERPASS]-5 <b>equip/use the item the cursor indicates at the moment</b> <> fork optn: Varb[0014: ENTERPASS]-6 <b>switch this event’s switch off, turn on the switch of the menu before this one</b> Keep in mind, my menu is a simplistic, Metroid-style item menu. Each item has a slot that, if the item is not yet acquired by the person playing the game, appears blank. For a more Final Fantasy type menu where items sort and organize themselves in neat little lines, you’ll have to branch your skills out further. Start simple here, then work your way forward. And it’s just that simple. ;) |
|
|||||||||||||
|
©2002-2008 blade2k.net - parsed in 0.002 seconds - view active users
[16140 members][newest member: Ashurei]
Active Users (0)
|
||||||||||||||