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

custom stat menu
Goto page 1, 2  Next
 
Post new topic   Reply to topic    Castle Paradox Forum Index -> HELP!
View previous topic :: View next topic  
Author Message
GlimDoll




Joined: 09 Jun 2008
Posts: 12

PostPosted: Sun Jun 15, 2008 3:02 pm    Post subject: custom stat menu Reply with quote

I am working on displaying a custom stat menu. As I am new to plotscripting, I do not know the limitations or shortcuts yet. So far I can display my hero's life onto the screen using 3 different npcs.

There are 3 digits to the HP, one npc for each digit.
There are also 10 different walkabout graphics, 0-9.

Would I be able to display like 10 different stats at a time without going to a different map? ie, would I be able to use multiple instances of a single npc to display all numbers?

Thanks for your help. I am working on a custom item system with icons to represent items and combat system resembling dragon warrior. But I have to make my custom stat display first.
Back to top
View user's profile Send private message
msw188




Joined: 02 Jul 2003
Posts: 1041

PostPosted: Sun Jun 15, 2008 3:34 pm    Post subject: Reply with quote

You will almost certainly want to read up on strings and the new custom menu system, both of which will simplify your task tremendously once you understand how to use them. Making menues out of NPCs entirely is no longer a good idea. My advice would be to just make the status screen a custom menu, with all of the choices used only as text to show stats. You can make menu choices unselectable in custom. Then again, it might be nice to allow the player to select the stats and that would lead to a text box that describes what the stat does.

What kind of custom item system are you trying to make? If you play Tales of the New World II (my second game), you can take a look at my Dragon Warrior item system. By Dragon Warrior I refer to the NES games, so we might have different ideas. But my game makes sure that each hero has their own item list, and can only carry eight items at once. The scripts are included, but it would be quite impossible to learn from them on your own, I imagine. If you need help with that, I may be able to assist you somewhat. I should warn you now though that it is not particularly fun setting up the system. Once set up though, there's only a few things you need to keep track of when making the rest of the game in custom.
_________________
My first completed OHR game, Tales of the New World:
http://castleparadox.com/gamelist-display.php?game=161

This website link is for my funk/rock band, Euphonic Brew:
www.euphonicbrew.com
Back to top
View user's profile Send private message Visit poster's website
GlimDoll




Joined: 09 Jun 2008
Posts: 12

PostPosted: Sun Jun 15, 2008 4:43 pm    Post subject: Reply with quote

Well I wanted a DW type item system, but I think instead of text for the item names, I wanted an icon based menu. Right now I was thinking a new map with npcs for each item,...But I am a long way from there right now.

Right now I want to concentrate on my stat menu...

I was using old tutorials to find out how to display my hero's hp...is there any place where there new tutorials, with how to use menu effectivly?

How would I display a number within a menu?

And thank you for your quick reply. I am downloading your game now to take a look into it.
Back to top
View user's profile Send private message
msw188




Joined: 02 Jul 2003
Posts: 1041

PostPosted: Sun Jun 15, 2008 6:55 pm    Post subject: Reply with quote

You should look around on the wiki for information about making custom menues, and about strings. I don't know how much you know about these things, so I'll try my best to explain stuff as clearly as possible. Forgive me if I'm telling you some things you already know.

A variable is something you use to store a number in. A string is something you use to store some text in. 'Text' includes numbers, so you could make a single string store the line:
"HP: 440"

However, strings don't store numbers as actual numbers, like variables do. There are plotscript commands that take numbers and turn them into 'number-text' for strings. So to properly make the example above, you would need a plotscript to do the following:
Create the string "HP: "
Find the hero's actual HP and store it in a variable
Transfer the value of that variable into 'number-text' and insert it into the string you've begun

This might seem a little unwieldy, but it beats going a digit at a time with NPCs.

The next thing to understand is custom menues. A custom menu is just a list where you can decide how many options are in the list, what text is assigned to each option, and what each option does. There are plotscript commands to alter all of these things, and the commands to alter the text use strings to do so. "What each option does" is limited to calling other menues and calling plotscripts pretty much. However, there is also an option to make an option in the list unselectable, so that it essentially does nothing. This seems to me to be what you might want for a custom status screen.

Feel free to ask questions on any of that. If you think you have a handle on those ideas, my next suggestion is to make sure you understand:
if/then/else statements
for loops!!!!!
while loops
global variables (especially "read global" and "write global")
sending and using arguments in your scripts!!!!!

