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

Splitting up/Item issues
Goto page 1, 2  Next
 
Post new topic   This topic is locked: you cannot edit posts or make replies.    Castle Paradox Forum Index -> HELP!
View previous topic :: View next topic  
Author Message
Squall
is fantastic




Joined: 02 Feb 2003
Posts: 758
Location: Nampa, Idaho

PostPosted: Mon Mar 10, 2003 12:01 am    Post subject: Splitting up/Item issues Reply with quote

Situation: A group spilts up into more than one group.

Problem: The items recieved by one group of people will go to everybodies stash.

Question: Is there a way to seperate item stashes?

Note: You don't have to tell me exact code, just how would I go about doing it?
_________________
You got film in my video game!
You got video game in my film!
Back to top
View user's profile Send private message Visit poster's website AIM Address MSN Messenger
Aethereal
SHUT UP.
Elite Designer
Elite Designer



Joined: 04 Jan 2003
Posts: 928
Location: Gone! I pop in on occasion though.

PostPosted: Mon Mar 10, 2003 12:40 am    Post subject: Reply with quote

Yeah. Find out what items the player has, and store how many and what item in a variable (this can be accomplished easily with a for() loop). When it switches to another group, store the items the first group had in new variables and delete all their items, then set new items using the older variables.

That was probably very confusing, but that's one way to do it, although it's probably very inefficient. :\
_________________
Back to top
View user's profile Send private message Send e-mail AIM Address
Seth
Hardcore Reviewer




Joined: 03 Feb 2003
Posts: 170
Location: Gold Coast, Australia

PostPosted: Mon Mar 10, 2003 3:54 am    Post subject: Reply with quote

BTW, have you tried the remove and add items?
_________________
Missing in Action
----------------------------------------------------
Cardcaptor Stacey
James Paige


Embattled Productions Home
Back to top
View user's profile Send private message Visit poster's website
Aethereal
SHUT UP.
Elite Designer
Elite Designer



Joined: 04 Jan 2003
Posts: 928
Location: Gone! I pop in on occasion though.

PostPosted: Mon Mar 10, 2003 3:56 am    Post subject: Reply with quote

Removing and adding are kind of implied...
_________________
Back to top
View user's profile Send private message Send e-mail AIM Address
Squall
is fantastic




Joined: 02 Feb 2003
Posts: 758
Location: Nampa, Idaho

PostPosted: Mon Mar 10, 2003 4:04 am    Post subject: Reply with quote

Alright, thanks Aeth. I'm not 100% sure of how I'm going to do it, but at least you set me out in the right direction.
_________________
You got film in my video game!
You got video game in my film!
Back to top
View user's profile Send private message Visit poster's website AIM Address MSN Messenger
Seth
Hardcore Reviewer




Joined: 03 Feb 2003
Posts: 170
Location: Gold Coast, Australia

PostPosted: Mon Mar 10, 2003 5:28 am    Post subject: Reply with quote

Aeth, er... what does 'implied' mean in this context?
_________________
Missing in Action
----------------------------------------------------
Cardcaptor Stacey
James Paige


Embattled Productions Home
Back to top
View user's profile Send private message Visit poster's website
mystallus
Guest






PostPosted: Tue Mar 11, 2003 10:26 pm    Post subject: Reply with quote

On that topic, is there any way to make a nice array using the current plotscripting commands? I haven't really found a good one yet.
Back to top
Aethereal
SHUT UP.
Elite Designer
Elite Designer



Joined: 04 Jan 2003
Posts: 928
Location: Gone! I pop in on occasion though.

PostPosted: Wed Mar 12, 2003 12:00 am    Post subject: Reply with quote

You can do it with readglobal() and writeglobal().
_________________
Back to top
View user's profile Send private message Send e-mail AIM Address
Guest







PostPosted: Fri Apr 18, 2003 8:34 pm    Post subject: storing items in a fake array Reply with quote

Whee! Fake arrays are fun.

here is a li'l example script to move your entire inventory into global variables.

Code:


# this constant should be the ID number of the first global
# variable to use for the item storage. In this example, 1.
# You should change this number so that it comes _after_
# all your other global variables
define constant(1,storage)

define script(autonumber,move all items to storage,0)
define script(autonumber,restore all items from storage,0)

script, move all items to storage, begin
  variable(item ID)
  # repeat a loop for each item ID
  for(item ID,0,255) do (
     # store the number of items in the fake array
     write global(storage+item ID,inventory(item ID))
     # erase the items from inventory
     delete item(item ID,inventory(item ID))
  )
