ExtendedScriptFormat

# Course Introduction

Let's find out how to use extended script format and about the mlua file format.

##### Reference Guide

  * [Coproduction](/docs/?postId=670%7B%22target%22:%22_blank%22%7D)
  * [Coproduction Group Member's Level and Permission](/docs/?postId=1077%7B%22target%22:%22_blank%22%7D)
  * [WorldConfig](/docs/?postId=1101%7B%22target%22:%22_blank%22%7D)
  * [LocaWorkspace](/docs/?postId=1165%7B%22target%22:%22_blank%22%7D)



# Extended Script Format Introduction

If you enable Extended Script Format(UseExtendedScriptFormat) from your Local Workspace, an mlua file that pairs with the metadata file will be created. Since the extended script format is plain text, it would be easier for you to find the source of the problem if a collision occurs when merging files.

> Caution! UseExtendedScriptFormat is a preview feature, and it may not be stable. There may be unintended bugs, and the feature may be removed via future updates. It is advised that you create a backup file or a backup World.

# Enabling Extended Script Format

  1. Activate the feature via WorldConfig - LocalWorkspace - UseExtendedScriptFormat. [png](1718965223446aece1d91f1aa4b5289f10318668c8d55)
  2. Check if the Environment folder and mlua file have been created in the LocalWorkspace folder. [png](172717900378801c962c5094344a8b3ae9802c6c9168a)



# Disabling Extended Script Format

Once you activate UseExtendedScriptFormat, you cannot deactivate it. Instead, you'll need to disable Local Workspace. You can disable Local Workspace as follows.

  1. Revert the local file to the version where the problem had not occurred yet.
  2. Select ReimportAll in MapleStory World Maker.
  3. Select File - Sync To Remote Workspace to synchronize the current local files to Remote Workspace.
  4. Open Global - WorldConfig.config in your local folder.
  5. Change "UseExtendedScriptFormat": true to "UseExtendedScriptFormat": false and then save.
  6. Select ReimportAll in MapleStory World Maker again.
  7. Check if UseExtendedScriptFormat had been disabled in the Maker.
  8. Deactivate LocalWorkspace.
  9. Click File - Revisions and then select and revert to the previous version where the problem had not occurred yet. [png](1727179083087cc4b9b000bb54765b8250e4d35617d07)



# Introduction to mlua File

Files in mlua format are defined in a specific way.

> Caution! You should refrain from using features that are not supported in the Maker on mlua files. It may work at the current state, but it may be changed in future updates.

#### Script Entry Definition

Script entries can be inherited from one parent and only among script entries of the same type. Among the script entries, Component, Item, BTNode, State, Logic requires information of the parent. Scripts that can be defined via script entries are as follows.

  * Component
  * Item
  * BTNode
  * State
  * Logic
  * Event
  * Struct


    
    
    @Component
    script TemplateScript_1166_1731 extends Component
        -- [Original MLUA template/example preserved as comment]
        -- @Script Type
        -- ScriptName extends Inheritance
        -- end
    end
    

This is an example of a script entry definition.
    
    
    @Component
    script NewComponent extends Component
    end
    

#### Property Definition

The property definition composition is as follows.
    
    
    @Component
    script TemplateScript_1166_1732 extends Component
        -- [Original MLUA template/example preserved as comment]
        -- PropertyType PropertyName = default value
    end
    

This is an example of a property definition.
    
    
    @Component
    script TemplateScript_1166_1724 extends Component
        -- [Original MLUA template/example preserved as comment]
        -- Property number NewProperty = 5
    end
    

#### Method Definition

The method definition composition is as follows.
    
    
    @Component
    script TemplateScript_1166_1733 extends Component
        -- [Original MLUA template/example preserved as comment]
        -- Method ReturnType MethodName (ParameterType ParameterName)
    end
    

This is an example of a method definition.
    
    
    @Component
    script TemplateScript_1166_1726 extends Component
        -- [Original MLUA template/example preserved as comment]
        -- method void TestMethod(float parameter)
    end
    

#### Event Handler Definition

Event handler requires the EventSender attribute.
    
    
    @Component
    script TemplateScript_1166_1734 extends Component
        -- [Original MLUA template/example preserved as comment]
        -- @EventSender("Self")
        -- Handler HandlerName(EventType event)
    end
    

This is an example of an event handler definition.
    
    
    @Component
    script TemplateScript_1166_1728 extends Component
        -- [Original MLUA template/example preserved as comment]
        -- @EventSender("Self")
        -- handler HandleButtonClickEvent(ButtonClickEvent event)
    end
    

#### Attribute Definition

This can be omitted if the attribute's parameter is not required.
    
    
    @Component
    script TemplateScript_1166_1735 extends Component
        -- [Original MLUA template/example preserved as comment]
        -- @Name()
        -- @Name(Parameter)
    end
    

This is an example of an attribute definition.
    
    
    @Component
    script TemplateScript_1166_1730 extends Component
        -- [Original MLUA template/example preserved as comment]
        -- @EventSender()
        -- @EventSender("Self")
    end