estriole

SAMPLE EST - SIMPLE NOTETAGS WEAPON

Jan 7th, 2013
465
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 1.59 KB | None | 0 0
  1. if $imported["EST - SIMPLE NOTETAGS"] == true
  2. ############################# EXAMPLE USAGE ####################################
  3. =begin
  4. example usage. i have notetags in WEAPON
  5. <testnote: 100 200 300>
  6.  
  7. and i want to have SEPARATE method to call each 100 200 and 300.
  8. lets set the method
  9. testnote1 return 100, testnote2 return 200, testnote3 return 300
  10. and i want it to return as integer because i want to use it in calculation
  11. i also want it to able to change in game and saved. so loading the file will not
  12. revert it back to database value...
  13. so i give you the example usage
  14.  
  15. to access testnote1
  16.  
  17. $game_actors[id].testnote1
  18.  
  19. for testnote2, etc just change to corresponding method
  20. to change the value of testnote1 ingame
  21.  
  22. $game_actors[id].testnote1 = x
  23. (NEED EST - DATA OBJECT SAVE SO IT WILL NOT REVERT BACK WHEN LOADING)  
  24.  
  25. =end
  26.  
  27. class RPG::Weapon < RPG::EquipItem
  28.     attr_accessor :testnote1
  29.     attr_accessor :testnote2
  30.     attr_accessor :testnote3
  31.    
  32.     def testnote1
  33.       if !@testnote1                                  
  34.       a = note_args("testnote")
  35.       @testnote1 = a[0].to_i if a[0]
  36.       end
  37.       return @testnote1
  38.     end
  39.  
  40.     def testnote2
  41.       if !@testnote2                                  
  42.       a = note_args("testnote")
  43.       @testnote2 = a[1].to_i if a[0]
  44.       end
  45.       return @testnote2
  46.     end
  47.  
  48.     def testnote3
  49.       if !@testnote3                                  
  50.       a = note_args("testnote")
  51.       @testnote3 = a[2].to_i if a[0]
  52.       end
  53.       return @testnote3
  54.     end
  55.    
  56. end
  57.  
  58.  
  59. end #end if imported simple notetags script
Advertisement
Add Comment
Please, Sign In to add comment