( Doubt RGSS3 ) Help with codes

tiagoms

Veteran
Veteran
Joined
May 19, 2014
Messages
181
Reaction score
4
Primarily Uses
Well , I recently had the help of Shiroyasha Masked and about the commands , but some were open.

Following the logic :


    If the actor X has a greater amount of flowing or equal to Y
    !($game_actors[X].mp >= Y)
     
     
    If the actor X has a smaller quantity of HP or equal to Y
    !($game_actors[X].hp <= Y)
     
     
    If the actor has a number of X equals Y tp
    !($game_actors[X].tp == 50)
     
     
    If the actor can use the id X Y skill id
    !($game_actors[X].usable?($data_skills[Y]))
     
     
    If the Actor " X" in this state " Y "
    !($game_actors[X].state?(Y))
     
     
    If the Actor " X" OWN ability " Z "
    !($game_actors[X].skill_learn?($data_skills[Z]))
     
     
    Owning item " Z "
    !($game_party.has_item?($data_items[Z]))
     
     
    Actor X uses Y Weapon
    !($game_actors[X].weapons.include?($data_weapons[Y]))
     
     
    Actor X uses Y armor
    !($game_actors[X].armors.include?($data_armors[Y]))
     
     
    Actor " Z " is the party
    !($game_party.members.include?($game_actors[Z]))




How would I :

If the Actor X uses ( Equipped) Any weapons or armor in slot " Y " . (accessory , shell , etc. .. )

If the Actor X uses (equipped ) a weapon or armor, shield , etc. .. Type in " Y "

If one of the party is equipped with the weapon , armor , accessory, etc. ... " Y "

If the player has an " X" amount of item " Y " .

If the player " X" just use a " Y " ability.

If the Actor " X" just use a skill Type " Y "

If someone in the party just use a " Y " ability.

If someone in the party just use a skill Type " Y "

Force player " X" use skill " Y " actor in " Z "
 
Last edited by a moderator:

IMP1

"haystack".scan(/needle/)
Veteran
Joined
Mar 6, 2014
Messages
61
Reaction score
44
First Language
English
Primarily Uses
RMVXA
First of, all your examples are preceded by ! (an exclamation mark). This inverts the result, so while $game_actors[X].mp >= Y will check if X actor has mp greater or equal to Y, !($game_actors[X].mp >= Y) will check to see if that is NOT the case (which in this case is equivilent to checking if their mp is less than Y).