If you feel comfortable with all of that (and I'm guessing you mostly are if you put together a system showing values with NPCs) I can try to start helping you construct a good scripting system to maintain your stat menu. I have a few ideas floating through my head right now might make the script not that bad. Then again, it always starts that way.
_________________
My first completed OHR game, Tales of the New World:
http://castleparadox.com/gamelist-display.php?game=161

This website link is for my funk/rock band, Euphonic Brew:
www.euphonicbrew.com
Back to top
View user's profile Send private message Visit poster's website
GlimDoll




Joined: 09 Jun 2008
Posts: 12

PostPosted: Sun Jun 15, 2008 7:54 pm    Post subject: Reply with quote

msw188 wrote:


However, strings don't store numbers as actual numbers, like variables do. There are plotscript commands that take numbers and turn them into 'number-text' for strings. So to properly make the example above, you would need a plotscript to do the following:
Create the string "HP: "
Find the hero's actual HP and store it in a variable
Transfer the value of that variable into 'number-text' and insert it into the string you've begun

This might seem a little unwieldy, but it beats going a digit at a time with NPCs.


I have been playing around with the globals to string command. But it does not want to display any number after "Life:" So my question is, how do I use the command to transform a variable into a string? My background is not in programming, but I work really well with examples of specific commands.

Code:
include, plotscr.hsd
include, testgame.hsi

global variable(9, hp)
global variable(10, herolife)

plotscript, show hero life, begin

set variable(herolife, getherostat(0, hp, currentstat))

$1="Life: "
globals to string(2, herolife, 3)

1 $+ 2

show string at (1, 100, 100)
end



And I checked out your game, and peeked into your script, and it is definately somethign I am going for. But I need to do this first, and I feel everything else will come easier.
Back to top
View user's profile Send private message
msw188




Joined: 02 Jul 2003
Posts: 1041

PostPosted: Mon Jun 16, 2008 6:30 am    Post subject: Reply with quote

The first thing that catches my eye is:
getherostat(0, hp, currentstat)

should probably be:
getherostat(0, stat:hp, currentstat)

I don't know why you have a global variable called hp, but it probably doesn't do what you want. "getherostat" needs a specific predefined value as its second argument to know what stat to look for, and that value has been pre-coded for you as "stat:hp", or whatever you call HP in your game (with the text "stat:" beforehand). This will be true for every stat that you 'get'.

The main problem, though, is that "global to string" assumes that the number in the global was an ascii representation of some text previously transferred into data. You don't want this. Use the command "append number" like so:

$1="Life: "
append number (1, herolife)
_________________
My first completed OHR game, Tales of the New World:
http://castleparadox.com/gamelist-display.php?game=161

This website link is for my funk/rock band, Euphonic Brew:
www.euphonicbrew.com
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: Mon Jun 16, 2008 9:18 pm    Post subject: Reply with quote

You can display more than one menu at a time, and you don't need to give the player control of any of them. I don't know what the DW stat system looks like, but it's shouldn't be too hard to recreate nearly identically the builtin status menu using 3 menus (and you could even add the translucent box in the background with a 4th menu). You can also display numbers, strings, etc in menu labels using the same variable embedding format as in textboxes, eg ${V0}, which means you won't have to modfiy the menus at all with scripting: just set the appropriate global variables. Unless you want more control over aligning things.


Are you aware that you can write "a := b" instead of "setvariable(a, b)"? I would really like to know where people pick up setvariable from. Out of interest, which old tutorial were you following?

BTW: just in case you got that idea, it's not necessary to store a value in a temporary value before passing it to appendnumber or any other command.

Also: bad news about using icons in your custom menus: unless you draw your icons by editting the font, you'll have to use NPCs to display them, so you would need to change to a special map; otherwise you won't be able to get the NPCs to layer properly with npcs, heroes and map layers on the map.
_________________
"It is so great it is insanely great."
Back to top
View user's profile Send private message Send e-mail
msw188




Joined: 02 Jul 2003
Posts: 1041

PostPosted: Tue Jun 17, 2008 6:21 am    Post subject: Reply with quote

Wow, I didn't even think about the special text strings available in custom. That does indeed make things immensely simpler, if you can live with variable text alignment.

Sigh... beaten by a master again...
_________________
My first completed OHR game, Tales of the New World:
http://castleparadox.com/gamelist-display.php?game=161

This website link is for my funk/rock band, Euphonic Brew:
www.euphonicbrew.com
Back to top
View user's profile Send private message Visit poster's website
GlimDoll




Joined: 09 Jun 2008
Posts: 12

PostPosted: Wed Jun 18, 2008 2:54 pm    Post subject: Reply with quote

Thank you guys for your replies and your help. I am going to try to try out this stuff tonight....been busy lately with work and my Warhammer tourny and all.

I was at the Moglery following this one... http://moogle1.castleparadox.com/statshow.php I figured it was outdated, but I saw that the commands were back words compatible.

I have 3 stats...with life, mana, and willpower derived from them. The main stats go up to 20, and the rest(the derived stats)...I havent' figured out yet for balancing purposes. My stat system is going to be similar to the tristat system from guardians of order. Plus there is attack and defense and all that good stuff.

Is there a limit to the amount of menus I can have open at a time?

Is there a place with updated tutorials for the newer features/better ways of doing things?
Back to top
View user's profile Send private message
Moogle1
Scourge of the Seas
Halloween 2006 Creativity Winner
Halloween 2006 Creativity Winner



Joined: 15 Jul 2004
Posts: 3377
Location: Seattle, WA

PostPosted: Wed Jun 18, 2008 3:12 pm    Post subject: Reply with quote

The script is functional, but that doesn't mean it's obselete. You can do the same thing much more easily now with strings.

Tutorials for plotscripting are few and far between. The Moglery ones aren't bad, but they're also really old and some of the syntax is outdated. (setvariable in particular is cumbersome and unnecessary.) It may still be the best tutorial available for beginning scripters.

If you are new to programming in general, you may want to start with something smaller than what you're doing. This isn't to say you shouldn't try it, just try something less daunting first.
_________________
Back to top
View user's profile Send private message Visit poster's website AIM Address
TMC
On the Verge of Insanity




Joined: 05 Apr 2003
Posts: 3240
Location: Matakana

PostPosted: Sun Jun 22, 2008 6:59 am    Post subject: Reply with quote

There's this article for strings : 'What is a string and how do I use it?' but not much else.

There's no limit on the number of open menus.



I went ahead and tested this idea. It's a bit harder than I thought: to stop the first item on the menu from being selected, you have to select an item which can't be seen: either a blank slot, or you can set the maximum height of the menu and hide the scrollbar and hide an item off the bottom. That's what those numbers 10 and 3 are in the script:

Code:
global variable, begin
 100, atk
 101, aim
 102, def
#snip...
end

plotscript, show status menu, begin
 atk := 100
 aim := 10
 def := 1
#snip...

 variable (menu)
 open menu (menu:Backdrop)
 menu := open menu (menu:Left stats pane)
 select menu item (menu item by slot(menu, 10))
 menu := open menu (menu:Right stats pane)
 select menu item (menu item by slot(menu, 10))
 menu := open menu (menu:Top status pane)
 select menu item (menu item by slot(menu, 3))

 wait for key

 close menu (top menu)
 close menu (top menu)
 close menu (top menu)
 close menu (top menu)
end

The RPG file if you want it (probably won't need to look)
_________________
"It is so great it is insanely great."
Back to top
View user's profile Send private message Send e-mail
GlimDoll




Joined: 09 Jun 2008
Posts: 12

PostPosted: Sun Jun 22, 2008 8:19 pm    Post subject: Reply with quote

I have been playing around with the menus, and I have some questions...I will highlight them...

I made a menu into a character selector...ie. displays the 4 character in the catapillers name. When you select one I coded it so that more menus pop up with the particular characters stats.
Code:
plotscript, display hero status, begin
if (hero by rank (1) == -1) then (set tag (2, on))
if (hero by rank (2) == -1) then (set tag (3, on))
if (hero by rank (3) == -1) then (set tag (4, on))

open menu (2)
open menu (6)
open menu (5)

end

[img]http://s45.photobucket.com/albums/f91/goldszlaga/?action=view&current=1.jpg[/img]

1)If there is no hero in the party, why is the name of the menu item's script in its place? (the 4th item on the list)

When you select a hero's name, I coded so that new menu's pop up with all his neat info.
[img]http://s45.photobucket.com/albums/f91/goldszlaga/?action=view&current=2.jpg[/img]

2)How come the new menu's pop up behind the current ones? This is my code for the hero selector...
Code:
open menu (3)
open menu (4)
open menu (7)
open menu (8)
open menu (9)

