[Script] [ACE] [VXA] Topic hỏi-đáp về script VXA

124678

Comments

  • slucis7593slucis7593 Posts: 544Registered
    Nagi wrote:
    $game_variables[1] = ($game_actors[1].next_level_exp - $game_actors[1].exp)
    Thử thay bằng kiểu này coi sao, rồi lấy nó ra từ variable 1. :huhu: :huhu:

    Đúng là = 50 đó bạn, không phải 112 - 50 đâu mà là 50 - 0
  • NagiNagi Posts: 589Registered
    slucis7593 wrote:
    Nagi wrote:
    $game_variables[1] = ($game_actors[1].next_level_exp - $game_actors[1].exp)
    Thử thay bằng kiểu này coi sao, rồi lấy nó ra từ variable 1. :huhu: :huhu:

    Đúng là = 50 đó bạn, không phải 112 - 50 đâu mà là 50 - 0
    Uhm mình quên mất, vừa nãy chuyển qua tab total mới thấy.
  • Focker_cFocker_c Posts: 1,577Registered
    Làm sao để loop lại 1 câu lệnh n lần ?
    Ví dụ như bên Game Maker thì mình vẫn dùng

    [php]
    repeat(n)
    {
    // Câu lệnh
    }
    [/php]

    Và hỏi thêm một cái là lệnh "for" ở ruby xài như nào ? Thấy mấy chỗ mà họ xài hơi khó hiểu.
  • NagiNagi Posts: 589Registered
    Không rõ lắm, hình như là, bên này hình như không có repeat phải dùng vòng lặp for thôi.
    For i in j
    Câu lệnh
    End
  • Focker_cFocker_c Posts: 1,577Registered
    Thì đó
    Đoạn " i in j " thì chẳng hiểu gì ^^
    Lại @death :D
  • DeathDeath Posts: 732Registered, Moderators
    Tóm tắt hộ cái.
  • Focker_cFocker_c Posts: 1,577Registered
    Câu hỏi 1 :
    Cách dùng câu lệnh for trong ruby
    Ví dụ lặp lại n lần một hành động Action_1

    Câu hỏi 2 :
    Truy vấn ID của weapopn mà $game_party.members[0] đang cầm.

    @death
  • DeathDeath Posts: 732Registered, Moderators
    1. http://taotrochoi.com/showthread.php?tid=1450#anchor_19430_6
    Số_lần_lặp = 3
    for i in 0...Số_lần_lặp #0,1,2
    msgbox i #Hiện 3 lần
    end

    2.
    $game_party.members[0].weapons[0].id
  • Focker_cFocker_c Posts: 1,577Registered
    Mình dốt quá :(
    Làm sao để lấy index icon của 1 item ?
  • DeathDeath Posts: 732Registered, Moderators
    thay .id = .icon_index
  • DeathDeath Posts: 732Registered, Moderators
    ^ dùng lệnh gì vậy?
  • Focker_cFocker_c Posts: 1,577Registered
    Tự viết được một cái window command cơ bản như thế này:

    [php]class Window_Command_Custom< Window_Command
    def make_command_list
    add_command("Line 1", :Line1)
    add_command("Line 2", :Line2)
    add_command("Line 3", :Line3)
    add_command("---Exit---", :Exit)
    end
    end

    class Scene_Custom < Scene_MenuBase
    def start
    super
    create_background
    create_window
    draw_pet_info
    end

    def create_window
    @mycad = Window_Command_Custom.new(32,32)
    @mycad.set_handler( :Line1 , method(:Action1))
    @mycad.set_handler( :Line2 , method(:Action2))
    @mycad.set_handler( :Line3 , method(:Action3))
    @mycad.set_handler( :Exit , method(:Action_exit))
    end

    def Action1
    # Action here
    @mycad.active = false
    end

    def Action_exit
    SceneManager.return
    end

    end[/php]


    Giờ muốn Line 2 bị xám ngoét :D và ko chọn được (Tức là unselectable ) thì làm sao nhỉ ?
    Nó chỉ unselectable khi biến Variable[1] == true chẳng hạn :)
  • DeathDeath Posts: 732Registered, Moderators
    add_command("Line 1", :Line1, $bien) #false = tắt
  • Focker_cFocker_c Posts: 1,577Registered
    add_command("Line 2", :Line2, @game_variables[1])

    Not workin , @death :(
  • DeathDeath Posts: 732Registered, Moderators
    $game_variables
    mới đúng :-ss
Sign In or Register to comment.