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

Way to make certain shop stats default?

 
Post new topic   Reply to topic    Castle Paradox Forum Index -> HELP!
View previous topic :: View next topic  
Author Message
Bobert-Rob
The guy from years ago who made one good game




Joined: 13 Jun 2010
Posts: 17

PostPosted: Fri Oct 15, 2010 5:01 pm    Post subject: Way to make certain shop stats default? Reply with quote

Alright, so I'm messing around with having multiple inventories. Thankfully, all that is working already.

What I'm working on right now is an item exchange system, where you can exchange items between the separate inventories. I read in another thread that you could use shops for temporary item storage, so I figured it'd be the simplest way to do this. Sell items from inventory one, change what inventory you're using on screen two, go back to the shop and buy back the items for no money.
Well, the default sell type in a shop is "Normal". What I would need would be to add each item to the shop and set it to "Increment Inventory", and I've already got 200+ items in the game. The limit of shop items is 50, so I'm in a bit of a pinch.
I know I could probably do this menu in a plotscript, but it'd be awfully difficult to figure out how to display all that information, especially if I want it to depend on what items the player has currently and not have some static values showing all items by default. Otherwise I'd have to have a complex item tag system set up, and I currently have 500 tags being used, so I run into a snag there as well.

So, uh, I was curious if it'd be possible to add some kind of 'shop default' value for this sort of thing? So I could have one shop's sell type be 'Increment Inventory' by default so I could save the shop inventories for the items that absolutely need prices changed to 0 or whatever. If possible. Thanks for readin'!
Back to top
View user's profile Send private message Visit poster's website
Bob the Hamster
OHRRPGCE Developer




Joined: 22 Feb 2003
Posts: 2526
Location: Hamster Republic (Southern California Enclave)

PostPosted: Fri Oct 15, 2010 5:19 pm    Post subject: Reply with quote

That method seems workabout for small inventories, but with 200 items? Ouch!

Default settings for items in shops is definitely a desirable feature, but I can't make any promises on how soon I will get to adding it, as there are so many other features to work on.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Moogle1
Scourge of the Seas
Halloween 2006 Creativity Winner
Halloween 2006 Creativity Winner



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

PostPosted: Fri Oct 15, 2010 5:19 pm    Post subject: Re: Way to make certain shop stats default? Reply with quote

Bobert-Rob wrote:
The limit of shop items is 50, so I'm in a bit of a pinch.

I'd think this would be an easy limit to raise.
_________________
Back to top
View user's profile Send private message Visit poster's website AIM Address
chronoboy
Into the past with a splash




Joined: 04 Jun 2010
Posts: 162
Location: Canada

PostPosted: Sun Nov 21, 2010 8:40 pm    Post subject: Reply with quote

I think the shops in general need an overhaul, I wrote another thread a few moments ago with tons of details on what I'd like to see in shops-TNG(Yes Star Trek geekum there). One of the biggies would be controlling shop creating and modification from plotscripts.

Bobert-Rob wrote:
I know I could probably do this menu in a plotscript, but it'd be awfully difficult to figure out how to display all that information, especially if I want it to depend on what items the player has currently and not have some static values showing all items by default. Otherwise I'd have to have a complex item tag system set up, and I currently have 500 tags being used, so I run into a snag there as well


This is actually easier to setup than one might think. The only snag, would be the menu item limits(which I have no idea what they are?!?). I know menus can scroll, so it might be more than shops offer. If all else fails use fire, no not that, but use "Propagation" with your menus you generate.

