Announcement

Collapse
No announcement yet.

Is it possible to add random stats to items?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Is it possible to add random stats to items?

    I was wanting to use a item system similiar to Diablo. You would find cursed items - which you bring to the appropriate NPC and activate a script which adds random stats to all of the attribute bonuses on the item. I had a pretty simple method i was planning to use - which should have been my first clue it wasn't going to work.

    My plan was to use variables such as variable 143: Item: Equip Str (This variable is the STR amount that changes when the item designated by variable 134: Item Number is equippped). So i was just going to write a script that loaded the item info, then go to data and have Variable 143: Item: Equip Str = 1 ? 30 and so on. Unfortunately for some annoying reason it won't let me use this variable in the upper left corner of the variable screen. It's grayed out for use and only let's me use this variable in one of the lower selections, which means i can't have a random number equal to it.

    Only way i'll be able to get what i want without being able to use this method i can think of is by manually making hundreds of different items with different stat increases and have them randomly generate to replace the cursed item. This isn't realistic for obvious reasons because it would chew up way too much memory. So if anyone has any good ideas or ways i could use that variable to add random figures to an item's attribute bonuses i'd appreciate it. Since it was so easy to add random stat increases to your party members i incorrectly assumed it would be equally easy to add them to items - which sadly wasn't the case.
    Last edited by Jeremy; 09-11-2006, 11:09 PM.

    #2
    Re: Is it possible to add random stats to items?

    There are variables embedded into the system you cannot edit but overwrite another variable's value with, you just ran into one of them. Probably to keep people from being even more confused when other data is loaded as a security measure.

    You could have a system which changes or influences the player's stats based on the item.
    Quote of the moment - "When you cut down a tree, don't stand near it."

    Comment


      #3
      Re: Is it possible to add random stats to items?

      Problem with adding stats to the actual character stats is they can't be random - else it'll be impossible to make a script removing the correct stat bonus when a player takes off the item. Since it was a random number i have no idea by what figure to decrease the stat value by when taking off the item.

      Again, adding stats to a character when equiping an item is simple. I can do that easy just by using the item editor alone without even scripting. It's adding random stats i'm after - that way making a much larger selection of items than otherwise possible. Basically my own random item generator.

      If there is a way to transfer stat bonuses from a character onto an item that may work however - so if you have any ideas how i could do that i'd love to hear them. For example: i could load an unused party member with 0 stats, add random stat increases to him, then transfer his stats onto an item. Then i would decrease all of the party member's stats back to 0, remove the item from his equipment, remove that party member from the party - then finally just give the randomly generated item to my main character.
      Last edited by Jeremy; 09-12-2006, 02:21 PM.

      Comment


        #4
        Re: Is it possible to add random stats to items?

        Well one thing you could consider is making a item "character". That way you can use member info load, and save on this character to get the stats. So then you can have random numbers and an easy place to store them. Characters can essentially be used a variable holders, or Objects if you're familiar with programming. Just make sure they never show up as actual characters in your party an you're good.
        はじめまして。真(しん)の冷静(れいせい)です。どうぞよろしく。
        http://www.thetruecoolness.com/

        5198-2124-7210 Smash

        Comment


          #5
          Re: Is it possible to add random stats to items?

          Sounds like a good idea but i can't figure out how to transfer those stats over to an item. Only thing i've been able to work out is using a script that activates when you equip an item that adds random stats to the base attributes of your character. The problem with that is getting rid of the stats once you unequip the item, since they are randomly generated numbers. So doesn't work very well. If you have any ideas on how to get rid of the random stat bonuses after i add them appreciate it much.

          Btw, you're transition script you had up in the tricks and tips thread was awesome. I shamelessly copied it and use it now in my game So wanted to say thanks for sharing it with everyone. If you'd like to share your scripts for caculating weather, applying weather, and for displaying the day of the week i'd like to see them also and incorporate them in my game too. I'll be sure to add a special thanks to you in the in-game credits because i spent forever trying to make a transition script that didn't reset when you changed areas.

          Also: is there a way to auto save? I've been trying to figure out a way to automatically save the game after important decisions on the game to prevent players from just loading it and playing it again until they get the result they want. But the show save window command in Other allows the player the choice to cancel save and i can't find out how to change that anywhere.

          Comment


            #6
            Re: Is it possible to add random stats to items?

            Auto save I don't think so, since that's handled by the system, and not possible to fool around with the save function. Really I don't like games that do that anyway, since you're limiting what the player can do, and really it should be up to the player if they want to cheat or not. Of course that's my personal opinion on design so you're welcome to disagree.

            I'm glad you liked the script, and that are giving me credit as that is all people ask for when posting their scripts in the tips and tricks. As for the weather I might eventually but I'm pretty busy working on other things at the moment. All I do is a similar thing to the transition, and just use random numbers to determine weather. But at each transition at the weather you have a couple of set weather conditions that can come up, so like sunny doesn't go straight to thunderstorm, it has to rain first. So just set up a state machine with probabilities of changing to each state, and put this in a calculate weather script.

            With the item, what you do is set the character number (using an unused variable) the stats for the item are stored in. Then when you unequip the item, subtract those stats off. That's what I was talking about. You need the character DB number to determine which one has the stats and must store that, but it's better than having to store every stat you change in a seperate variable.
            はじめまして。真(しん)の冷静(れいせい)です。どうぞよろしく。
            http://www.thetruecoolness.com/

            5198-2124-7210 Smash

            Comment


              #7
              Re: Is it possible to add random stats to items?

              I don't follow - how can i subtract a randomly generated number?

              I understand since i can't add random figures to the item itself (since for some dumb reason it won't let me edit the item equip stat variables) i (i'll need to add them to the character's actual stats when the item is equiped - but how would i make a script that subtracts a random number when unequipping the item? For example:

              Member Info: Load
              Data: Variable 255 = 1 ? 30
              Strength =
              Strength + Variable 255
              Member Info: Save

              That's an easy enough script to apply when equipping an item, just put it into indirect effect space on the item itself for use when equippped - but

              How would i subtract a randomly generated number like 1 ? 30? I have no way of knowing which number the stat increase will be before equipping the actual item, so how will i be able to make a script beforehand that subtracts the correct value?

              Comment


                #8
                Re: Is it possible to add random stats to items?

                Maybe you missed what I originally said, or the implications of it. What you can do is set up a dummy character, then store random values in his stats, then you can add those stats to the actual character. So then since these values are stored in the dummy character, you can just recall them and subtract them from the other character. You'll need some temp variables obviously since you can't do two member info loads without losing one of their stats variables. So then all you need to store for the item, is the character database number of the dummy character, so you can load and save the random stats.

                Another thing to note, is that random numbers are generated based on the time the party has been on a map. So you can't do random numbers on a Map Enter or Auto event.
                はじめまして。真(しん)の冷静(れいせい)です。どうぞよろしく。
                http://www.thetruecoolness.com/

                5198-2124-7210 Smash

                Comment


                  #9
                  Re: Is it possible to add random stats to items?

                  That's fine, i have enough stuff packed into my enter map script as it is, but i'm still having trouble following what you're saying (i'm stupid, sorry ) How can i store random numbers on a dummy character?

                  Comment


                    #10
                    Re: Is it possible to add random stats to items?

                    Data: Member Number = (Dummy Character)
                    Member Info Load
                    Data: Strength (or some other attribute) = 1 ? 100
                    Data: Temp Var0 = Strength + 0
                    Member Info Save

                    Data: Member Number = (actual Character)
                    Member Info Load
                    Data: Strength (or some other attribute) = Strength + Temp Var0
                    Member Info Save
                    はじめまして。真(しん)の冷静(れいせい)です。どうぞよろしく。
                    http://www.thetruecoolness.com/

                    5198-2124-7210 Smash

                    Comment


                      #11
                      Re: Is it possible to add random stats to items?

                      After reading over it 10 times or so i think i finally get what you're doing. We operate under different levels of intelligence so you have to be patient with me sometimes Anyway, very resourceful way to use variables - and you impressed me yet again. Plenty here to work with. I"m assuming to subtract the random number when unequipping the item i just do:

                      Data: Member Number = (Actual Character)
                      Member Info Load
                      Data: Strength = Strength - Temp Var0 ?

                      Comment


                        #12
                        Re: Is it possible to add random stats to items?

                        Nope, you have to load the dummy character first and store it to the Temp Var0. See the point of the Temp Vars is that they can be overwritten at anytime (though really only by the default scripts or you). The dummy characters still has the random numbers you stored so you have to load them again, then you have to store them to a temp var before subtracting them from the actual character (since like I said, Member Info Load on the actual character will overwrite the attribute variables with his values).
                        はじめまして。真(しん)の冷静(れいせい)です。どうぞよろしく。
                        http://www.thetruecoolness.com/

                        5198-2124-7210 Smash

                        Comment


                          #13
                          Re: Is it possible to add random stats to items?

                          How about this?

                          Data: Member Number = (Dummy Character)
                          Member Info Load
                          Strength = Temp Var0
                          Data: Member Info Save
                          Data: Member Number = (Actual Character)
                          Data: Member Info Save
                          Strength = Strength - Temp Var0
                          Data: Member info Save

                          I don't have a lot of experience using my own variables yet so i'm still in the learning process when it comes to different ways to use them.

                          Comment


                            #14
                            Re: Is it possible to add random stats to items?

                            Originally posted by Jeremy
                            How about this?

                            Data: Member Number = (Dummy Character)
                            Member Info Load
                            Strength = Temp Var0
                            Data: Member Info Save // Not neccessary on this one
                            Data: Member Number = (Actual Character)
                            Data: Member Info Load
                            Strength = Strength - Temp Var0
                            Data: Member info Save

                            I don't have a lot of experience using my own variables yet so i'm still in the learning process when it comes to different ways to use them.
                            With the few minor changes yeah that's it.
                            はじめまして。真(しん)の冷静(れいせい)です。どうぞよろしく。
                            http://www.thetruecoolness.com/

                            5198-2124-7210 Smash

                            Comment


                              #15
                              Re: Is it possible to add random stats to items?

                              Thank you
                              Last edited by Jeremy; 09-13-2006, 10:50 PM.

                              Comment

                              Working...
                              X