estriole

SAMPLE EST - SIMPLE NOTETAGS ACTOR

Jan 7th, 2013
572
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 1.54 KB | None | 0 0
  1. if $imported["EST - SIMPLE NOTETAGS"] == true
  2. ############################# EXAMPLE USAGE ####################################
  3. =begin
  4. example usage. i have notetags in ACTOR
  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.  
  24. =end
  25.  
  26. class Game_Actor < Game_Battler
  27.     attr_accessor :testnote1
  28.     attr_accessor :testnote2
  29.     attr_accessor :testnote3
  30.    
  31.     def testnote1
  32.       if !@testnote1                                  
  33.       a = actor.note_args("testnote")
  34.       @testnote1 = a[0].to_i if a[0]
  35.       end
  36.       return @testnote1
  37.     end
  38.  
  39.     def testnote2
  40.       if !@testnote2                                  
  41.       a = actor.note_args("testnote")
  42.       @testnote2 = a[1].to_i if a[0]
  43.       end
  44.       return @testnote2
  45.     end
  46.  
  47.     def testnote3
  48.       if !@testnote3                                  
  49.       a = actor.note_args("testnote")
  50.       @testnote3 = a[2].to_i if a[0]
  51.       end
  52.       return @testnote3
  53.     end
  54.    
  55. end
  56.  
  57.  
  58. end #end if imported simple notetags script
Advertisement
Add Comment
Please, Sign In to add comment