It is interesting to edit the trigger of Warcraft 3.

Source: Internet
Author: User

Recently, I have been playing Warcraft 3C and interested in the Warcraft 3 editor! It is found that the "trigger editing" is very interesting. You can use various triggers for map editing to implement many functions. Presumably, many of the RPG and other tasks in Warcraft use this function. Now I want to apply this mode to MMORPG. Find a Chinese editor and paste it below.
---------------------------------------------

Trigger Editor

The trigger editor is the most advanced and powerful part of the map editor. In the trigger controller, you can control all the effects of the game. This is a simple language that is easy to understand. However, it is powerful enough to be used by advanced users. It can be opened by using "F4" on the keyboard or selecting the trigger editor in the module menu.

A trigger consists of three parts: events, conditions, and actions. The action of a trigger is executed after the event is triggered and the conditions are met.

Event

An event is the fuse for starting to process the trigger. When a trigger event meets the conditions, an action is triggered. The default trigger in a map is "map loading ". The default condition for this trigger is "map loading", that is, this event will occur when the map is loaded. If no conditions are met, the corresponding action is generated. If you want to add a condition, you can add the condition "time -- time passed" and set it to 10 seconds. The action takes 10 seconds after the "map read" operation.

Condition

A condition is a condition that the trigger must perform an action. Action can be generated only when this condition is true. However, setting the condition "false equal to false" in this way will not produce any effect, because it will always be true. The default trigger "map loading" has no conditions. Let's add one. Press Ctrl + D and select "Game speed comparison". A dialog box with blue text is displayed. "(Current game speed) equal to normal." If this condition is maintained, the "map loading" trigger will work normally. However, if you change "normal" in the condition to "fastest ". This trigger cannot be triggered in the map editor because the editor sets the map speed to normal and the condition is changed to "normal speed equal to fastest speed". This condition is not true.

In some triggers, the conditions may not be met after an event occurs. This trigger can be set to multiple events and can be triggered only when an event occurs.

What a trigger really needs is action (in fact, this is not accurate. That is to say, there is no action, and this trigger will have no impact on the game ). That is to say, a trigger can run without events and conditions. This can be achieved by setting the action "trigger-run (ignoring conditions. The trigger is executed without conditions or events.

Action

Action is the result of a trigger. This can be used to enable mobile cameras, play movies, or attack another unit. Action allows you to be designed to fully control everything in the game.

Create a trigger

Click "F4" or select the trigger editor item in the module menu to open the trigger editor.

Before creating a trigger, you must select the type where the trigger is placed. Create a category by selecting create category in the menu. Then you can see the category you just created in the list on the left. A category has an icon. You can select a category name when creating a category, or click "F2" to change the name.

Select the category you just created and select a trigger in the new menu to create a trigger. Select the trigger you just created, and you will find two check boxes on the right of the trigger:

 

Allow-If this check box is not selected, this trigger will not work.
Original open-If this check box is not selected, the trigger is disabled at the beginning. Only the trigger-turn on action can be enabled.

There are several options on the right side of the trigger.

Annotation-In this text area, you can enter the comments initiated in the relevant area. This information will not affect the trigger function, but will be used to remind you of the trigger function and other information.
Trigger Function-The content of your trigger is displayed here. You can see the trigger events, conditions, and actions. You can also add trigger events, conditions, and actions here.

You can copy and paste trigger events, conditions, and actions between triggers, or even between maps. You can double-click the events, conditions, and actions you have set to edit them.

There are also some common elements about triggers: variables, functions, and pre-devices.

 

Variable

You can press Ctrl + B or select a variable from the menu in the trigger editor to open the variable section. The variables here are similar to those in basic or C. Variables are some of the space that editors use to store data. However, the variables here can only be used to store one type of data. You cannot put integers in such variables.

Let a trigger reference the unit you pre-placed on the map. That is, you want a certain unit to execute the action. Start the action you want to perform. Click the changed part in the action text. That is, text in red or blue strip. Click the select unit button and select the unit you placed on the map. The name of the unit you selected is displayed in the Variable list.

Try it like this: open a blank map and place it as an animal. Open the trigger editor. Use Ctrl + G to create a new category, use Ctrl + T to create a new trigger, and use Ctrl + R to create a new action. Click "U" to select the action "unit-kill ". The trigger syntax text displays "unit-kill (triggering unit )". Click triggering unit to select a unit (on the left of the variable editing button ). Select hard work. Congratulations! You have already set a trigger for the hard work on the map. All units pre-placed on the map have a name.

If you have questions about variables, we recommend that you read related computer books (C ++ ).

Function

The trigger Editor contains many functions, allowing you to flexibly control them. Functions are usually used with variables. An example of a common function is "last created unit ". This function allows you to access the last unit created through "unit-create. It is one of two functions that can reference the last unit created (the other is: "last created unit group "). These functions can be used to replace the unit variables or to replace the units already placed on the map. Note that although these function return values, you cannot make the function equal to the variable. However, variables can be equal to functions.

For example, you have detected a hero upgrade through an event. The "Event Response-leveling Hero" function will reference the hero. You cannot make this function equal to other heroes. If you want to upgrade a hero. You can use this method: use other methods to detect this hero (for example: thing? Quot; Unit-player-owned unit event "or condition" unit-type comparison "), and then set actions for this hero, such as:" Hero-set level ."

Preset

Pre-setting is a built-in data type in the editor. You don't need to know, except to use it. And they cannot be changed. Example: "Player 1 (RED )."

Value

Another area that you can often modify is the value area. These regions allow you to enter information directly. For example, these regions will appear in the action "game-text message (auto-timed. If you click the Blue Line Text. You can open a character window. The last option of the window is a value. If you want to enter a simple information, simply enter it. You do not need to create another variable or function.

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.