- Joined
- Mar 14, 2012
- Messages
- 693
- Reaction score
- 411
- Primarily Uses
Hello! Try $game_troop.troop.idWhat's the method for calling a troops id? A script uses this:
$game_troop.troop.troop_id
But that only returns an error.
Hello! Try $game_troop.troop.idWhat's the method for calling a troops id? A script uses this:
$game_troop.troop.troop_id
But that only returns an error.
Thanks, it worked!Hello! Try $game_troop.troop.id
Yes, it can be done (not by default though), and that would probably require its own topic.I have a question about the battle. It might be something I need a thread of, but just incase it is still in this section, I wanted to ask. Is there a way to let the scene_battle process keys instead of using the command_attack command in making attacks? For example, I want to assign A, S, D and W as the attacks of Actor 1, 2, 3 and 4, so when inside battle, I want the command menu and the window battle status to be hidden not unless I press X into my turn.
Certainly! Just click on the icon in the upper left-hand corner of the console window, then select the 'properties' option :Is there any way to automatically reposition the console window when testplaying? I'd like to automatically move it to the upper left of my monitor, since sometimes it appears behind the game window, meaning I'd have to move things around if I need to check it.
def console game_title = "PN : TAS - Forgotten Spirits" hwnd = Win32API.new('user32.dll', 'FindWindow', 'PP','N').call(0, game_title) Win32API.new('kernel32.dll', 'AllocConsole', '', '').call Win32API.new('kernel32.dll', 'SetConsoleTitle', 'P', '').call(game_title + ': Message Console') cons = Win32API.new('user32.dll', 'FindWindow', 'PP','N').call(0, game_title + ': Message Console') $stdout.reopen('CONOUT$') cons = Win32API.new('kernel32', 'GetConsoleWindow', 'V', 'L').call #This part changes console position Win32API.new('user32.dll','SetWindowPos','LLLLLLL','L').call(cons,hwnd,0,0,640,416,0) Win32API.new('user32.dll', 'SetForegroundWindow', 'P', '').call(hwnd) end
#==============================================================================# ** Game_BattlerBase#------------------------------------------------------------------------------# This base class handles battlers. It mainly contains methods for calculating# parameters. It is used as a super class of the Game_Battler class.#==============================================================================class Game_BattlerBase #-------------------------------------------------------------------------- # * NEW - Add Array of Additional Action Time Probabilities #-------------------------------------------------------------------------- def action_plus_add(percent) rpg_feature = RPG::BaseItem::Feature.new(FEATURE_ACTION_PLUS, 0, percent) feature_objects.each { |obj| obj.features.push(rpg_feature) if obj.is_a?(RPG::Actor) } end #-------------------------------------------------------------------------- # * NEW - Remove Array of Additional Action Time Probabilities #-------------------------------------------------------------------------- def action_plus_remove_all feature_objects.each { |obj| obj.features.reject! { |ft| ft.code == FEATURE_ACTION_PLUS } if obj.is_a?(RPG::Actor) } end end # Game_BatterBase
# The value for a 100% chance is 1.0; a 35% chance is 0.35, and so on ...$game_actors[member_id].action_plus_add(percent)$game_actors[member_id].action_plus_remove_all
@incoming = $game_map.events[1].myvar
I also can't RM right now, but on a portable jRuby i can access an uninitialized variable and it comes up as nil.to do it properly, you would also have to set @myvar to nil in the initialize subroutine, or your game could crash if you try to look at it and it hasn't been set.
Yeah that was just as an example. I am indeed going to be using it in a conditional branch.However I don't know why you'd want to set an @incoming variable in a script call when you'd have to do another script call to test it. It's more likely that you'd use it in a Conditional Branch or something.
Ah, so you're saying I should have a hash that uses an array [map_id, event_id] as its key?If you want something that persists along with the save file, and when you go between maps, you're better off creating a hash in Game_System that's keyed by map id and event id. Then set up a method in Game_Interpreter to set and retrieve the values, to make the script calls easier.
<object>.instance_eval do (class << self; self; end).send(:define_method, :test, lambda {|a| p a})end