Submit Your Article


 
RPG Maker

Welcome Guest ( Log In | Register )


  Games Resources RPG Maker VX RPG Maker XP Scripts Tutorials Downloads

> Want to add Auto-States to Weapons?, Take a look here!
AresWarrior
post Apr 27 2010, 06:03 PM
Post #1


Level 5
Group Icon

Group: Member
Posts: 69
Type: None
RM Skill: Beginner




In RPG Maker XP, there is no option to add an Auto-State to weapons. Well with this little script, you can.
(An Auto-State is a state that affects the user of the weapon.)

In the Scene_Battle 2 script, under @phase = 1, add this:

CODE
# Weapon Auto-State
if $game_party.actors.size >= 1
if $game_party.actors[0].weapon_id == WEAPON_ID
$game_party.actors[0].add_state(STATE_ID)
end
end
if $game_party.actors.size >= 2
if $game_party.actors[1].weapon_id == WEAPON_ID
$game_party.actors[1].add_state(STATE_ID)
end
end
if $game_party.actors.size >= 3
if $game_party.actors[2].weapon_id == WEAPON_ID
$game_party.actors[2].add_state(STATE_ID)
end
end
if $game_party.actors.size == 4
if $game_party.actors[3].weapon_id == WEAPON_ID
$game_party.actors[3].add_state(STATE_ID)
end
end

^^Change WEAPON_ID to the weapon that gives the state. Change STATE_ID to the state that the weapon gives. For each of the $game_party.actors, the IDs have to be the same if you want it to work. So if I wanted to make weapon #44 inflict state #55 then it would look like:
CODE
# Weapon Auto-State
if $game_party.actors.size >= 1
if $game_party.actors[0].weapon_id == 44
$game_party.actors[0].add_state(55)
end
end
if $game_party.actors.size >= 2
if $game_party.actors[1].weapon_id == 44
$game_party.actors[1].add_state(55)
end
end
if $game_party.actors.size >= 3
if $game_party.actors[2].weapon_id == 44
$game_party.actors[2].add_state(55)
end
end
if $game_party.actors.size == 4
if $game_party.actors[3].weapon_id == 44
$game_party.actors[3].add_state(55)
end
end


I know this script isn't much, but it can help a lot if you want weapons with special effects. (ie. Sharp Claw: Gives the user Sharpness.)
or if you simply want an animation to appear while wearing a certain weapon. (ie. a Gold Sword would show glowing animation)

Side Note: I know the script looks messy. I don't know how to make it look nice like "case blahblahblah when 1 then 2" etc.

This post has been edited by AresWarrior: Apr 27 2010, 07:02 PM
Go to the top of the page
 
+Quote Post
   



Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

Lo-Fi Version Time is now: 17th June 2013 - 10:25 PM
RPG RPG Revolution is an Privacy Policy and Legal
eXTReMe Tracker