'기본 카테고리' 카테고리의 다른 글
“리더가 설치면 조직은 침묵한다” (0) | 2007.12.30 |
---|---|
2008년도 제45회 변리사시험 시행계획 공고 (0) | 2007.12.30 |
LUA Serious-code.net (0) | 2007.12.06 |
Homunculus AI Script User’s Guide (0) | 2007.12.06 |
스타크래프트 게임 무비 동영상 2/2 (0) | 2007.12.05 |
“리더가 설치면 조직은 침묵한다” (0) | 2007.12.30 |
---|---|
2008년도 제45회 변리사시험 시행계획 공고 (0) | 2007.12.30 |
LUA Serious-code.net (0) | 2007.12.06 |
Homunculus AI Script User’s Guide (0) | 2007.12.06 |
스타크래프트 게임 무비 동영상 2/2 (0) | 2007.12.05 |
Lua | UserPreferences |
serious-code.net | 바뀐글 | 기술자료 | 링크 | 제목색인 | 블로그 |
페이지찾기 : 제목으로 , 본문에서 , 또는 색인을 보세요 그 외에 다음 액션도 있습니다 : AttachFile, DeletePage, LikePages, LocalSiteMap, RenamePage, SpellCheck |
2008년도 제45회 변리사시험 시행계획 공고 (0) | 2007.12.30 |
---|---|
플래쉬 3d 연습 (0) | 2007.12.07 |
Homunculus AI Script User’s Guide (0) | 2007.12.06 |
스타크래프트 게임 무비 동영상 2/2 (0) | 2007.12.05 |
스타크래프트 게임 무비 동영상 1/2 (0) | 2007.12.05 |
Homunculus AI Script User’s Guide
Table of Contents
2- Script Performance Properties
3- Ragnarok Client Built-In Functions
4- Ragnarok Client Built-In Constant Values
We developed the Homunculus AI System to enable RO gamers to customize Homunculus behaviors by creating their own, unique AI files that they can share with the RO community. Homunculus AI scripts are written in the LUA programming language and processed by a program embedded in the RO client. For more information on the LUA language, please visit http://www.lua.org. Homunculus action is controlled by the AI.lua and Util.lua files inside the AI folder in the Ragnarok Client program folder. We plan to add more functions to the Homunculus AI scripts to enhance Homunculus behavior customization. For users who are unfamiliar with scripting or computer programming, we will provide official AI scripts that all players can employ as a reference.
2- Script Performance Properties
Three files located in the AI folder in the Ragnarok Online client program directory (C:\Program Files\Gravity\Ragnarok Online\AI by default) are central to the Homunculus AI script performance: AI.lua, Const.lua and Util.lua.
● AI.lua
AI.lua contains the AI(id) functions that dictate a Homunculus’s action. You can modify your Homunculus’s behavior by editing the contents of this file. The RO client requires a working AI.lua file for Homunculus operation and if the RO client finds any grammatical or logical errors in this file, a message noting the location of the error will be displayed and the program will halt.
● Const.lua
This file contains constant variables used in Homunculus scripting and operation, and it refers to both AI.lua and Util.lua. The RO client doesn’t require this file for Homunculus operation, but const.lua is necessary for enabling Homunculus behaviors of greater complexity.
● Util.lua
This file contains the data structure for the Homunculus AI, which we will call a List, and a few basic computation functions. The RO client doesn’t require this file for Homunculus operation, but Util.lua is necessary to enable the Homunculus AI to queue commands and to store lists of information for Homunculus operation, such as specific enemy monsters or characters.
Each time before a Homunculus spawns, the RO client automatically processes the AI.lua and Util.lua files. If there are any errors in AI.lua or Util.lua files, the RO client will halt and display an error message detailing the location of the error. Otherwise, the RO client will execute the AI(id) functions that are scripted in the AI.lua file, activating the Homunculus AI. A Homunculus spawns when the following situations occur.
1) Creating a Homunculus
2) Reviving a dead Homunculus
3) Starting the game with a character that possesses a Homunculus
4) Using Fly Wing or Butterfly Wing with a character that possesses a Homunculus
5) Using a Warp Portal with a character that possesses a Homunculus
6) Using the Kafra Teleport Service with a character that possesses a Homunculus
3- Ragnarok Client Built-In Functions
The AI(id) functions are already built into the RO client and include fundamental actions such as movement, attacking, eating and skill usage. These functions use id numbers to identify in-game objects such as specific Homunculi, monsters or characters. The following is a reference list of basic functions that Homunculi can perform.
1) MoveToOwner (id)
id: Homunculus ID
Return value: None
Function: Homunculus moves to the spot closest to its owner.
2) Move (id,x,y)
id: Homunculus ID
x: x-axis coordinates on current map
y: y-axis coordinates on current map
Return value: none
Function: Homunculus moves to a specific destination on the current map
3) Attack (id1,id2)
id1: Homunculus ID (Attacker)
id2: Target ID
Return value: none
Function: Commands Homunculus (id1) to attack a target (id2).
4) GetV (V_,id) end
V_...: A constant variable that displays the property of the targeted object
id: Target object
Return value: The constant variable used in this function determines which return value is used. The return value for V_POSITION is x,y coordinates, and the return value for V_HP is an HP value.
Function: Gains id’s property (V_...). Constant value of property is defined in Util.lua file.
Refer to “4- Ragnarok Client Built-In Constant Value” for more details about these properties.
5) GetActors ()
Return value: A set of IDs that are returned in LUA format.
Function: Views the IDs of characters, NPCs, monsters, items and skills within the character’s screen.
6) GetTick ()
Return value: 1/1000 second unit numbers
Function: Displays a timer that starts at 0 and increases by 1 each 1/1000 seconds.
7) GetMsg (id)
id: Homunculus ID
Return value: Direct message from RO client that is returned in LUA format.
Function: Deliver user’s commands input through RO client interface (Homunculus Window) as a message string to the AI script
8) GetResMsg (id)
id: Homunculus ID
Return value: A reserved message string from the RO client that is returned in LUA format.
Function: Delivers user’s reserved message as script language.
10) SkillObject (id, level, skill, target)
id: Homunculus ID
Return value: none
Function: Homunculus performs a skill of a specific level on a target.
11) SkillGround (id, level, skill, x, y)
Function: Homunculus performs a skill of a specific level on the ground. The x,y coordinates input in this function determines where the ground targeting skill will be cast.
13) IsMonster (id)
id: An in-game object
Return value: The id will have a return value of 1 if the object is a monster; all other objects have a return value of 0.
Function: Recognizes monsters.
14) TraceAI (string)
string: String that is recorded in the TraceAI.txt file.
Function: Records the status of the script as it is processed and analyzed.
4- Ragnarok Client Built-In Constant Values
The following is a list of the built-in constant variables defined in the Const.lua file.
4-1. Constant Values used for GetV function
V_OWNER = 0 -- Returns the Homunculus owner’s ID
V_POSITION = 1 -- Returns the current location’s x,y coordinates
V_TYPE = 2 -- Defines an object (Not implemented yet)
V_MOTION = 3 -- Returns the current action
V_ATTACKRANGE = 4 -- Returns the attack range (Not implemented yet; temporarily set as 1 cell)
V_TARGET = 5 -- Returns the target of an attack or skill
V_SKILLATTACKRANGE = 6 -- Returns the skill attack range (Not implemented yet)
V_HOMUNTYPE = 7 -- Returns the type of Homunculus
V_HP = 8 -- Current HP amount of a Homunculus or its owner
V_SP = 9 -- Current SP amount of a Homunculus or its owner
V_MAXHP = 10 -- The maximum HP of a Homunculus or its owner
V_MAXSP = 11 -- The maximum SP of a Homunculus or its owner
4-2. Return values for GetV (V_MOTION, id)
MOTION_STAND = 0 : Standing
MOTION_MOVE = 1 : Movement
MOTION_ATTACK = 2 : Attack
MOTION_DEAD = 3 : Dead
MOTION_ATTACK2 = 9 : Attack
4-3. Return values for GetV (V_HOMUNTYPE, id)
LIF = 1 : Lif
AMISTR = 2 : Amistr
FILIR = 3 : Filir
VANILMIRTH = 4 : Vanilmirth
LIF_H = 5 : Advanced Lif
AMISTR_H = 6 : Advanced Amistr
FILIR_H = 7 : Advanced Filir
VANILMIRTH_H = 8 : Advanced Vanilmirth
4-4. Return values of GetMsg (id), GetResMsg (id), i.e. Homunculus commands performed through RO client interface
NOME_CMD = 0 -- No Command
{Command Number}
MOVE_CMD = 1 -- Move
{Command Number, x coordinate, y coordinate}
STOP_CMD = 2 -- Stop
{Command Number}
ATTACT_OBJET_CMD = 3 -- Attack
{Command Number, Target ID}
ATTACK_AREA_CMD = 4 -- Area Attack
{Command Number, x coordinate, y coordinate}
PATROL_CMD = 5 -- Patrol
{Command Number, x coordinate, y coordinate}
HOLD_CMD = 6 -- Mark
{Command Number}
SKILL_OBJECT_CMD = 7 -- Use Skill
{Command Number, Selected Level, Type, Target ID}
SKILL_AREA_CMD = 8 -- Use Area Attack Skill
{Command Number, Selected Level, Type, x coordinate, y coordinate}
FOLLOW_CMD = 9 -- Follow Its Owner
{Command Number}
5- Basic Script
5-1. The Essentials of AI Scripting
Homunculus AI scripts can written using text format files through a text editor such as Notepad. The script’s file name extension must be “.lua” for it to be recognized as a LUA format file. Before experimenting with Homunculus AI or implementing a new AI script, you should save a copy of the official AI script in another folder for backup purposes. But first we need to understand Homunculus states and actions before we can begin scripting actual Homunculus functions.
5-2.
The Homunculus AI System is based on the Finite State Machine a.k.a. FSM theory, a model of behavior defined by states, transitions between states, and actions. For the purposes of Homunculus AI, we will be using four very basic states.
IDLE
In the IDLE state, the Homunculus will rest; and does not perform any actions.
This state may be desirable when there are no monsters around and the owner is doing nothing, giving the Homunculus an opportunity to rest.
When a Homunculus spawns, it is initially in the IDLE state.
CHASE
In the CHASE state, the Homunculus will follow the targeted object.
This state may be desirable when an enemy attacks the Homunculus or its owner so that the Homunculus can approach its target close enough to ATTACK it.
When encountering monsters that are too powerful for the Homunculus within a specific distance, users can deactivate the CHASE stat in order to evade these monsters.
ATTACK
In the ATTACK state, the Homunculus will continuously perform the action of attacking the targeted object.
This state may be desirable when an object causes damage to the Homunculus’s owner or if any monsters are in the Homunculus’s vicinity.
FOLLOW
In the FOLLOW state, the Homunculus will travel towards its owner.
This state may be desirable when a Homunculus defeats an enemy or when an enemy is too far away from the owner.
If we want the Homunculus to stay a certain distance away from the owner, we change to the IDLE state at a certain distance.
When creating a Homunculus AI script, consider which battle situations you and your Homunculus are likely to encounter and which actions the Homunculus should take in response to battle outcomes and other situational changes. This diagram illustrates the scripted behavior of a Homunculus, how it accordingly transitions between different states in different situations.
IDLE CHASE ATTACK FOLLOW 1. Enemy is no longer in sight. 2. Enemy is defeated. 3. Enemy is out of range. Close to its owner 3. Enemy is out of range. 1. Owner is being attacked 2. Homunculus is being attacked. 1. Enemy is defeated. 2. Enemy is no longer in sight. Homunculus is too far away from its owner. 4. Enemy’s location changes 4. Rest for another battle
5-3 Util.lua
Before creating the actual AI script, let’s create a “Util.lua” file that will contain additional functions for the Homunculus. If you wish to create your own “Util.lua” from scratch, simply create a text file, rename it as “Util.lua,” and then add the following text.
require “./AI/Const.lua” --Placing this line at the very top of the file makes this file refer to the Const.lua file.
A data structure in which data is saved in a certain order is useful in scripting. For the purposes of Homunculus AI, we will be using a data structure, classified as a List, in order to store queued commands to the Homunculus, targets, and other information that may be useful in Homunculus operation.
(Refer Util.lua)
List.new () -- Returns a new list
List.pushleft (list, value) -- Adds a component to the left side of list
List.pushright (list, value) -- Adds a component to the right side of list
List.popleft (list) -- Summons the first value at the left side of list
List.popright (list) -- Summons the first value at the right side of list
List.clear (list) -- Empties the current list
List.size (list) -- The total numbers of components saved in the list
The following is a list of computation functions that are frequently used.
GetDistance (x1,y1,x2,y2) -- Cell distance between two coordinates (Positive number value)
GetDistance2 (id1, id2) -- Cell distance between two objects (Positive number value)
GetOwnerPosition (id) -- Owner’s location
GetDistanceFromOwner (id) -- Distance from the owner
IsOutOfSight (id1,id2) -- If id1 and id2 are within visual range, this function will return the “true” value; otherwise, it will return the “false” value.
IsInAttackSight (id1,id2) -- If id2 is within id1’s attack range, this function return the “true” value; otherwise, it will return the “false” value.
5-4 AI.lua Tutorial
Now, let’s create a new AI.lua. Create a new text file and rename it to “AI.lua.” Open this new AI.lua file using Notepad and enter the following text at the very top of the file.
require “./AI/Const.lua”
require “./AI/Util.lua”
This will enable the AI.lua file to refer to the Const.lua and Util.lua files located in the AI directory. Without this script, the Homunculus AI cannot access the functions and computations in the Const.lua and Util.lua files. Afterwards, add the most essential function required in the “AI.lua.”
function AI (myid)
end
This simple script is the minimum requirement for the Homunculus AI to execute without any errors. However, no behaviors have yet been coded and therefore, your Homunculus is only capable of standing still. For the Homunculus to exhibit actual behaviors, we will need to define the Homunculus states that we have planned earlier: IDLE, FOLLOW, CHASE, and ATTACK.
IDLE_ST = 0 --- Idle
FOLLOW_ST = 1 --- Follow
CHASE_ST = 2 --- Chase
ATTACK_ST = 3 --- Attack
You will need to include a variable for remembering the Homunculus’s current state into your AI script.
You must also know your Homunculus’s id, enemy’s id and the destination coordinates for issued commands.
------------------------------------------
-- Global variables
------------------------------------------
MyState = IDLE_ST -- Initial state
MyEnemy = 0 -- Enemy’s ID
MyDestX = 0 -- x coordinate of a destination
MyDestY = 0 -- y coordinate of a destination
MyPatrolX = 0 -- x coordinate of a scouting location
MyPatrolY = 0 -- y coordinate of a scouting location
ResCmdList = List.new() -- List of queued commands
MyID = 0 -- Homunculus ID
MySkill = 0 -- Homunculus skills
MySkillLevel = 0 -- Homunculus skill level
------------------------------------------
function AI (myid)
MyID = myid
end
The OnIDLE_ST() function defines the Homunculus’s behaviors when it enters the IDLE status.
In the following script, the Homunculus will check if any monsters are attacking the owner. The Homunculus defines a monster that targets its owner for an attack as the owner’s enemy. It will then define the owner’s enemy as its own enemy, transition to the CHASE state and chase the monster until is further than 3 cells away from its owner. After reaching a distance of three cells, the Homunculus will transition to the FOLLOW state and return to its owner’s location.
function OnIDLE_ST ()
local object = GetOwnerEnemy (MyID) -- Defines the owner’s enemies as “object.”
if (object ~= 0) then -- If any of the owner’s enemies are present
MyState = CHASE_ST -- Homunculus transitions to CHASE state
MyEnemy = object -- Remember the enemy’s ID; Owner’s enemy is now Homunculus’s enemy
return -- Finish the function
end
object = GetMyEnemy (MyID) -- Defines the Homunculus’s enemies as “object.”
if (object ~= 0) then -- If any enemies are present
MyState = CHASE_ST -- Homunculus transitions to CHASE state
MyEnemy = object -- Remembers the enemy’s ID
return
end
local distance = GetDistanceFromOwner(MyID) -- Masks distance between Homunculus and owner as a variable named “distance”
if ( distance > 3 or distance == -1) then -- When the Homunculus is further than 3 cells away from its owner, or out of the owner’s sight
MyState = FOLLOW_ST -- Homunculus transitions to FOLLOW state
return;
end
end
function AI (myid)
MyID = myid
if (MyState == IDLE_ST) then
OnIDLE_ST ()
end
end
In this sample script, the Homunculus will remember human characters that attack its owner and define them as its own enemies.
function GetOwnerEnemy (myid) -- Find the owner’s enemy.
local result = 0
local owner = GetV (V_OWNER,myid) -- The owner
local actors = GetActors () -- Objects within the owner’s sight
local enemys = {} --A table that records the owner’s
enemies
local index = 1
local target
for i,v in ipairs(actors) do -- Patrol around every object within
the owner’s sight.
if (v ~= owner and v ~= myid) then -- Target of an object
target = GetV (V_TARGET,v)
if (target == owner) then -- If the target is the owner
if (IsMonster(v) == 1) then -- and if the object is a monster
enemys[index] = v -- add it on the owner’s enemy list
index = index+1
else -- If the object is not a monster,
local motion = GetV(V_MOTION,i) -- check the current action of the
object
if (motion == MOTION_ATTACK or motion == MOTION_ATTACK2) then
– If the action is attack
enemys[index] = v -- add the object on the owner’s
enemy
index = index+1
end
end
end
end
end
local min_dis = 100 -- Define the initial distance as 100
local dis
for i,v in ipairs(enemys) do -- Patrol around every enemy
of the owner
dis = GetDistance2 (myid,v) -- Distance between the owner and
an enemy
if (dis < min_dis) then -- If the distance is closer than the
initial distance (100 cells)
result = v -- Define the final enemy
min_dis = dis -- Define the minimum distance
end
end
return result -- Return the result
If the result value is 0, none of the owner’s enemies are present. Otherwise, the owner is being attacked.
end
A Homunculus can define specific monsters or characters as enemies, record them into a list, and then determine if they are present. Users can then script the AI so that a Homunculus can take action on a predefined enemy before the enemy attacks. The previous scripts are suitable for a passive Homunculus that will only battle after it is attacked. For an aggressive Homunculus AI, you can create a script in which your Homunculus will define monsters as enemies so long as they are on the screen.
function GetMyEnemy (myid) -- Check for Homunculus’s enemies
local result = 0
local type = GetV (V_HOMUNTYPE,myid) -- Type of Homunculus used in this script
if (type == LIF or type == LIF_H or type == AMSTR or type == AMSTR_H) then
result = GetMyEnemyA (myid) -- Function for finding non-aggressive enemies
elseif (type == FILIR or type == FILIR_H or type == VANILMIRTH or type == VANILMIRTH_H) then
result = GetMyEnemyB (myid) -- Function for finding aggressive enemies
end
return result
end
-------------------------------------------
-- non-aggressive GetMyEnemy
-------------------------------------------
function GetMyEnemyA (myid)
local result = 0
local owner = GetV (V_OWNER,myid)
local actors = GetActors ()
local enemys = {}
local index = 1
local target
for i,v in ipairs(actors) do
if (v ~= owner and v ~= myid) then
target = GetV (V_TARGET,v)
if (target == myid) then
enemys[index] = v -- Define objects attacking Homunculus as its enemies
index = index+1
end
end
end
local min_dis = 100
local dis
for i,v in ipairs(enemys) do
dis = GetDistance2 (myid,v)
if (dis < min_dis) then
result = v
min_dis = dis
end
end
return result
end
-------------------------------------------
-- Aggressive GetMyEnemy
-------------------------------------------
function GetMyEnemyB (myid)
local result = 0
local owner = GetV (V_OWNER,myid)
local actors = GetActors ()
local enemys = {}
local index = 1
local type
for i,v in ipairs(actors) do
if (v ~= owner and v ~= myid) then
if (1 == IsMonster(v)) then
enemys[index] = v -- Define every monster around Homunculus as its enemy
index = index+1
end
end
end
local min_dis = 100
local dis
for i,v in ipairs(enemys) do
dis = GetDistance2 (myid,v)
if (dis < min_dis) then
result = v
min_dis = dis
end
end
return result
end
A Homunculus’s owner directly issues commands to the Homunculus, via the Mouse or Shortcut keys or RO client interface, that are sent to the Homunculi AI script as message strings. The following lines must be added under the AI(myid) function in the AI.lua file for the Homunculi AI to receive and interpret message strings from the RO client so that the Homunculus can perform direct commands from its owner.
MyID = myid
local msg = GetMsg (myid) -- Receive messages
local rmsg = GetResMsg (myid) -- Receive reserved message, i.e. queued command
ProcessCommand (msg) -- Perform user’s commands
-- Save reserved message
if msg[1] == NONE_CMD then
if rmsg[1] ~= NONE_CMD then
if List.size(ResCmdList) < 10 then -- Set maximum number of messages that can be saved
List.pushright (ResCmdList,rmsg)
end
end
else
List.clear (ResCmdList) -- Cancel previous reserved commands each time a new command is received
end
Note that the ProcessCommand (msg) function handles message strings such as OnMOVE_CMD (msg[2],msg[3]). The command status functions in this script, such as OnMOVE_CMD_ST (), are necessary for the Homunculus AI to confirm whether the Homunculus has completed performing a direct command.
5-5. Grammatical Error Check and Writing TraceAI.txt
Sometimes, a complete script file may contain grammatical errors that will cause the RO client to display an error message while processing the script. However, you can check an AI script for errors before running the RO client by using the lua.exe program included with the latest version of the iRO client program. Double-click the lua.exe file in the RO client folder and enter the following line into the command prompt:
dofile ‘./AI/AI.lua’
The lua.exe file will process the AI.lua file and display a message detailing an error if one is present. If the script does not contain any technical errors, no message will be displayed. Even if you have checked the AI.lua script beforehand, you may occasionally receive an error from the RO client if you begin the game with a character that possesses a Homunculus. In this case, simply open the AI script and correct the error prior to restarting the RO client. Keep in mind that a technically perfect AI script may contain logical errors resulting in different Homunculus behavior than was intended.
In correcting logical errors in the Homunculus AI, you will need to note the Homunculus’s state transitions and analyze its behavior. For example, when an enemy is in the vicinity, you may want your Homunculus to CHASE it and then attack it. If the Homunculus is chasing the enemy but is not attacking it as intended, this would be considered a logical error in the script. The following is an example script that illustrates this Homunculus behavior.
function OnCHASE_ST ()
TraceAI ("OnCHASE_ST")
if (true == IsOutOfSight(MyID,MyEnemy)) then -- ENEMY_OUTSIGHT_IN
MyState = IDLE_ST
MyEnemy = 0
MyDestX, MyDestY = 0,0
TraceAI ("CHASE_ST -> IDLE_ST : ENEMY_OUTSIGHT_IN")
return
end
if (true == IsInAttackSight(MyID,MyEnemy)) then -- ENEMY_INATTACKSIGHT_IN
MyState = ATTACK_ST
TraceAI ("CHASE_ST -> ATTACK_ST : ENEMY_INATTACKSIGHT_IN")
return
end
local x, y = GetV (V_POSITION,MyEnemy)
if (MyDestX ~= x or MyDestY ~= y) then -- DESTCHANGED_IN
MyDestX, MyDestY = GetV (V_POSITION,MyEnemy);
Move (MyID,MyDestX,MyDestY)
TraceAI ("CHASE_ST -> CHASE_ST : DESTCHANGED_IN")
return
end
TraceAI (string.format(“OnChase_ST end MyEnemy: %d, EnemyX : %d, EnemyY:%d, MyDestX:%d, MyDestY:%d\n”,MyEnemy,x,y,MyDestX,MyDestY))
end
You can monitor the correlation between Homunculus response and the AI script by creating a log in the TraceAI.tx file. Execute the RO client and enter “/traceai” into the Chat Window to begin recording Homunculus functions into the TraceAI.txt file in the RO folder. To stop recording, simply entering the /traceai command into the Chat Window again. If you want to record variables, make sure to include the string “string.format” as illustrated in the sample script above.
LUA site : http://www.lua.org
2005.09.27
1) New Homunculus types have been added. Homunculus type definitions in the Const.lua file and the GetMyEnemy function in the AI.lua file have been updated. You must edit the Const.lua and AI.lua files to customize your Homunculus AI.
2005-07-19
1) You can now queue movement or attack commands while the Homunculus is performing another action.
Right-click on a cell while pressing the Shift and Alt keys to queue a movement destination.
Right-click on a target while pressing the Shift and Alt keys to queue attacks.
In this sample script, the Homunculus will check for queued commands and then perform them if it is not carrying out any commands. Recently queued commands will be added to the very last line in the Reserve Command List (ResCmdList).
function AI (myid)
…
if msg[1] == NONE_CMD then
if rmsg[1] ~= NONE_CMD then
if List.size(ResCmdList) < 10 then
List.pushright (ResCmdList,rmsg) – Save reserved commands
end
end
else
List.clear (ResCmdList) -- Delete previous reserved commands when a new command is entered.
ProcessCommand (msg) -- Perform a command.
end
…
This sample script enables your Homunculus to perform queued commands when it is in the IDLE state. Specifically, it checks the ResCmdList for any queued commands that have been recorded and will try to perform them upon entering the IDLE state.
function OnIDLE_ST ()
TraceAI ("OnIDLE_ST")
local cmd = List.popleft(ResCmdList)
if (cmd ~= nil) then
ProcessCommand (cmd) -- Perform a reserved command
return
end
…
The following script is useful if you command the Homunculus to move to a destination that is too far away for the server to process. The Homunculus will move to a midpoint that between the destination at the first line of the reserved command list and the Homunculus’s current location.
function OnMOVE_CMD (x,y)
…
local curX, curY = GetV (V_POSITION,MyID)
if (math.abs(x-curX)+math.abs(y-curY) > 15) then -- If a destination is further than a specific distance, in this case, a distance that is too long for the server to process
List.pushleft (ResCmdList,{MOVE_CMD,x,y}) -- Coordinates of the original destination are saved in the first line of ResCmdList.
x = math.floor((x+curX)/2) -- New location is calculated as a midpoint between original destination and current location.
y = math.floor((y+curY)/2) --
end
…
end
2) Incorrect command number NOME_CMD in Const.lua file has been corrected as NONE_CMD.
3) User AI folder added
Shortcut key and Chat Window commands that enable users to switch between basic AI and custom AI added
Command to toggle between basic and custom AI: /hoai
Custom AI in User AI folder will not be affected by any changes made in basic AI.
The AI(myid) function must be defined in the AI.lua file in the User AI folder to activate a custom AI script
If you wish to use someone else’s AI script, copy that script into the USER_AI folder inside the existing AI folder.
4) Pressing the Alt+T keys or clicking the [Standby] button in the Homunculus information window during the Standby status, FOLLOW_CMD_ST, will change the Homunculus’s state to IDLE (IDLE_ST). For this update, the OnFOLLOW_CMD used in the AI.lua file has been modified.
플래쉬 3d 연습 (0) | 2007.12.07 |
---|---|
LUA Serious-code.net (0) | 2007.12.06 |
스타크래프트 게임 무비 동영상 2/2 (0) | 2007.12.05 |
스타크래프트 게임 무비 동영상 1/2 (0) | 2007.12.05 |
어처구니가 없네! 쩝.. (0) | 2007.11.19 |
스타크래프트 게임 무비 동영상 2/2
더 게임 스타크래프트 (the starcraft) 게임 삽입 Movie
LUA Serious-code.net (0) | 2007.12.06 |
---|---|
Homunculus AI Script User’s Guide (0) | 2007.12.06 |
스타크래프트 게임 무비 동영상 1/2 (0) | 2007.12.05 |
어처구니가 없네! 쩝.. (0) | 2007.11.19 |
기술지도사 준비???? (0) | 2007.11.17 |
스타크래프트 게임 무비 동영상 1/2
더 게임 스타크래프트 (the starcraft) 게임 삽입 무비입니다.
Homunculus AI Script User’s Guide (0) | 2007.12.06 |
---|---|
스타크래프트 게임 무비 동영상 2/2 (0) | 2007.12.05 |
어처구니가 없네! 쩝.. (0) | 2007.11.19 |
기술지도사 준비???? (0) | 2007.11.17 |
추억의 Z건담???? (0) | 2007.11.10 |
어처구니가 없네! 쩝..
스타크래프트 게임 무비 동영상 2/2 (0) | 2007.12.05 |
---|---|
스타크래프트 게임 무비 동영상 1/2 (0) | 2007.12.05 |
기술지도사 준비???? (0) | 2007.11.17 |
추억의 Z건담???? (0) | 2007.11.10 |
글씨교정 (0) | 2007.11.09 |
기술지도사 준비????
스타크래프트 게임 무비 동영상 1/2 (0) | 2007.12.05 |
---|---|
어처구니가 없네! 쩝.. (0) | 2007.11.19 |
추억의 Z건담???? (0) | 2007.11.10 |
글씨교정 (0) | 2007.11.09 |
바르고 예쁜글씨를 위한 악필교정과 글씨체 (0) | 2007.11.09 |
추억의 Z건담????
어처구니가 없네! 쩝.. (0) | 2007.11.19 |
---|---|
기술지도사 준비???? (0) | 2007.11.17 |
글씨교정 (0) | 2007.11.09 |
바르고 예쁜글씨를 위한 악필교정과 글씨체 (0) | 2007.11.09 |
악필교정과 바르고 예쁜 글씨를 위한 자세와 필기구 (0) | 2007.11.09 |
1. 글씨를 쓰실때 손에 힘을 빼세요
어린이들이 꾹꾹 글씨를 눌러쓰면서 연필을 많이 부러뜨리죠?
아직 자세가 바르지 못하고 서툴기 때문에 힘이 많이 들어가는 거랍니다.
바른자세로 앉아 어깨와 손목에 힘을 빼서 써보세요
2. 집필법(펜을 잡는방법) 이 굉장히 중요합니다.
문방구에가면 연필에끼는 교정기가 있어요. 몇백원안하니 구해서 연습하세요.
처음엔 매우 불편해도 크게 도움이 된답니다.
또한 대부분 집필법이 틀리는 사람들은 젖가락도 제대로 못쥐는 경우가 많습니다.
혹시 젓가락질이 서투르신지요? 그렇다면 평소 식사하실때 바르게 쥐도록 노력하세요
4. 신문지교정법
신문지 글씨를 똑같이 따라쓰세요
글씨를 쓸 때 한 자 한 자를 정성드려 쓰면 어느정도 괜찮아 보이는데 길게 이어서 썼을 때 글씨가 예쁘게 잘 안되는분이 많이 있습니다
신문지 교정법은 글씨를 길게 이어서 썼을 때 보기가 흉한 글씨를 예쁘게 잡아주는 것인데, 이를 신문지에 낙서 하듯이 편하게 자주 연습하시면 길게 이어서 쓴 글씨가 바르고 예쁘게 변하게 됩니다
이 방법은 글씨를 잘 못써도 길게 이어쓴 글씨의 크기가 모두 같아지기 때문에 보기가 좋은데 한 자 한 자를 잘 쓰면서 이어서 쓴 글씨도 크기가 고르면 더욱 아름답게 보입니다
대부분의 글씨를 배우시는 분들이 글씨 한 자씩 잘 쓰는 것만 중요시 하는데 아무리 한 자씩 잘 써도 이어서 쓴 글씨의 크기가 고르지 않으면 글씨가 흉하게 나옵니다
5. 필기구사용
수성펜,중성펜 종류가 좋으며 굵기는 0.5mm이하가 좋습니다
6. 처음모음부분을 너무 크게 시작하지 마세요
예를 들면 "한"에서 ㅎ 을 크게 쓰고 ㅏ를 작게 쓰고 ㄴ 도 작게 쓰거나 크게 쓰시면 글자가 미워보여요
7. 받힘을 이쁘게 쓰는 노하우
예를들어 '싱' 이라는 글자를 쓸 경우에
자음'ㅅ'의 중앙부분과 내려긋는'ㅣ' 사이에 꼭맞게 'ㅇ'을 쓰면 글자가 이뻐보입니다.
※ 가장 중요한건 글씨를 쓰는 자세와 집필법 이랍니다.
항상 바르고 곧은 자세로 쓰도록 노력하세요 ^^
기술지도사 준비???? (0) | 2007.11.17 |
---|---|
추억의 Z건담???? (0) | 2007.11.10 |
바르고 예쁜글씨를 위한 악필교정과 글씨체 (0) | 2007.11.09 |
악필교정과 바르고 예쁜 글씨를 위한 자세와 필기구 (0) | 2007.11.09 |
악필교정을 위한 백강 고시 글씨체 (0) | 2007.11.09 |
바르고 예쁜글씨를 위한 악필교정과 글씨체
145
13
집필자 nkh0226 (2007-05-17 00:17)
조회32,212
신고|
내려 긋는 선이 삐뚤삐뚤하고 내려 긋는 선을 그을 때 처음 시작은
글씨에 힘이 없다. 강하게 시작해서 아래로 내려오면서
힘을 점점 빼면서 끝부분에는 가볍게
들어올려야 한다.
받침을 크게 써서 위,아래의 위,아래로 자음이 있을 때는 같은
크기가 맞지않아 부자연스럽고크기로 써야 안정감 있고 센스있는
둔해 보인다.예쁜 글씨가 된다.
밑의 "ㄴ"을 길게 써서 벗어난 밑의 "ㄴ"을 위의 "ㄴ"과 위치와
느낌과 흘려쓴 느낌이 든다.
크기를 맞추어 쓰니 단정한
옷을 입은 기분이 든다.
글씨 한자 한자를 아무리 잘 써도 크기가 고르지 못하고
위, 아래 선이 고르지 못하면 보기 흉한 글씨가 되어
지저분하게 보인다.
글자 한자 한자를 잘못써도 크기가 고르고 위, 아래 간격이
고르면 보기가 좋아 잘 쓴 글씨로 보여진다.
추억의 Z건담???? (0) | 2007.11.10 |
---|---|
글씨교정 (0) | 2007.11.09 |
악필교정과 바르고 예쁜 글씨를 위한 자세와 필기구 (0) | 2007.11.09 |
악필교정을 위한 백강 고시 글씨체 (0) | 2007.11.09 |
동영상 강좌 URL (0) | 2007.10.15 |
바르고 예쁜 글씨를 쓰기 위한 가장 기본은 자세이다.
우선 허리를곧게 펴고, 어깨는 편안하게 힘을뺀 상태에서 몇 초간 눈을 감고 마음을
다스려 보자. 혹은 크게 숨을 한번 내쉬어 나를 컨트롤해 보는 것도 괜찮을 것 같다.
어느 정도 마음이 추스려졌다면, 배가 책상에 닿지 않도록 앉은 후, 상체는 앞으로 약간
숙여 눈이 지면에서 30cm 정도 떨어지게 하고 왼손은 종이를 가볍게 눌러 몸이 삐뚤어
지지 않게 바른 자세를 유지한다.
바르고 예쁜 글씨를 쓰려면 필기구 잡는 법을 의식적으로 바꾸어라.
필기구를 제대로 잡아야 손놀림이 자유롭고 글씨체가 부드러워진다.
필기구를 잘못 잡으면 손,팔,어깨에 힘을 주게 되어 손가락과 팔이 아프고 어깨와 목이
뭉쳐 내가 의도한 글씨체가 나오지 않을 뿐만 아니라 정성과 노력에 비해 그 결과물은
내 기대에 미치지 못하니 능률도 오르지 않고 더더욱 글씨쓰기를 회피하게 되는 결과를
가져온다.
나도 초등1학년 때, 그 때 당시는 체계적인 글씨교본이 없었기 때문에 담임선생님
참고서를 보고 계속 연습하고 평가 받고 다시 써 보기를 반복했었는데, 잘 써야지하는
편지 않은 마음과 노하우가 없어서 글씨에 힘이 많이 들어가 지금은 그 흔적으로 중지
손가락이 밉게 변했다.
그래서 경험 덕분에 더 큰 노하우로 이렇게 자신있게 전문 블로그를 만들 수 있지
않을까?
손모양은 필기구 맨 아래에서 2.5cm - 3cm 정도 위치에 엄지,검지를 필기구 위쪽으로
가볍게 잡고 중지 옆 부분에 살짝 옮겨 놓은 듯 잡으면 된다.
글씨연습에 가장 좋은 필기구는 연필이다.
종이와 연필과의 마찰에 의해 수직선을 긋는데 다소 까칠한 그 느낌, 그 느낌을 살리면
힘의 강약 조절이 가능하고, 아울러 그 감각을 미세하게 손이 기억한다.
샤프나 기타 다른 필기구는 내가 손의 강약을 조절하기도 전에 이미 나의 의도와는
다르게 글씨가 앞서 나가 있고 수월하게 쓰여지는 반면 나만의 글씨체를 갖기는
힘들다.
기본에 충실히, 꾸준히 연습하다 보면 글씨를 써야할 때가 왔을 때 더욱 당당한 나
자신이 되지 않을까? 미소를 머금으면서
글씨교정 (0) | 2007.11.09 |
---|---|
바르고 예쁜글씨를 위한 악필교정과 글씨체 (0) | 2007.11.09 |
악필교정을 위한 백강 고시 글씨체 (0) | 2007.11.09 |
동영상 강좌 URL (0) | 2007.10.15 |
LUA Tutorial (0) | 2007.10.10 |
바르고 예쁜글씨를 위한 악필교정과 글씨체 (0) | 2007.11.09 |
---|---|
악필교정과 바르고 예쁜 글씨를 위한 자세와 필기구 (0) | 2007.11.09 |
동영상 강좌 URL (0) | 2007.10.15 |
LUA Tutorial (0) | 2007.10.10 |
LUA 자료.. (0) | 2007.10.10 |