end

script, restore all items from storage, begin
  variable(item ID)
  # repeat a loop for each item ID
  for(item ID,0,255) do (
     # add the items in storage to your current inventory
     get item(item ID,read global(storage+item ID))
     # erase the item from storage
     write global(storage+item ID,0)
  )
end



And there you have it!
What I am not sure about is how this script will handle situations where you have more than 99 of a particular item in your inventory. I do not remember how the "inventory" plotscripting command handles that situation. It *should* count all of them, and return a number larger than 99, but it is possible that I may have been lazy when writing that command, and only return the count of the first set of that item it finds. i would appreciate it if somebody could test this out for me, and mail me if "inventory" behaves wrongly when you have more than 99 of an item. (as for "get item" I do remember implementing that correctly, so if you do "get item(ID,100)" you will end up with two separate inventory entries, one of 99 and one of 01 -- but if somebody wants to double-check that behavior for me also, i would appreciate it :)

This also leads me to a thought-- and this is not just plotscripting related: What about situations when your item list fills up. The item list has 201 slots, which can contain up to 99 of any item. There can be duplicates. You could fill your entire list up with 19899 "Potion1" items if you really wanted to. But what happens when you try to add one more item? The current behavior is to ignore the new item. it is lost. But what if it is a mission-critical item? A key? The ultimate weapon? Something that sets a tag that you need to move on in the game? A player could get themselves stuck in any game by hyper-overstocking on cheap items and then missing out on important items later.

Does anybody have a suggestion for a nice clean simple way of handling conflicts like that?
Back to top
Bob the Hamster
OHRRPGCE Developer




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

PostPosted: Fri Apr 18, 2003 8:37 pm    Post subject: silly cookies! Reply with quote

Dead D'oh! I had cookie blocking enabled! No wonder it posted as "guest"
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Aethereal
SHUT UP.
Elite Designer
Elite Designer



Joined: 04 Jan 2003
Posts: 928
Location: Gone! I pop in on occasion though.

PostPosted: Fri Apr 18, 2003 11:24 pm    Post subject: Reply with quote

Add some way of telling the player, "Hey! This item is important! You have to drop something from your inventory to make room for it!". Then it opens the inventory...and the player has to delete an item and exit the inventory. If they don't (returns false), then the game says "Hey! You didn't drop an item!" and goes back to the inventory again.

That might not be simple, but I'm not a programmer, so I don't know :X
_________________
Back to top
View user's profile Send private message Send e-mail AIM Address
Bob360
Rusty Vet




Joined: 25 Mar 2003
Posts: 33

PostPosted: Thu Apr 24, 2003 2:22 am    Post subject: Reply with quote

I dont think there is a command for this and if there isnt you could get around it i think with some kind of goofy scripting (probably an array)...

Anywho... what you would need to do is have a loop runing that would tell the player when when has tomany items and let him no that no item he gets after this would count...

if there was a command like invetory number (where it would return the number of slots taken up all you would have to do is run a loop whenever the game is running that would constantly check howmany slots you have left and when you have none it would show a textbox saying "No room left in invetory"

or just do a script that would count how many of the items in the game you have and tell you if you have tomany...
Back to top
View user's profile Send private message
Uncommon
His legend will never die




Joined: 10 Mar 2003
Posts: 2503

PostPosted: Thu Apr 24, 2003 5:34 am    Post subject: Reply with quote

Unfortunately, there is no way of bringing up the inventory from a script (unless you have a custom menu...). James, get to work on that! XD

Seriously, though, we need a way to acess every submenu from a plotscript. Sure, you can fake a few with shops, like Team, Equip, and Save, but we need all of them!
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address
ChocoSOLDIER
Ghost haunting the board




Joined: 03 Feb 2003
Posts: 279

PostPosted: Fri Apr 25, 2003 3:11 am    Post subject: Reply with quote

Okay, here's something that drives me nuts: When the party splits, how do you avoid heros going back to base level?
Back to top
View user's profile Send private message Yahoo Messenger MSN Messenger
Uncommon
His legend will never die




Joined: 10 Mar 2003
Posts: 2503

PostPosted: Fri Apr 25, 2003 5:47 pm    Post subject: Reply with quote

Simple. Don't delete the heroes, place them in the reserve party (this would also require you to not allow the player to change the active party). That way, the hertoes that aren't currently in the party will retain their levels. That, or James could make a set hero level command...
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address
Display posts from previous:   
Post new topic   This topic is locked: you cannot edit posts or make replies.    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