Secondly, to clarify what it is exactly that you want, I'm posting what I think you mean. If I'm wrong with anything, correct me.

  1. If actor X currently has equipped any item in an item slot Y (Y can be 'weapon', 'shield', 'head', 'body', 'accessory')
  2. If actor X currently has equipped item Y.
  3. If any actor in the party has equipped item X
  4. If the party has at least X number of item Y
  5. If the last ability used by actor X was skill Y (what's the difference between an ability and a skill?)
  6. see 5. Also, if the player hasn't battled in a while, then in theroy the last skill they used will still be Y.
  7. For any actor in the party, 6 is true.
  8. For any actor in the party, 7 is true.
  9. Force actor X to use skill Y with target Z
When you say ability, are you referring to party abilities like Increase Preemptive Strike, and Disable Surprise?

With these clarifications, I should be able to do this pretty simply tomorrow morning if nobody else has beaten me to it.
 

tiagoms

Veteran
Veteran
Joined
May 19, 2014
Messages
181
Reaction score
4
Primarily Uses
First of, all your examples are preceded by ! (an exclamation mark). This inverts the result, so while $game_actors[X].mp >= Y will check if X actor has mp greater or equal to Y, !($game_actors[X].mp >= Y) will check to see if that is NOT the case (which in this case is equivilent to checking if their mp is less than Y).

Secondly, to clarify what it is exactly that you want, I'm posting what I think you mean. If I'm wrong with anything, correct me.

  1. If actor X currently has equipped any item in an item slot Y (Y can be 'weapon', 'shield', 'head', 'body', 'accessory')
  2. If actor X currently has equipped item Y.
  3. If any actor in the party has equipped item X
  4. If the party has at least X number of item Y
  5. If the last ability used by actor X was skill Y (what's the difference between an ability and a skill?)
  6. see 5. Also, if the player hasn't battled in a while, then in theroy the last skill they used will still be Y.
  7. For any actor in the party, 6 is true.
  8. For any actor in the party, 7 is true.
  9. Force actor X to use skill Y with target Z
When you say ability, are you referring to party abilities like Increase Preemptive Strike, and Disable Surprise?

With these clarifications, I should be able to do this pretty simply tomorrow morning if nobody else has beaten me to it.
First I want to apologize .

My English is weak, and eventually , I use google translator to facilitate my understanding of some texts , and to find words that do not know.

the "Type" refers to the "Category" item or skill.

Example : Sword , Fire, Light , Armor , Accessories , Ice, "Key " ..

Yes , you are right , this method at the beginning " ! ( " Contrary to my request. Actually added it this way because I have a problem in a script YanFly , where he is " reversing " the values ​​.

Well , there is no difference between skill and ability. It was just an error in translation ( sorry) .

1 - I think it would be something like (NOT KNOW THE CONTROLS ) :

$ game_actors [X ] . weapons.include ( $ data_weapons )

$ game_actors [X ] . weapons.include ( $ data_armor )

$ game_actors [X ] . weapons.include ( $ data_shield )

Head , accessory .. ( classification )

2 - It is with respect to the " Type" . example :

Actor " X" is equipped with a sword . ( sword = type )

( other examples : AXEE , gun , bows , Katana ... )

Actor " Y " is equipped with a large shield (Large Shield == Type)

( other examples of " Type" : Small Shield )

Actor " Z " is equipped with ITEM " Amulet of Luck " ( lucky charm is an accessory ( classification ) , but has a type " General Armor "

.

3 - Ok

4 - Ok

5- OK

6 - If the last skill of the player "X" was the "Type Y".

Example: Last skill Actor "X" was Fire II ".

"Fire II" is the Type Fire (element)

Other elements: Ice, Shadow, Light, Thunder, Earth, Water ..

(or "last turn", or "last action")

7 - Same as the "5". but the "last turn", or "last action".

8 - same to "6", but being used "at the last turn" or "last in action."

9- Ok

==================================

"Skill group" (item 7 and 8)

I refer to any member of the group has used the ability.

Something like $ game_party.skill.used? ($ Data_skill [x])

$ game_party.skill.used? ($ data_skill [x]. Type [Y])

"type y" for ability => Data -> Terms -> Element -> Ice (exemple)
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
I've moved this thread to RGSSx Script Support. Please be sure to post your threads in the correct forum next time. Thank you.
 

IMP1

"haystack".scan(/needle/)
Veteran
Joined
Mar 6, 2014
Messages
61
Reaction score
44
First Language
English
Primarily Uses
RMVXA
I can help you with some of these, some (like forcing the actor to use a skill) are a bit much for me at the moment. I've only been using RMVXace for a couple of days.

  1. To check if actor 1 has any weapon equipped: !$game_actors[1].weapons.empty?
  2. To check if actor 1 has any armor equipped:
    Code:
    !$game_actors[1].armor.empty?
  3. To check if actor 1 has weapon 2 equipped:
    Code:
    $game_actors[1].weapons.include?($data_weapons[2])
  4. To check if actor 1 has armor 2 equipped:
    Code:
    $game_actors[1].armors.include?($data_armors[2])
  5. To check if any actor in the party has weapon 1 equipped:
    Code:
    $game_party.members.inject(false) { |t, actor| t = t || actor.equips.include?($data_weapons[1]) }
  6. To check if any actor in the party has armor 1 equipped:
    Code:
    $game_party.members.inject(false) { |t, actor| t = t || actor.equips.include?($data_armors[1]) }
  7. To check if the party has more than 2 of item 1 (I don't think this includes equipped items):
    Code:
    $game_party.item_number($data_armors[1]) > 2
  8. To check if the last skill used by actor 1 was skill 2:
    Code:
    $game_actors[1].last_skill.object == $data_skills[2]
  9. To check if the last skill used by actor 1 was of the element 2 (element 2 is fire by default):
    Code:
    $game_actors[1].last_skill.object.damage.element_id == 2
To check the last skill used by anyone in the party, you need a little script: http://pastebin.com/raw.php?i=5Ju854n9

And then to check if the last skill used by anyone in the party was skill 2:

$game_party.last_skill.object == $data_skills[2]And then to check if the last skill used by anyone in the party was of the element 2:

Code:
$game_party.last_skill.object.damage.element_id == 2
 

tiagoms

Veteran
Veteran
Joined
May 19, 2014
Messages
181
Reaction score
4
Primarily Uses
Very good man!
Two questions:

1 - For the commands to work, is necessary the script?
2 - the script gave error. (image attached)

obs- "Force Actor 1, use the skill 2, is easy by the common events, but, force actor 1, use skill 2 in actor 3, is the problem, because the common events not have the option"

imagem.JPG
 

tiagoms

Veteran
Veteran
Joined
May 19, 2014
Messages
181
Reaction score
4
Primarily Uses
 

One user commented on the possibility of using "location of the Battle" to force this action.

Check for:
"Actor X" is in the "Y" position
would be:
    $game_party.battle_members[x] == $game_actors[id]

Works perfectly.

But it's hard to find the commands:
1) force "Actor X" use "Magic Y" in "Actor Z" or
2) Force "Actor X" use "Magic Y" in "Z position"

the second (2), is due to the existing limitations in the context of events, where he lets go from -2 to 8 (ultimo target, random target, position 1, and so on)
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

How many parameters is 'too many'??
Yay, now back in action Happy Christmas time, coming back!






Back in action to develop the indie game that has been long overdue... Final Fallacy. A game that keeps on giving! The development never ends as the developer thinks to be the smart cookie by coming back and beginning by saying... "Oh bother, this indie game has been long overdue..." How could one resist such? No-one c
So I was playing with filters and this looked interesting...

Versus the normal look...

Kind of gives a very different feel. :LZSexcite:
To whom ever person or persons who re-did the DS/DS+ asset packs for MV (as in, they are all 48x48, and not just x2 the pixel scale) .... THANK-YOU!!!!!!!!! XwwwwX

Forum statistics

Threads
105,849
Messages
1,016,977
Members
137,563
Latest member
cexojow
Top