bring menu forward (3)
bring menu forward (4)
bring menu forward (7)
bring menu forward (8)
bring menu forward (9)


I added the bring menu forward as I thought it would push them to the front...but it didn't.

3)When there are less than 4 people in the catapillar, I did not want the empty slots to be highlightable, so I tried to use tags to get to disable them... Is this the right approach to take?

I still got to work on getting rid of the flashing highlighted item within each menu. Also, I suppose I can just use the normal character picker...but I wanted to try to do this way first...and to get familiar with the scripting.
Back to top
View user's profile Send private message
Newbie_Power




Joined: 04 Sep 2006
Posts: 1762

PostPosted: Sun Jun 22, 2008 8:25 pm    Post subject: Reply with quote

Quote:
I made a menu into a character selector...ie. displays the 4 character in the catapillers name. When you select one I coded it so that more menus pop up with the particular characters stats.
Code:
plotscript, display hero status, begin
if (hero by rank (1) == -1) then (set tag (2, on))
if (hero by rank (2) == -1) then (set tag (3, on))
if (hero by rank (3) == -1) then (set tag (4, on))

open menu (2)
open menu (6)
open menu (5)

end

[img]http://s45.photobucket.com/albums/f91/goldszlaga/?action=view&current=1.jpg[/img]

1)If there is no hero in the party, why is the name of the menu item's script in its place? (the 4th item on the list)
There's already a built in plotscript command called "pick hero" that will bring up a menu that will let you pick your hero, and it will return the number of the hero you picked. Unless your custom menu has a purpose this doesn't, that should work perfectly well.

