Announcement

Collapse
No announcement yet.

Questions about Traits

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

    Questions about Traits

    I was wondering if someone could give me an example of a Trait Script which targets an enemy's magic resistance levels and acts accordingly. For example: say your party member is a wizard and the both of you are fighting a Giant, who has 100 earth resistance but - 100 wind resistance. How can i get the wizard to use a wind spell on the giant based off his resistance levels.

    So far the only way i've been able to accomplish a similiar result is by assigning battle variables to each of my monsters corresponding to different elements and having the AI check for these different battle variables. In other words, i can get him to check for battle variable 1 and use a wind spell if the monster has such a variable assigned to him. But i've been unable to find a way for him to check specific resistances, such as equal to or less than -1 earth resistance.

    #2
    Re: Questions about Traits

    Well it seems like you are on the right track. Unfortunately there is no way to load all of their resistances at once but, by iterating through all the properties (starting at the first and going to the last) you can check each one, and store the number and resistance amount of the one which has the least resistance as you go through. Now of course you will have to know which types the person has, so you might want to go through their abilities first and see which magic properties they do actually possess.

    So
    1. Find all abilities the current party member has
    2. Get a list of all the magic properties they can use
    3. Check the resistance of one enemy (or each enemy) has to that property by using either Sub Target Att for Var, or setting a indirect effect on the enemy and using load indirect effect info.

    So you will need to set up Instigator Magic Property before each call to the loads. So look through the various load commands to get which variables you need as input, and which ones you get as output. So the best would be to go through all their abilities, and at each ability check it's Magic property, and what resistance the enemy has to it, then story the ability number and damage it would do in temp vars, only updating if the new ability is better than the other one. This might be a bit slow and is definitly more complicated than your method, but also more automatic.
    はじめまして。真(しん)の冷静(れいせい)です。どうぞよろしく。
    http://www.thetruecoolness.com/

    5198-2124-7210 Smash

    Comment


      #3
      Re: Questions about Traits

      You lost me when you said this : "So of course you will have to know which types the person has, so you might want to go through their abilities first and see which magic properties they do actually possess." When you say abilities do you mean resistances? Because i'm wanting to check for resistance levels, not abilities the target has.

      You said i could load all of the target's magic properties one by one and check the resistance of each - which sounds exactly what i'm wanting to do. Could you give me a example script to show me how you would do this, because i've been trying forever to use those Magic property and Resistance variables and have yet to figure out how to use them in my trait scripts. I'm able to check for HP, MP, Items the target has, any indirect effect that may be on the target, and respond accordingly - but for some reason i can't figure out how to check for a simple resistance level on a said magic property on any given target.

      To add some context i'll give you an example of a script i use to make a party member check other party members for low hp and to use a defensive spell called Tsinnah on any ally he sees with less than 45 hp.

      Script Branch condition: Variable [Magic points] >= 3 (the spell cost 3 mp)
      Battle: Check who goes first
      Script Branch: Repeat: Flag [Member Check] = Off
      Script Branch: Condition: Flag [Instigator Side] Off
      Target Data: Action Status Confirm [Death]
      Script Branch: Condition: Flag [Indirect Effect] = Off
      Target Data: Condition Status Confirm [Tsinnah] (the name of the spell)
      Script Branch: Condition: Flag [Indirect Effect] = Off
      Data: Flag [Stat Check Type] = On
      Battle: Substitute Target Attribute for variable
      Script Branch: Condition: Variable [Hit Points] <= 45
      Data: Set Battle Action (Use Magic)
      Data: Variable: [Actioin: B Member = [Insti Member]
      Data: Substitute Database Number for variable [Action:Item/Abty] Record Ability = Tsinnah

      Is there a way on a script like this, instead of checking a target to make sure the indirect effect of Tsinnah is not present and the target has less or equal to 45 HP - I could check magic Property 5 (Which is Earth) and concur it has less than or equal to -1 Resistance before acting.

      Sorry if it's a bit wordy but i'm trying to norrow down what we're talking about.
      Last edited by Jeremy; 09-01-2006, 01:41 PM.

      Comment


        #4
        Re: Questions about Traits

        Alright, for abilities you would first

        Store Member Number in the variable Member Number
        Store 0 in var 155:Ability Number
        SB: Repeat Ability Number < <Max Ability DB Num>
        Data: Confirm Member Ability
        SB: Condition 112:Has Magic On
        Load Ability Info
        SB: End
        SB: End

        Well now that I look at it, it seems the creators might have forgotten to let you load the Abilities Magic Property. I'll have to investigate this.

        Though you can try using

        Data: Variable Action:Itm/Abty
        and see if that won't set Instig PropertyM. A long shot but it might work.

        As for the checking I'm pretty sure that if you set Instig Property M and then do a Substitute Target Attribute for Variable, it will put the resitance in Target Resist M. Not 100% positive, as the direct effect might do this, but I'm pretty sure that should work.
        Last edited by thetruecoolness; 09-01-2006, 01:47 PM.
        はじめまして。真(しん)の冷静(れいせい)です。どうぞよろしく。
        http://www.thetruecoolness.com/

        5198-2124-7210 Smash

        Comment


          #5
          Re: Questions about Traits

          You replied so fast i think you missed the edited version of my post, so if you could reread it and then give it another shot in the context i gave be appreciated, because you're using a method that's so alien to me i have no idea where to even start.

          Comment


            #6
            Re: Questions about Traits

            Ok I see what you're doing, and that way will work too. But to check for actual resistance number (what you want, as in how resistant they are), you can set variable 36, then use Load Indirect Info, and it will spit out the resistance to that property (which the number of it is in Variable 36) to variable 174:Indirect: M Resist.

            Of course the problem with this is variable 36: Instigator M Property is read only, so I'm not sure where it gets set (possibly when an ability is chosen from the magic menu in battle, meaning you can't do it in a script). So your method of having an indirect effect for each spell may be the only way to do this from a trait script.

            I was just trying to figure out a way to load in the targets resistance to a specific type of Magic just using script commands. But through a little investigation I'm not sure this is possible. So it seems like either using custom statuses indicating resistance to a certain spell may be the only way.

            That said, if you sort your spell database cleverly (so that all magic with a specific type is next to each other), you can use a range check on the database number to determine the type. For instance say all fire magic is Abilities 0-9 in your database. Then in a script you check the ability number and if it is 0-9 you know it's a fire spell, and can then see if the enemy has fire resistance by checking for the indirect effect Fire.
            Last edited by thetruecoolness; 09-01-2006, 02:20 PM.
            はじめまして。真(しん)の冷静(れいせい)です。どうぞよろしく。
            http://www.thetruecoolness.com/

            5198-2124-7210 Smash

            Comment


              #7
              Re: Questions about Traits

              I see what your saying, but my problem has never been getting my party member to shoot a fire based monster with a water spell. I can accomplish that by just assigning all my monsters who are fire-based with a battle variable. For example: battle variable 1 = fire, so i just assign all my fire monsters with battle variable 1 and have my member check for battle variable 1, and if it's present he uses a water spell on the target. What i'm really after is a way to target changing resistance levels - let me try to explain:

              Let's say my main character has a natural -50% resistance to Dark and Ice magics. He goes to fight a Wizard with all elemental spells. I can assign battle variables to my main character representing that he is weak to Dark and Ice and have the wizard use these spells on him - but, let's say i was to add items or spells that increased resistance to certain magics. So may main character - in order to protect his weakness, puts on an accessory that adds 50% to dark magic. It would be nice if i could find a way to let the wizard check my main character and notice he no longer has a negative 50% to Dark Magic status and would then fall back to using Ice Spells instead to increase the challenge of the fight and not make the wizard so easy to defend against. Basically i'm trying to figure out a way to target changing resistance levels that isn't linked to abilities in any way.

              If the only way i can target though is by checking for indrect effects that correspond to certain resistance items or spells i may be able to work with that somewhat, but it will take a crap load of scripting. I don't know why the developers made it so difficult for the AI to recognize something as simple as a resistance level.
              Last edited by Jeremy; 09-01-2006, 02:45 PM.

              Comment

              Working...
              X