Here is some sample code to get you started on how one would generate such a menu(I'll skip variable declaration, leave it to the reader to add):

Code:

mymenu := create menu
for (i,0,199,1) do, begin
  if (inventory(i) >> 0) then, begin
    tmp:=add menu item(mymenu)
    get item name (1,i)
    set menu item caption(tmp,1)
  end
end


Basically, this will generate a menu with all the items the player has in their inventory. It is up to you the reader to control what happens when the player selects the menu option.

For creating a multiple inventory system, it would ideal to use "read/write global" plotscript commands as an array.

Say, you start your 1st inventory @ global 600, you can then write a script to add and subscript data from this. Yet another example:

Code:

define constant (inv1,600)
script, get multi item,inv,itm, begin
  variable (total)
  total:=read global(inv+itm)
  if (total >> 0) then (write global(inv+itm,total--1),get item(itm))
end

script, put multi item,inv,itm, begin
  variable (total)
  total:=read global(inv+itm)
  if (inventory(itm)>>0) then (write global(inv+itm,total+1),delete item(itm))
end


Example usage:
Code:

get multi item (inv1,item:Cure)
put multi item (inv1,item:Tent)


Create additional constants to define where your other inventories will be stored. Heck, since we have the command "import/export globals", you can write a script which stores extra inventories on unused saved slots. I rarely use Tags unless absolutely required, I try and use globals as much as heavenly possible... Globals are less limited and data restricted. You can store almost anything in a global these days, booleans, ints, and even strings. It's good habit to get into, since we don't really know when we will get a massive limit increase for tags(any ideas there James?)
_________________
Current project: Chronoboy Adventures

Website: http://www.chronoboy.com/
Back to top
View user's profile Send private message Visit poster's website
Bobert-Rob
The guy from years ago who made one good game




Joined: 13 Jun 2010
Posts: 17

PostPosted: Mon Nov 22, 2010 9:42 pm    Post subject: Reply with quote

True, for some reason it didn't even occur to me to write the menu options dynamically in the script itself. As long as the menu can have 124 items (the max I set up for an individual inventory), then that would definitely be possible.

Is it possible to have two menus open at once? What I'm thinking is having two windows open, each showing one of the inventories during the exchange. That way, you can see what menu has what item and you can see the exchange take place. Each inventory takes up a half of the screen, you see. I would need to make it so the second inventory menu is inactive, though, and I'm not quite sure if that's possible. I suppose if I can't do that, maybe I could do this with a slice or something?

Also, I'm thinking of using pre-set up menus instead of making new ones so I can have one item menu per side of the screen. Is there a way to remove the menu items afterward? I would want each menu item to be written fresh each time the menu is opened (as I'm adding item count to the item titles as well, so they know how much they have of each item), but if I were to use up certain items from the regular inventory menu, the menu items made for those items wouldn't be removed when re-opening it later, I assume. Being able to clear out the custom menu items when it closes would be ideal (delete menu item doesn't allow me to target a menu though, just the item itself). I would just make a custom menu, but I worry about there being too many custom menus being made each time I open the menu if I'm not deleting them after I'm done with them, you know? I wouldn't imagine that being good. Unless I'm overlooking some key detail about making new menus via plotscripting...
Back to top
View user's profile Send private message Visit poster's website
msw188




Joined: 02 Jul 2003
Posts: 1041

PostPosted: Tue Nov 23, 2010 2:21 pm    Post subject: Reply with quote

When you close a menu, it doesn't remember what kinds of things you did to it the last time it was open. Just like with a map that won't remember whether you added or deleted NPCs from it last time you were on it.

In my multiple inventories for Tales 2, I had all of the inventories defined as empty menues in custom, and I populate them on the fly. Then anytime a change has occured, the menu closes (and if needed, reopens), and the populating script is re-run, allowing the menu to update itself.

It sounds like you already have some good ideas flowing about how to handle this, but if you want you can check the item-related scripts that I included in the Tales 2 download:
http://www.slimesalad.com/forum/viewgame.php?t=196&highlight=tales
The issue with mine is that I limit each inventory to 8, because I still use the OHR's battle system, and I make hero item menues in battle use levelMP, the only stat I could think of to make customized items work properly in battle. And levelMP only recognizes 8 rows. I don't know how you'll manage to do battles with what you're trying to do.
_________________
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
Display posts from previous:   
Post new topic   Reply to topic    Castle Paradox Forum Index -> HELP! All times are GMT - 8 Hours
Page 1 of 1

 
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