Hỏi về Sript

Thảo luận trong 'Game Development' bắt đầu bởi Ice Dragon, 8/5/05.

  1. Ice Dragon

    Ice Dragon Mega Man

    Tham gia ngày:
    6/9/04
    Bài viết:
    3,101
    Nơi ở:
    none
    Hic,có ai có link nào về Script(hướng dẫn chứ không phải ứng dụng nha) thì cho tui bếit với,cái trang lần trước Ken đưa wăng đâu mất tiêu rồi,giờ muốn nghiên cứu lại để làm game chơi mà không nhớ link T_T.Ai có bíêt link nào đưa giúp với,càng nhiều link càng tôt́ ^^
     
  2. khoaiRPG

    khoaiRPG T.E.T.Я.I.S

    Tham gia ngày:
    24/3/05
    Bài viết:
    652
    Script nèo, nhìu loại script lắm, hay là ruby của RPGXP
     
  3. Ice Dragon

    Ice Dragon Mega Man

    Tham gia ngày:
    6/9/04
    Bài viết:
    3,101
    Nơi ở:
    none
    Loại ruby tui cần nó hơn ^^
    30char
     
  4. khoaiRPG

    khoaiRPG T.E.T.Я.I.S

    Tham gia ngày:
    24/3/05
    Bài viết:
    652
    đây cố mò đi nhé


    phần 1


    Mã:
    You can use many different tools to manage your conditions, here's a list:
    
    Effects Code 
    IF EQUAL TO  == 
    IF BIGGER THAN  > 
    IF SMALLER THAN  < 
    IF SMALLER OR EQUAL THAN  <= 
    IF BIGGER OR EQUAL THAN  >= 
    IF NOT EQUAL TO  != 
        
    AND && 
    OR || 
        
    SET VALUE EQUAL TO  = 
    ADDITION += 
    SUBTRACTION -= 
    MULTIPLICATION *= 
    DIVISION /=  
    MODULUS %= 
    EXPONENTIATION ** 
    
      
     
    (1.1.1) If Expressions : 
    
    
     
    If Expression Syntax: 
    if component == condition 
    actions
    elsif component == condition 
    actions
    else
    actions 
    end 
    
     
    
    If Expression Example: 
    if $game_switches[1] == true 
    $game_variables[1] = 1 
    elsif $game_switches[2] == true 
    $game_variables[2] = 1 
    else
    $game_switches[3] = true 
    end 
    
    
     
    
    The if Expression evaluate (verify, check) the component's content against the condition, the if Expression becomes "True" when the condition is met. When the Expression is "True", the actions listed below the first if Expression is processed. If the Expression return "False" (The conditions aren't met), the if Expression jumps to the next Else (elsif/Else) line in the code, and evaluate it again. The if Expression will end when the keyword "END" is met.
     
    
    (1.1.2) Case Expressions : 
    
    
     
    Case Expression Syntax: 
    case component 
    when 0 .. 2 
    actions 
    when 3 .. 6
    actions
    Else
    actions
    End 
    
    
     
    
    Case Expression Example: 
    case $gold 
    when 0 .. 50 
    $game_variables[1] = "Poor"
    when 51 .. 100
    $game_variables[1] = "Rich"
    Else
    $game_variables[1] = "Ultra Rich "
    End 
    
     
     
    
    The case Expression evaluate (verify, check) the component's content against the condition, the case Expression becomes "True" when the condition is met. When the Expression is "True", the actions listed below the first when Expression is processed. If the Expression return "False" (The conditions aren't met), the case Expression jumps to the next When (or else) line in the code, and evaluate it again. The case Expression will end when the keyword "END" is met.
    
    The line "when 0 .. 50" tells the system to check if the component's value are between 0 and 50 included. Meaning that the condition will be true if the value of the variable $gold (from our example) is between 0 and 50, including 50.
     
    
    (1.1.3) Unless Expressions : 
    
    
     
    Unless Expression Syntax: 
    unless component == condition
    actions 
    Else 
    actions
    End 
    
    
    
    
     
    
    
    Unless Expression Example: 
    unless $gold == 10
    $game_switches[1] = false 
    Else 
    $game_switches[1] = true 
    End 
    
    
     
    
    The unless Expression evaluate (verify, check) the component's content against the condition, the unless Expression becomes "True" when the condition isn't met. When the Expression is "True", the actions listed below the first unless Expression is processed. If the Expression return "False" (The conditions are met), the Expression jumps to the else line in the code, and process it. The unless Expression will end when the keyword "END" is met.
    
    Meaning that when the variable $gold (from our example) equals 10, the $game_switches[1] = true action will be processed and that switch will be ON. Otherwise, the $game_switches[1] = false action will be processed and that switch will be OFF. 
     
    
    (1.1.4) While Statement (Loop) : 
    
    
     
    
    
    While Statement Syntax: 
    while component == condition
    actions 
    End 
    
    
    
     
    
    
    While Statement Example: 
    while $gold == 10
    $game_switches[1] = true 
    End 
    
    
     
    
    The while Statement evaluate (verify, check) the component's content against the condition, the while Statement becomes "True" when the condition is met. When the Statement is "True", the actions listed below the while Statement is processed. Those actions will be processed as long as the condition is true, meaning that the game may freeze if there isn't another Event that may modify the state of the component's value; because the actions will always be processing. 
    
    If the variable $gold equals 10, the Statement is true, therefore the actions $game_switches[1] = true will be processed for as long as $gold equals 10. If $gold doesn't change, the game will be stuck in the while Statement. Using this kind of code in a Call Script may freeze your game, because this is a "loop" statement. 
     
    
    (1.1.5) Until Statement (Loop) : 
    
    
     
    
    
    Until Statement Syntax: 
    until component == condition
    actions 
    End 
    
     
    
    
    Until Statement Example: 
    until $gold == 10
    $game_switches[1] = true 
    End 
    
    
     
    
    The until Statement evaluate (verify, check) the component's content against the condition, the until Statement will process the actions for as long as the component's value do not meet the condition. 
    
    Meaning that until our variable $gold equals 10, the action $game_switches[1] = true is processed. Using this kind of code in a Call Script may freeze your game, because this is a "loop" statement. 
     
    
    (1.2) For Loop : 
    
    
     
    For Loop Syntax A: 
    for i in start..end
    actions
    end 
    
    
     
    
    A For Loop will execute it's body (actions) until it reaches the end value. The For Loop actually "iterate" the actions found in its body and store the numbers of iteration in the variable i. We can use any numbers or string (text) as start and end value. This will create the For Loop range. A range is defined using points (..) or (...). Using two points, as in the example above will make a range starting from the start value and ending at the end value, including the end value. Using 3 points (...) will exclude the end value. See the example below. 
    
    
    For Loop Syntax Example A1: 
    for i in 0..10
    print i 
    end 
    
    
    
    
    *Will print on screen the following result, each one in a new window:
    
    0
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10 
     
    
    
    For Loop Syntax Example A2: 
    for i in 0...10
    print i 
    end 
    
    
    
    
    *Will print on screen the following result, each one in a new window:
    
    0
    1
    2
    3
    4
    5
    6
    7
    8
    9
     
    
    
    For Loop Syntax Example A3: 
    for i in "a".."e"
    print i 
    end 
     
    
    
    *Will print on screen the following result, each one in a new window:
    
    a
    b
    c
    d
    e
    
     
    
    
    For Loop Syntax B: 
    for i in [value1, value2, value3, etc] 
    actions
    end 
    
     
    
    This syntax works as the other one shown above, but we specifically tells the for loop what i will be equals to in each iteration (loop). Look at the following sample, and remember that once again, string and integers (text and numbers) can be used.  
    
    
    For Loop Syntax Example B: 
    for i in [1, 5, "c", 20] 
    print i 
    end 
    
    
    
    
    *Will print on screen the following result, each one in a new window:
    
    1
    5
    c
    20 
     
    

    phần 2


    Mã:
    
    (5.1) Actors (Heros) : 
    
    
     
    
    
    Actor Syntax #1: 
    $data_actors[actor_id] 
    
     
    
    
    Actor Syntax #2: 
    $game_actors[actor_id] 
    
     
    
    $data_actors and $game_actors are the code used to refer to an actor (an hero) of your project; and actor_id is where you write the actual ID of your hero. In many cases, both syntaxes can be used; when it is the case, I'll write them both.
    
    $data_actors refers to the database's default values. $game_actors refers to the actual in-game values. 
    
    This means that if you use $data_actors[actor_id].name, the name will be the one you specified in the database; even if you change the name of that hero during the game, the value residing in $data_actors[actor_id].name will be the default database one. 
    
    On the other hand, if you use $game_actors[actor_id].name, the name will be the one that the hero currently have in the game. Wich means that you always have 2 names available per heroes. 
    
    Another important note, the syntax $data_actors[actor_id] are all ATTR_READER only, except for the parameters (max value) of the stats. Which means you cannot write in $data_actors[actor_id].name. This is normal since we have said that $data_actors reflect the database default values. If you want to write in a hero setting, use the $game_actors[actor_id] syntax instead. So, you can do something like: $game_actors[actor_id].name = "My Name" in a call script to change the name of an hero; something you cannot do with $data_actors[actor_id].name. 
    
    I hope all this helped you ! 
     
    Actor Name Syntax: 
    $data_actors[actor_id].name
    -and-
    $game_actors[actor_id].name  
    
     
    
    
    Actor Character Set File Syntax: 
    $data_actors[actor_id].character_name
    -and-
    $game_actors[actor_id].character_name 
    
     
    
    
    Actor Character Set Hue Color Syntax: 
    $data_actors[actor_id].character_hue
    -and-
    $game_actors[actor_id].character_hue  
    
     
    
    
    Actor Battler Set File Syntax: 
    $data_actors[actor_id].battler_name
    -and-
    $game_actors[actor_id].battler_name  
    
     
    
    
    Actor Battler Hue Color Syntax: 
    $data_actors[actor_id].battler_hue
    -and-
    $game_actors[actor_id].battler_hue 
    
     
    
    
    Actor Class ID# Syntax: 
    $data_actors[actor_id].class_id
    -and-
    $game_actors[actor_id].class_id 
    
     
    
    
    Actor Class Name Syntax: 
    $data_classes[$data_actors[actor_id].class_id].name
    -and-
    $game_actors[actor_id].class_name 
    
     
    
    
    Actor Weapon ID# Syntax: 
    $data_actors[actor_id].weapon_id
    -and-
    $game_actors[actor_id].weapon_id  
    
     
    
    
    Actor Weapon Name Syntax: 
    $data_weapons[$data_actors[actor_id].weapon_id].name
    -and- 
    $data_weapons[$game_actors[actor_id].weapon_id].name 
    
     
    
    
    Actor Shield ID# Syntax: 
    $data_actors[actor_id].armor1_id
    -and-
    $game_actors[actor_id].armor1_id 
    
     
    
    
    Actor Shield Name Syntax: 
    $data_armors[$data_actors[actor_id].armor1_id].name
    -and-
    $data_armors[$game_actors[actor_id].armor1_id].name 
    
     
    
    
    Actor Helmet ID# Syntax: 
    $data_actors[actor_id].armor2_id
    -and-
    $game_actors[actor_id].armor2_id 
    
     
    
    
    Actor Helmet Name Syntax: 
    $data_armors[$data_actors[actor_id].armor2_id].name
    -and-
    $data_armors[$game_actors[actor_id].armor2_id].name 
    
     
    
    
    Actor Armor ID# Syntax: 
    $data_actors[actor_id].armor3_id
    -and-
    $game_actors[actor_id].armor3_id 
    
     
    
    
    Actor Armor Name Syntax: 
    $data_armors[$data_actors[actor_id].armor3_id].name
    -and-
    $data_armors[$game_actors[actor_id].armor3_id].name 
    
     
    
    
    Actor Accesorry ID# Syntax: 
    $data_actors[actor_id].armor4_id
    -and-
    $game_actors[actor_id].armor4_id 
    
     
    
    
    Actor Accesorry Name Syntax: 
    $data_armors[$data_actors[actor_id].armor4_id].name
    -and-
    $data_armors[$game_actors[actor_id].armor4_id].name 
    
     
    
    
    Actor Initial Level Syntax: 
    $data_actors[actor_id].initial_level 
    
     
    
    
    Actor Status Parameters Syntax: (Simpler method will follow...)
    $data_actors[actor_id].parameters[status_id, level] 
    
     
    
    status_id is the ID# of the parameter you want to access, I.E: Maximum HP have ID# 0, and Maximum SP have ID# 1 (etc). level specifies from wich level you want to see the value; I.E: If you write 10 in the level section, the system will refer to the value of the Maximum HP that particular actor will have or had at level 10. Simpler method can be used with "game_actors" instead of "data_actors", they will be explained below. This syntax is better to forcast a parameter value for a given character.
    
    List of all Status Parameters ID#:
    
    Parameters ID# 
    Maximum HP  0 
    Maximum SP  1 
    Strengh 2 
    Dexterity 3 
    Agility 4 
    Intelligence 5 
    
     
    
    
    Actor Current HP Syntax: 
    $game_actors[actor_id].hp 
    
     
    
    
    Actor Current Maximum HP (MAXHP) Syntax: 
    $game_actors[actor_id].maxhp 
    
     
    
    
    Actor Current SP Syntax: 
    $game_actors[actor_id].sp 
    
     
    
    
    Actor Current Maximum SP (MAXSP) Syntax: 
    $game_actors[actor_id].maxsp 
    
     
    
    Actor Current Level Syntax: 
    $game_actors[actor_id].level 
     
    
    Actor Current Experience (EXP) Syntax: 
    $game_actors[actor_id].exp 
     
    
    Actor Current Strengh (STR) Syntax: 
    $game_actors[actor_id].str 
     
    
    Actor Current Dexterity (DEX) Syntax: 
    $game_actors[actor_id].dex 
     
    
    Actor Current Agility (AGI) Syntax: 
    $game_actors[actor_id].agi 
     
    
    Actor Current Intelligence (INT) Syntax: 
    $game_actors[actor_id].int 
     
    
    Actor Current Attack Power (ATK) Syntax: 
    $game_actors[actor_id].atk 
     
    
    Actor Current Physical Defense (PDEF) Syntax: 
    $game_actors[actor_id].pdef 
     
    
    Actor Current Mind Defense (MDEF) Syntax: 
    $game_actors[actor_id].mdef 
     
    
    Actor Current Evasion (EVA) Syntax: 
    $game_actors[actor_id].eva 
     
    
    (5.2) Enemies (Monsters) : 
    
     
    
    
    Enemies Syntax: 
    $data_enemies[enemy_id] 
    
     
    
    $data_enemies is the code used to refer to an enemy (a monster) of your project; and enemy_id is where you write the actual ID of your monster.  
    
    
    Enemy Name Syntax: 
    $data_enemies[enemy_id].name 
    
     
    
    
    Enemy Max HP Syntax: 
    $data_enemies[enemy_id].maxhp 
    
     
    
    
    Enemy Max SP Syntax: 
    $data_enemies[enemy_id].maxsp 
    
     
    
    
    Enemy Strengh (STR) Syntax: 
    $data_enemies[enemy_id].str 
    
     
    
    
    Enemy Dexterity (DEX) Syntax: 
    $data_enemies[enemy_id].dex 
    
     
    
    
    Enemy Agility (AGI) Syntax: 
    $data_enemies[enemy_id].agi 
    
     
    
    
    Enemy Intelligence (INT) Syntax: 
    $data_enemies[enemy_id].int 
    
     
    
    
    Enemy Attack Power (ATK) Syntax: 
    $data_enemies[enemy_id].atk 
    
     
    
    
    Enemy Physical Defense (PDEF) Syntax: 
    $data_enemies[enemy_id].pdef 
    
     
    
    
    Enemy Mind Defense (MDEF) Syntax: 
    $data_enemies[enemy_id].mdef 
    
     
    
    
    Enemy Attack Animation ID# Syntax: 
    $data_enemies[enemy_id].animation1_id 
    
     
    
    
    Enemy Target Animation ID# Syntax: 
    $data_enemies[enemy_id].animation2_id 
    
     
    
    
    Enemy Experience (EXP) Syntax: 
    $data_enemies[enemy_id].exp 
    
     
    
    
    Enemy Gold Reward Syntax: 
    $data_enemies[enemy_id].gold 
    
     
    
    
    Enemy Item Reward ID# Syntax: 
    $data_enemies[enemy_id].item_id 
    
     
    
    
    Enemy Item Reward Name Syntax: 
    $data_items[$data_enemies[enemy_id].item_id].name 
    
     
    
    
    Enemy Weapon Reward ID# Syntax: 
    $data_enemies[enemy_id].weapon_id 
    
     
    
    
    Enemy Weapon Reward Name Syntax: 
    $data_weapons[$data_enemies[enemy_id].weapon_id].name 
    
     
    
    
    Enemy Armor Reward ID# Syntax: 
    $data_enemies[enemy_id].armor_id 
    
     
    
    
    Enemy Armor Reward Name Syntax: 
    $data_armors[$data_enemies[enemy_id].armor_id].name 
    
     
    
    
    Enemy Treasure Probability Syntax: 
    $data_enemies[enemy_id].treasure_prob 
    
     
    
    
    Enemy Battle Graphic Name Syntax: 
    $data_enemies[enemy_id].battler_name 
    
     
    
    
    Enemy Battle Graphic Color HUE Syntax: 
    $data_enemies[enemy_id].battler_hue 
    
     
    
    
    (5.3) Items: 
     
    
    
    Items Syntax: 
    $data_items[item_id] 
    
     
    
    $data_items is the code used to refer to an item of your project; and item_id is where you write the actual ID of your item.  
    
    
    Item Name Syntax: 
    $data_items[item_id].name 
    
     
    
    
    Item Usability Syntax: 
    $data_items[item_id].occasion 
    
     
    
    List of value and usability names:
    
    Value Usability Name In Database  
    0 Battle + Menu  
    1 Battle 
    2 Menu 
    3 Not Useable  
    
      
     
    Item Icon Name Syntax: 
    $data_items[item_id].icon_name 
    
     
    
    
    Item Description Syntax: 
    $data_items[item_id].description 
    
     
    
    
    Item Price Syntax: 
    $data_items[item_id].price 
    
     
    
    
    Item Common Event ID# Syntax: 
    $data_items[item_id].common_event_id 
    
     
    
    
    Item Common Event Name Syntax: 
    $data_common_events[$data_items[item_id].common_event_id].name 
    
     
    
    
    Item Target (Scope) Syntax: 
    $data_items[item_id].scope 
    
     
    
    List of value and target names:
    
    Value Target Name In Database  
    0 None 
    1 One Enemy  
    2 All Enemies  
    3 One Ally  
    4 All Allies  
    5 One Ally (Dead)  
    6 All Allies (Dead)  
    7 User Of The Item  
     
    
    
    Item Consumable Syntax: 
    $data_items[item_id].consumable 
    


    phần 3


    Mã:
    
    
    
    (6) Variables & Switches 
    
    (6.1) Variables Syntax 
    (6.1.0) Variables Management
    (6.2) Switches Syntax 
    (6.3) Local Switches Syntax 
     
    
    
    
    
    
    
     
    
    (6.1) Variables Syntax : 
    
    
     
    Variable Syntax :  $game_variables[id#] 
     
     
    
    Variable Example :  $game_variables[1]
    $game_variables[2] 
    $game_variables[10] 
     
    
     
     
    
    Replace id# by the actual ID number of the variable you want to manage. I.E: Each variable have a unique ID#, it is the number that is written right before the variable's name in your RPG Maker XP variable operation's variables list. 
     
    (6.1.0) Variables Management :  
    
    
     
    Operator SET (Will modify the value by another one): 
    for numbers: $game_variables[1] = 10 
    for text: $game_variables[1] = "text is in here" 
    
    
    
    
    Operator + (Will do an addition): 
    $game_variables[1] += 10  
    
    
    
    Operator - (Will do a subtraction): 
    $game_variables[1] -= 10  
    
    
    
    Operator / (Will do a division): 
    $game_variables[1] /= 10  
    
    
    
    Operator * (Will do a multiplication): 
    $game_variables[1] *= 10  
    
    
    
    
    Operator MOD (Will do a modulus): 
    $game_variables[1] %= 10  
      
    
    Remember that you can uses other variable in your statement, like this:
    
    Make variable ID#1 = variable ID#2: 
    $game_variables[1] = $game_variables[2] 
     
    
    And that you are free to use standard maths syntax, like this:
    
    
    $game_variables[1] = ($game_variables[2] + 12) * ($game_variables[3] - 2)  
     
     
    
    (6.2) Switches Syntax : 
    
    
     
    Switches Syntax & Example: 
    $game_switches[id#] = flag value 
    $game_switches[1] = true 
    $game_switches[1] = false  
    
    
    
    
     
    Replace id# by the actual ID number of the switch you want to manage. I.E: Each switches have a unique ID#, it is the number that is written right before the switche's name in your RPG Maker XP swicthes operation's switche's list. 
    
    Replace flag value by the word true or false depending on what you want. I.E: To turn a swicth ON, you would write the flag true and to set a switch OFF, you would write the flag false.
     
    
    (6.3) Local Switches Syntax : 
    
    
     
    Local Switches Syntax & Example: 
    $game_self_switches = {[MAP-ID, EVENT-ID, "LOCAL-SWITCH"] => flag value} 
    $game_map.need_refresh = true 
    
    $game_self_switches = {[2, 4, "A"] => true} 
    $game_self_switches = {[1, 3, "B"] => false} 
    $game_map.need_refresh = true  
    
    
    
    
    
    
    
     
    Replace MAP-ID, EVENT-ID, and LOCAL-SWITCH by the relevant data from your game. MAP-ID is the ID of the map where the event you want to modify is, EVENT-ID is the ID of the specific event you want to modify, and LOCAL-SWITCH is the name of the local switch you want to modify; which can be A, B, C or D. 
    
    Replace flag value by the word true or false depending on what you want. I.E: To turn a swicth ON, you would write the flag true and to set a switch OFF, you would write the flag false.
    
    You need to add the line $game_map.need_refresh = true right below your local switch syntax to enable the player to see the changes made to an event on the same map immediately. If you omit to add this line, the local switch will be indeed modified, but you won't see the effect until you exit the map and come back. 
     
    
     
  5. Ice Dragon

    Ice Dragon Mega Man

    Tham gia ngày:
    6/9/04
    Bài viết:
    3,101
    Nơi ở:
    none
    Cám ơn U nhưng nó ở trang này và tui xem rồi,còn cái nào khác ko vậy?
    Sẵn tiện cho hỏi:sau 1 cảnh kia tui thay vũ khí của nhân vật để đánh boss,sau trận đó tui muốn chuyển lại vũ khí mà người chơi đang dùng lúc trước kia tui trang bị món mới thì làm sao?(hic,đã thử dùng đoạn mã:
    #trước khi thay vũ khí
    $game_variables[1] = $data_actors[1].weapon_id

    #thay xong tui dùng

    $data_actors[1].weapon_id = $game_variables[1]

    #KẾt quả là vô ích ^^
     
  6. yugi_vn

    yugi_vn Legend of Zelda

    Tham gia ngày:
    27/4/04
    Bài viết:
    990
    ko biết đúng ko nhưng cứ thử trả lời xem :D
    mình đoán là bạn nhầm giữa
    $data_actors và $game_actors
    data giá trị mặc định còn , game là giá trị tức thời.
    data hình như chỉ có thể read chứ ko thể write đươc

    Do đó theo mình nên sửa bằng cách thay data_actors
    bằng game_actors ^_^

    HIx đang bận thi nên chẳng đụng được vào cái com, lén chạy ra hàng net 1 tí xong rồi vào thi típ :p
     
  7. yugi_vn

    yugi_vn Legend of Zelda

    Tham gia ngày:
    27/4/04
    Bài viết:
    990
    vội chạy về ôn thi post nhầm 2 bài , Amen
    vội chạy về ôn thi post nhầm 2 bài , Amen
    Nam mô
    Tí Quên hình như cái variable ông xài như vậy là sai rồi hay sao á.
    tui chưa hiểu ý bạn lắm , bạn thử sửa lại thế này xem

    #trước khi thay vũ khí
    $game_variables[1] = $data_actors[1].weapon_id

    #thay xong tui dùng

    $game_actors[1].weapon_id = $game_variables[1]
     
  8. khoaiRPG

    khoaiRPG T.E.T.Я.I.S

    Tham gia ngày:
    24/3/05
    Bài viết:
    652
    để tui mò coi, xài script à, để thử common event coi được ko
     
  9. Holy_Healing

    Holy_Healing Youtube Master Race

    Tham gia ngày:
    4/4/05
    Bài viết:
    53
    Pác khoaiRPG giúp em cái vụ làm sao cho biến mất level trong bảng menu được ko ? Thks nhiều !
     
  10. khoaiRPG

    khoaiRPG T.E.T.Я.I.S

    Tham gia ngày:
    24/3/05
    Bài viết:
    652
    nếu ko muốn hiện level trong menu thì
    vào Window_MenuStatus
    kiếm đoạn
    draw_actor_level(actor, x, y + 32)
    và xoá nó đi


    còn đây là cách biến level thành class
    nói chung thế này: vẫn giữ level nhưng ko cho nó hiện ra, set khi đến 1 level nhất

    định thì change class: ví dụ khi level 5 change class mới từ Fighter thành Super

    Fighter chẳng hạn
    trong Window_MenuStatus
    kiếm đoạn
    draw_actor_level(actor, x, y + 32)
    thay thành script dưới đây
    Mã:
    if $game_actors[1].level >= 5
    $game_actors[1].class_id = 7 
    end
    
    muốn có class mới vào database chỉnh nhé, chắc là bạn biết
    Edit: nếu bạn chưa rõ script thì nói thêm tí, game_actors[1] số 1 là id của character. nếu muốn làm tiếp cho mấy level tiếp theo và những character khác thì cứ thêm vào như vậy chỉ cần đổi id và level thui.
     
  11. khoaiRPG

    khoaiRPG T.E.T.Я.I.S

    Tham gia ngày:
    24/3/05
    Bài viết:
    652
    còn script của Ice Dragon thì theo tôi giải quyết thế này nhé
    Mã:
    <>Script: $game_variables[20] = $game_actors[1].weapon_id
    <>Change Equipped Item: [Dragon], Weapon = [Brozen Sword]
    <>Enemy Encounter: Boss
    :   Victory Handler
          <>Script: $game_actors[1].equip(0, $game_variables[20])
          <>
    :    Defeat Handler
          <>Game Over
          <>
    :    End
    
    nghĩa là trước trận đánh có A Sword và A Sword id sẽ được lưu vào variable 20
    vào trận thì đổi thành Brozen Sword, nếu đánh thắng thì equip lại A Sword còn thua thì bi bi, :D :D

    Edit: wên còn cái này nữa: equip(0, $game_variables[20])
    số 0 là equip weapon còn mấy thứ khác là
    0: weapon
    1: Shield
    2: Helmet
    3: Armor
    4: Accessory
    ko nhớ thứ tự phải vậy ko nữa nhưng chắc là đúng đấy test thử xem

    nói túm lại script của bạn sẽ ko thực hiện được
    Mã:
    #trước khi thay vũ khí
    $game_variables[1] = $data_actors[1].weapon_id
    #thay xong tui dùng
    $data_actors[1].weapon_id = $game_variables[1] 
    
    chỉ cần thay 2 dòng đó thành
    Mã:
    #trước khi thay vũ khí
    $game_variables[20] = $game_actors[1].weapon_id
    #thay xong tui dùng
    $game_actors[1].equip(0, $game_variables[20])
    
    have fun!, i test it and it work very well for me.
     
  12. Ice Dragon

    Ice Dragon Mega Man

    Tham gia ngày:
    6/9/04
    Bài viết:
    3,101
    Nơi ở:
    none
    Đúng là mình nhầm thật ^^
    @khoaiRPG:Đọan Script của mình chỉ bị sai như Yugi vn nói ^^,đọan của bác dĩ nhiên dùng được ^^,mà bác có thể cho mình biết Y!M của bác không ?
    À mà còn phải thêm dòng này vào nữa chứ ^^:
    $game_party.lose_weapon($game_variables[1],1)
     
  13. khoaiRPG

    khoaiRPG T.E.T.Я.I.S

    Tham gia ngày:
    24/3/05
    Bài viết:
    652
    yahoo tui là zeroonea.
    quái thật, nếu bạn nói script kia chỉ cần đổi data_actors thành game_actors thì làm được à, tui test trăm lần trăm lần báo lỗi. ngộ thiệt,
    Edit: sorry, edit lại rùi
     
  14. Ice Dragon

    Ice Dragon Mega Man

    Tham gia ngày:
    6/9/04
    Bài viết:
    3,101
    Nơi ở:
    none
    Hic,hồi đó mình có biết mình sai chỗ đó đâu mà nói ^^
    Mà U bảo nó báo lỗi là sao?
     
  15. khoaiRPG

    khoaiRPG T.E.T.Я.I.S

    Tham gia ngày:
    24/3/05
    Bài viết:
    652
    báo lỗi vầy
    [​IMG]
    theo tôi nghĩa, câu lệnh này
    $game_actors[1].weapon_id = $game_varialbes[20]
    ko thể equip weapon lại được
     
  16. Ice Dragon

    Ice Dragon Mega Man

    Tham gia ngày:
    6/9/04
    Bài viết:
    3,101
    Nơi ở:
    none
    Nhưng trên thực tế mình làm được mà ^^,không bao lỗi gì cả.Ông sai rồi nè:
    Mã:
    $game_actors[1].weapon_id = $game_variables[20]
    Chứ không phải
    Mã:
    $game_actors[1].weapon_id = $game_varialbes[20]
     
  17. khoaiRPG

    khoaiRPG T.E.T.Я.I.S

    Tham gia ngày:
    24/3/05
    Bài viết:
    652
    tui thấy có khác gì đâu, ngộ thiệt
     
  18. Ice Dragon

    Ice Dragon Mega Man

    Tham gia ngày:
    6/9/04
    Bài viết:
    3,101
    Nơi ở:
    none
    Ông xem kĩ lại đi
    Mã:
    $game_varia[b][color=green]bles[/color][/b] != $game_varia[b][color=green]lbes[/color][/b]
    
     
  19. khoaiRPG

    khoaiRPG T.E.T.Я.I.S

    Tham gia ngày:
    24/3/05
    Bài viết:
    652
    ừa nhỉ chắc lại sai chính tả :D
     
  20. Kayshika

    Kayshika Mr & Ms Pac-Man

    Tham gia ngày:
    17/4/04
    Bài viết:
    182
    Cho em hỏi, script để cho nhân vật đi chéo có ai có ko? Mà sao script để bóng in dưới nước và thanh ATP em ko xài được, nó cứ báo lỗi ko tìm thấy update cho class scene battle gì đó, các pác giúp em với
     

Chia sẻ trang này