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

Inventory Question???

 
Post new topic   Reply to topic    Castle Paradox Forum Index -> HELP!
View previous topic :: View next topic  
Author Message
Leonhart




Joined: 25 Feb 2004
Posts: 383
Location: Philippines

PostPosted: Sun Dec 02, 2007 9:55 am    Post subject: Inventory Question??? Reply with quote

There was once a game called "Fox and the Eight-Six". I think it was an entry on the 48hr contest. One of the game's features was having a separate inventory screen for all your items, names of people, abilities, etc...

Does anyone know how to do this via plotscript? I tried contacting the game's creator, but it seems he wasn't replying...

For those of you who don't know what I'm talking about:
When you talk to an NPC, you could choose to use an item/ability on the NPC or leave. When you select use, you go into this entirely different screen, where you can select your gathered items and use it on the NPC, triggering another plotscript if the item you selected is correct...

Thanks, guys.
_________________
The man who smiles when things go wrong has thought of someone to blame it on.
- Robert Bloch
Back to top
View user's profile Send private message
msw188




Joined: 02 Jul 2003
Posts: 1041

PostPosted: Sun Dec 02, 2007 5:19 pm    Post subject: Reply with quote

I can think of a couple ways to do this, but they are both pretty difficult. If you have less than 128 different kinds of items in your game, you can have two copies of every item, one for actual usage, and one for calling a script that would depend on the NPC in front of the hero. Basically the idea would be to call a script that goes through the inventory and replaces every item with its corresponding script calling item, then calls the item menu, then waits until everything is done, and THEN goes through the inventory and puts the regular items back. None of this is very fun, I can assure you, but if you'd like to go this route we can try to help you (note this will not work for non-item skills unless you have a LOT less than 128 items).

OR if this is not a valid option, we could try to use the new custom menu system to build a menu with to represent the player's inventory and NPC usable skills. This would probably be even less fun (I'm not sure that there would be an easy looping method for assigning captions to all of the choices in the menu), although it may be much nicer if we only want CERTAIN items and skills among our choices of what to smack the NPC with. If you want to try this, then we can try to help you, although it will be difficult since very few people are familiar with the new custom menu system (WIP only).

The only other thing I can think of (which is probably what that other game did) is to script your own menu system, text, cursor and all. This is probably the most difficult, although also the most flexible. If you want to go for this, I'm sure someone here can help you, and I will do what I can, but I never felt very familiar with complicated string handling and keyboard input (maintaining cursors) in plotscripting land.
_________________
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
Gizmog1
Don't Lurk In The Bushes!




Joined: 05 Mar 2003
Posts: 2257
Location: Lurking In The Bushes!

PostPosted: Mon Dec 03, 2007 9:17 pm    Post subject: Reply with quote

Could you use the items outside of battle before? Maybe they made judicious use of tags and had a script for every item. Talking to a NPC set a few tags on like "Talking to NPC: YES" "NPC needs a dog: YES" "NPC hates corn: YES". Then talking to the NPC would turn on a tag, allowing items to be used, and using a dog or corn would produce the proper reaction.

If using an item outside of battle (An unusual one, leastwise) produced something like "You can't use this now" that might imply that's what they did. I asked one of the designers how they did it, and he didn't really say anything. I'll try again to get him to help out.
Back to top
View user's profile Send private message Send e-mail AIM Address
djfenix




Joined: 12 Mar 2003
Posts: 359

PostPosted: Thu Dec 06, 2007 7:07 am    Post subject: Reply with quote

It's not that difficult to do, actually.

In FatES, every item, name, and ability was an actual item that went into your inventory. And every item had an individual tag that would make npcs visible as items in separate maps.

For the menu, there were 4 separate maps. One map for selecting item, name, or ability, and then one map for each. For the latter 3 maps, it would store NPCs of each item in it's respective category.

For the script, all you really need to do is make a script that checks the position of the cursor on key press. It'll also check to see if the item is in your inventory (which is the individual "have item" tag), then check if it was the right item for the right person (if you're making something like Fox86).
Back to top
View user's profile Send private message
Leonhart




Joined: 25 Feb 2004
Posts: 383
Location: Philippines

PostPosted: Thu Dec 06, 2007 7:58 am    Post subject: Reply with quote

That makes sense, djfenix. However,

Quote:
For the script, all you really need to do is make a script that checks the position of the cursor on key press. It'll also check to see if the item is in your inventory (which is the individual "have item" tag), then check if it was the right item for the right person (if you're making something like Fox86).


What do you mean checks the position of the cursor on key press?

Also, when talking to an NPC, and you switch to another map (the inventories), what script shall you use for the game to remember where you were last standing?
_________________
The man who smiles when things go wrong has thought of someone to blame it on.
- Robert Bloch
Back to top
View user's profile Send private message
djfenix




Joined: 12 Mar 2003
Posts: 359

PostPosted: Thu Dec 06, 2007 9:05 am    Post subject: Reply with quote

I dont know all the plotscript commands, so it'll be hard for me to write an entire script, but anyways...

What Fox86 did was have a textbox activate the menu script. It should start off by remembering what position you are, and if you want, current direction.

Code:

set variable (whatmap, current map)
set variable (posx, hero x)
set variable (posy,  hero y)
set variable (directionface, hero direction)


So, when you want to return to that map and position, you can use the code:

Code:

teleport to map (whatmap, posx, posy)
set hero direction (me, directionface)


Now, as for the cursor, you have 2 options. You can either use an NPC, or you can use the hero. Since you're probably gonna end up using all your npcs for listing your items, you're probably better off using your hero as the cursor. So, first, you gotta make a cursor walkabout to switch back and forth from. And once you switch the hero sprite to the cursor, you gotta set the position of your hero on the right spot on the map.

While on that map, it does all the tag checking and keypress checks, and does all the stuff you want it to do. So your script will look something like:

Code:

set variable (whatmap, current map)
set variable (posx, hero x)
set variable (posy,  hero y)
set variable (directionface, hero direction)

fade screen out (0,0,0) #really, this is optional, but i'd prefer to use it
wait (1) #just for the fade screen

set hero picture (me, 1) #assume 0 is default, 1 is the cursor walkabout
set hero speed (me, 20) #to make it skip through the menu faster
teleport to map (1, 0, 0) #map 1 would be your menu map

fade screen in #again, optional

while (current map == 1), do( #to ensure the code is always running while in the menu
 while (keyispressed == key:ctrl), do( #if ctrl is pressed, it'll check your position
  if (heroy (me) == 0) && if (tag(5) == 1), then( #checks to see if you're on the first menu item, and if the corresponding tag is on
   #whatever you want to happen here
  )
  if (heroy (me) == 1) && if (tag(6) == 1), then( # ditto
   #second menu item
  )
  if (heroy (me) == 6), then( #this menu item exits and returns to the map
  fade screen out (0,0,0) #the optional fade screen
  wait (1)
  teleport to map (whatmap, posx, posy)
  set hero direction (me, directionface)
  set hero speed (me, 4) #returning the default speed
  set hero picture (me, 0) #returning default walkabout
  fade screen in
  )
 )
)


I just wrote this off the top of my head, so theres a 90% chance that coding is wrong. But this is the general idea of how to do that menu in Fox86
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
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