I have not relied on menus enough to answer your other two questions, unfortunately.
_________________

TheGiz> Am I the only one who likes to imagine that Elijah Wood's character in Back to the Future 2, the kid at the Wild Gunman machine in the Cafe 80's, is some future descendant of the AVGN?
Back to top
View user's profile Send private message
TMC
On the Verge of Insanity




Joined: 05 Apr 2003
Posts: 3240
Location: Matakana

PostPosted: Mon Jun 23, 2008 4:32 am    Post subject: Reply with quote

GlimDoll wrote:
1)If there is no hero in the party, why is the name of the menu item's script in its place? (the 4th item on the list)


Wow. I can't reproduce this, could you give me detailed instructions, or send me your RPG file and scripts so that I can fix it? Or file a bug report and attach them.

GlimDoll wrote:
2)How come the new menu's pop up behind the current ones? This is my code for the hero selector...
Code:
open menu (3)
open menu (4)
open menu (7)
open menu (8)
open menu (9)

bring menu forward (3)
bring menu forward (4)
bring menu forward (7)
bring menu forward (8)
bring menu forward (9)


I added the bring menu forward as I thought it would push them to the front...but it didn't.


bringmenuforward takes a menu handle as an argument, not a menu ID. Nearly all menu commands work with menu and menu item handles. So to move menu 3 to the front you'd write
Code:
bring menu forward (find menu ID (3))


But the better solution is to just open the menus in the order of bottommost to topmost that you want them - unless you're saying that that didn't work.

GlimDoll wrote:
3)When there are less than 4 people in the catapillar, I did not want the empty slots to be highlightable, so I tried to use tags to get to disable them... Is this the right approach to take?


There's currently no way to create a slot that is visible but not selectable, unless you script cursor movement yourself, which might not be that difficult. Otherwise you can either hide the disabled item or not.

GrimDoll wrote:
I still got to work on getting rid of the flashing highlighted item within each menu. Also, I suppose I can just use the normal character picker...but I wanted to try to do this way first...and to get familiar with the scripting.

_________________
"It is so great it is insanely great."
Back to top
View user's profile Send private message Send e-mail
GlimDoll




Joined: 09 Jun 2008
Posts: 12

PostPosted: Mon Jun 23, 2008 7:04 am    Post subject: Reply with quote

I just sent the file. It appears that if I use the ${c1} for a menu name, and have a script run when that item is selected, then the scripts name appears.


I have a day off today, so I have all day to work on things...woot!
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Castle Paradox Forum Index -> HELP! All times are GMT - 8 Hours
Goto page 1, 2  Next
Page 1 of 2

 
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