|
Post by christi on Jan 9, 2005 11:18:33 GMT -5
What system, if any, is everyone implementing to manage multiple treasure chests?
I've placed my first treasure chest, using the preset chest scripts, and it works fine. Of course, placing multiple chests simply by placing multiple copies of the event won't work; once you open the first one, the others are all open, as well.
All that I can figure out how to do is create a seperate event/flag for each treasure chest, which would, essentially, allow each item obtained to be different as well, but this will also waste a lot of events/flags.
What I'm wondering is, is there any way to manage which treasure chests are open or closed using a variable of any sort? (I have a basic understanding of variables... I have an event, for example, that won't execute unless HP < Max HP) but I haven't done anything "advanced" with them, by any means.)
I'm thinking that there would be one variable that controlled all of the chests with, say, the "Fresh Herb" in them, and another that controlled all the chests with an "Angel Feather." If this is possible, it would definitely be a lot easier than a new event/flag for each chest, and a lot less of a waste.
Any help would be greatly appreciated.
|
|
|
Post by NASH7777 on Jan 9, 2005 12:05:53 GMT -5
Well you can make a system but it isn't worth it. You could have a variable in the chest script that checks what event # it is and depending on what # it is it will give you a different item based on that number and if the flag isn't flipped yet. This allows only for one script for the chests but you need multiple events still. I'm sure you could do it with a single event as well by checking it's xy or whatever but when it comes down to it, It's easier just making them each individually but it's up to you.
|
|
|
Post by Dungeon Warden on Jan 9, 2005 12:40:00 GMT -5
You could set up a variable that tests the variable number to see what chests are open and which are closed.
Var = 0 -- no chests open Var = 1 -- chest 1 open Var = 2 -- chest 2 open Var = 3 -- chest 1 and 2 are both open Var = 4 -- chest 3 open Var = 5 -- chest 1 and 3 are open Var = 6 -- chest 2 and 3 are open var = 7 -- chests 1, 2 and 3 are open etc.
As you can see, the more chests you have, the more numbers you need to check. For example: If there are 3 chests, you need to test 4 numbers to see if that chest is open. i.e. chest 1 needs to check numbers 1,3,5, and 7.
If you make areas that the player can't return to, you could reuse those flags. Optionally, you can reuse flags and allow players to return to areas and get the treasure over again (many professional games do this, so there is no reason you can't). Of course, unique items will also need unique flags, but there shouldn't be many of these items in the game.
|
|
|
Post by christi on Jan 9, 2005 12:43:58 GMT -5
Thanks a lot! I don't really plan on having loads of treasure chests all over the place, just in more out-of-the-way areas, so multiple events and/or lots of variable checking won't really be that huge of a problem. I'll probably try and set something up later today.
|
|
|
Post by Dungeon Warden on Jan 9, 2005 18:47:00 GMT -5
Oh, I forgot to mention (and I just checked my notes to be sure) that in the default chest item script you only need to change Sample Flag 50 and not Sample flag 60. Sample Flag 60 only checks if the chest is open (changes the model to the open chest motion), while Sample Flag 50 checks if you took the item or not. Just thought I'd mention it in case you wondered why there were two flags in the script and to save you the flags/ variables needed to replace both flags.
|
|
Deleted
Deleted Member
Posts: 0
|
Post by Deleted on Jan 9, 2005 22:42:19 GMT -5
I've found the easiest and quickest way's just to use one script, event, and flag for each chest, and reuse that flag if the place becomes unavailable to return to. Others than that, one way to cut down on to memory is make scripts that give randomized items to the player, and call those in each chest script (I have about 350 non-special items, so I did this of course).
|
|