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

Items and scripts and shops

 
Post new topic   Reply to topic    Castle Paradox Forum Index -> HELP!
View previous topic :: View next topic  
Author Message
Bagne
ALL YOUR NUDIBRANCH ARE BELONG TO GASTROPODA




Joined: 19 Feb 2003
Posts: 518
Location: Halifax

PostPosted: Tue Oct 27, 2009 6:31 pm    Post subject: Items and scripts and shops Reply with quote

Two questions here:

1)
How customizable are shops?
I want to make a wishing well where you select an item and throw it off.

I was thinking I'd make an item called "wish", and so when selecting an item, you could "trade" for it, and you'd see the text:
"Worth 1 wish".

This only sort of works.

When you make the trade, it says "Sold item" (which I don't want the player to see).
Also, the player gets a wish item which I could automatically remove later, but the player will see it too before it's removed.

What I really need is a plotscript command which opens up an item menu, and the player can select an item. The item ID would then be returned and you could use it for whatever... throwing it down a well.
Does such a thing exist?


2)
I could write a wrapper script for every usable item, and have it check if I'm next to the well... (and if not, the item is used normally).
That's not such a bad idea, I plan on having many scripts called by items, and I'll need to do a lot of checking.

However, this is only effective if I can pass an argument which identifies the item being used.
I don't want to write a different wrapper script for every-single usable item... that's crazy.

Items can't call scripts directly - you'd have to use a text box that says "Always use script X instead", and so an argument can't be directly passed ... but can a text box pass an argument?
If not, is there any way a script can learn the ID of the text box that called it?
_________________
Working on rain and cloud formation
Back to top
View user's profile Send private message
msw188




Joined: 02 Jul 2003
Posts: 1041

PostPosted: Tue Oct 27, 2009 9:43 pm    Post subject: Reply with quote

Sorry friend, items and shops are among the least plotscripting-friendly things in the neighborhood. I wrote a wiki bit about items that clarifies your problem exactly - items can in no way call scripts with arguments as long as you are using the standard item menu. See here:
http://gilgamesh.hamsterrepublic.com/wiki/ohrrpgce/index.php/Items

This means that your wishing well is going to be nothing less than a massive pain to script, unless you're willing to wait for some of these kinds of commands, which TMC was supposed to have written and re-written years ago. See this bug:
http://rpg.hamsterrepublic.com/bugzilla/show_bug.cgi?id=535
_________________
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
Moogle1
Scourge of the Seas
Halloween 2006 Creativity Winner
Halloween 2006 Creativity Winner



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

PostPosted: Tue Oct 27, 2009 11:31 pm    Post subject: Reply with quote

You might try using a custom menu instead of a shop.
_________________
Back to top
View user's profile Send private message Visit poster's website AIM Address
Bagne
ALL YOUR NUDIBRANCH ARE BELONG TO GASTROPODA




Joined: 19 Feb 2003
Posts: 518
Location: Halifax

PostPosted: Wed Oct 28, 2009 3:38 pm    Post subject: Reply with quote

Thanks for the info on items.

Moogle1, what's all this custom menu witchcraft?
_________________
Working on rain and cloud formation
Back to top
View user's profile Send private message
TwinHamster
♫ Furious souls, burn eternally! ♫




Joined: 07 Mar 2004
Posts: 1352

PostPosted: Wed Oct 28, 2009 4:05 pm    Post subject: Reply with quote

The Wishing-Well can be done with no plotscripting.
It'll just take a bit of effort on your part.


Instead of assigning monetary values for your items, you can allow them to be traded for items when "sold".
This only works in the specified stores, and you'll have to set this up for EVERY item you plan to make tradeable.


Instead of having it show "Sold", you can change it from the 'Edit Global Text Strings' menu.
Changing it to "Lost" would probably be the most consistent.
Back to top
View user's profile Send private message Send e-mail AIM Address
Bagne
ALL YOUR NUDIBRANCH ARE BELONG TO GASTROPODA




Joined: 19 Feb 2003
Posts: 518
Location: Halifax

PostPosted: Wed Oct 28, 2009 6:36 pm    Post subject: Reply with quote

Would this affect every single shop in my game?

If so, can these strings be changed with a plotscript?
_________________
Working on rain and cloud formation
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 Oct 28, 2009 7:43 pm    Post subject: Reply with quote

Yes, it would affect all shops, and no, you can't change them via plotscripting.

