View previous topic :: View next topic |
Author |
Message |
Bagne ALL YOUR NUDIBRANCH ARE BELONG TO GASTROPODA

Joined: 19 Feb 2003 Posts: 518 Location: Halifax
|
Posted: Tue Oct 27, 2009 6:31 pm Post subject: Items and scripts and shops |
|
|
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 |
|
 |
msw188
Joined: 02 Jul 2003 Posts: 1041
|
|
Back to top |
|
 |
Moogle1 Scourge of the Seas Halloween 2006 Creativity Winner


Joined: 15 Jul 2004 Posts: 3377 Location: Seattle, WA
|
Posted: Tue Oct 27, 2009 11:31 pm Post subject: |
|
|
You might try using a custom menu instead of a shop. _________________
|
|
Back to top |
|
 |
Bagne ALL YOUR NUDIBRANCH ARE BELONG TO GASTROPODA

Joined: 19 Feb 2003 Posts: 518 Location: Halifax
|
Posted: Wed Oct 28, 2009 3:38 pm Post subject: |
|
|
Thanks for the info on items.
Moogle1, what's all this custom menu witchcraft? _________________ Working on rain and cloud formation |
|
Back to top |
|
 |
TwinHamster ♫ Furious souls, burn eternally! ♫

Joined: 07 Mar 2004 Posts: 1352
|
Posted: Wed Oct 28, 2009 4:05 pm Post subject: |
|
|
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 |
|
 |
Bagne ALL YOUR NUDIBRANCH ARE BELONG TO GASTROPODA

Joined: 19 Feb 2003 Posts: 518 Location: Halifax
|
Posted: Wed Oct 28, 2009 6:36 pm Post subject: |
|
|
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 |
|
 |
Moogle1 Scourge of the Seas Halloween 2006 Creativity Winner


Joined: 15 Jul 2004 Posts: 3377 Location: Seattle, WA
|
Posted: Wed Oct 28, 2009 7:43 pm Post subject: |
|
|
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 |
|
 |
Guest
|
Posted: Wed Oct 28, 2009 10:20 pm Post subject: |
|
|
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


Joined: 15 Jul 2004 Posts: 3377 Location: Seattle, WA
|
Posted: Wed Oct 28, 2009 10:31 pm Post subject: |
|
|
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 |
|
 |
TMC On the Verge of Insanity
Joined: 05 Apr 2003 Posts: 3240 Location: Matakana
|
Posted: Thu Oct 29, 2009 6:22 am Post subject: |
|
|
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 |
|
 |
Bagne ALL YOUR NUDIBRANCH ARE BELONG TO GASTROPODA

Joined: 19 Feb 2003 Posts: 518 Location: Halifax
|
Posted: Thu Oct 29, 2009 2:55 pm Post subject: |
|
|
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 |
|
 |
Bob the Hamster OHRRPGCE Developer

Joined: 22 Feb 2003 Posts: 2526 Location: Hamster Republic (Southern California Enclave)
|
Posted: Thu Oct 29, 2009 3:53 pm Post subject: |
|
|
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 |
|
 |
Moogle1 Scourge of the Seas Halloween 2006 Creativity Winner


Joined: 15 Jul 2004 Posts: 3377 Location: Seattle, WA
|
Posted: Thu Oct 29, 2009 4:17 pm Post subject: |
|
|
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 |
|
 |
|