Custom menu: Go to "Edit Menus" in CUSTOM. You can do this without any plotscripting, but I find it convenient to do something like this:

Code:
menu id := open menu(3)
         while (menu is open(menu id)) do (
            selection := get menu item extra(selected menu item(menu id), 0)
            if (key is pressed(key:alt) || key is pressed(key:esc)) then (selection := -1)
            mywait
         )


This opens menu #3. When menu #3 is closed, "selection" will contain the value of menu item extra 1, or -1 if the player canceled. This will probably make more sense once you get a look at the menu editor.

Custom menus are really handy. Take a look at them and say something if you have any questions.
_________________
Back to top
View user's profile Send private message Visit poster's website AIM Address
Guest







PostPosted: Wed Oct 28, 2009 10:20 pm    Post subject: Reply with quote

Yeah, I figured the reason you didn't go with the global text string was because you were using other shops normally.

Although custom menues are indeed quite beautiful things, they don't do a lot of good for items because there are no simple plotscripting methods for things like finding out what items the player has. That said, if you are willing to make the plotscript for it, you can have a custom menu empty in custom.exe, and then have a plotscript 'populate' it on the fly with all of the items that the player currently has. This will not be fun, ESPECIALLY if the player has access to more item types than there is room in a single custom menu...
Back to top
Moogle1
Scourge of the Seas
Halloween 2006 Creativity Winner
Halloween 2006 Creativity Winner



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

PostPosted: Wed Oct 28, 2009 10:31 pm    Post subject: Reply with quote

Anonymous wrote:
Although custom menues are indeed quite beautiful things, they don't do a lot of good for items because there are no simple plotscripting methods for things like finding out what items the player has.


What? Yes, there are. Try the inventory command. You can also just use tags for items.

Quote:
That said, if you are willing to make the plotscript for it, you can have a custom menu empty in custom.exe, and then have a plotscript 'populate' it on the fly with all of the items that the player currently has.


Or you can create an empty menu via plotscripting. I don't remember the command offhand, but I did this for the level selector in Timpoline.
_________________
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: Thu Oct 29, 2009 6:22 am    Post subject: Reply with quote

Quote:
If so, can these strings be changed with a plotscript?

Something like 3 years ago I got part way through adding such a command but I'm pretty sure I lost that patch. Some time later, Mike added a command to read global text strings. I doubt anyone has used it, it's basically undocumented.

Anonymous wrote:
This will not be fun, ESPECIALLY if the player has access to more item types than there is room in a single custom menu...


I might try and fix that 22 item limit. If it's too ugly to workaround, I'll just raise it to something higher.
There's a hacky solution: open multiple menu and place them side by side on the screen, and use a script to change the the active menu when you press left/right :P
_________________
"It is so great it is insanely great."
Back to top
View user's profile Send private message Send e-mail
Bagne
ALL YOUR NUDIBRANCH ARE BELONG TO GASTROPODA




Joined: 19 Feb 2003
Posts: 518
Location: Halifax

PostPosted: Thu Oct 29, 2009 2:55 pm    Post subject: Reply with quote

Eh? 22 item limit?

I thought you could have zillions now.
I think I'm misunderstanding you.

I'm going to have other shops - I don't want to meddle with that stuff.

I'm beginning to think now that it won't be such a big deal to write a script for each item...
I'm likely going to have all sorts of scripts for most of my items anyways, and I can make subroutines to check for wells and other situations... and in those situations, since each item will have it's own script, I'll be able to pass arguments.
_________________
Working on rain and cloud formation
Back to top
View user's profile Send private message
Bob the Hamster
OHRRPGCE Developer




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

PostPosted: Thu Oct 29, 2009 3:53 pm    Post subject: Reply with quote

Bagne wrote:
Eh? 22 item limit?

I thought you could have zillions now.
I think I'm misunderstanding you.


22 menu items, not inventory items.

Here at the OHRRPGCE, we delight in calling things the same name as other different things almost as much as we delight in calling things names that other people use to name different things than the things that we are naming. Confused? Mwahahahahahahaha! >:)
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: Thu Oct 29, 2009 4:17 pm    Post subject: Reply with quote

Raising the menu item limit would make me happy! I foolishly used the same magic menu for all four heroes in DYWTBAH, and as a result, there are exactly 21 hero spells and a Back button. There were a few more I'd like to have added, but not many.
_________________
Back to top
View user's profile Send private message Visit poster's website AIM Address
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