Starting from 0, let everyone compete for III: Frozen throne programming show Hello, world

Source: Internet
Author: User

I have read a lot of jass-related documents online, so I have always wanted to use jass. However, for people like me who have never used the experience of We (World editor.exe), where can I connect code, I don't know how to run the test code.

After searching for the Internet for a long time, I felt that there were too few materials, but I finally succeeded. I recorded the information for reference.

First download a useful world editor. We recommend ydwe

Http://www.ydwe.net/download.html

The latest version is the official version of ydwe1.23.9"

Download the file, decompress it in any directory, and run ydwe.exe,

The first running will let you select the installation path of war3. You can just specify it.

Running Interface

Next we need to set two basic things for the map, and then the map can be saved and run:

1. For example, click "plot"> "map description" in the menu bar. The following dialog box is displayed:

In "name", enter "helloworld" and click "OK"

2. Set the start point of the game:

For example:

In the tool panel, select "unit panel", "neutral-Naga", select the building button, and place it anywhere on the map.

Finally, the effect is as follows:

Save the map now: Press "Ctrl + s", or "file"-> "Save map". After the map is saved successfully, congratulations!

Now, press Ctrl + F9 or File> test map to test your map!

Now let's get started: Use jass to write a helloworld function, and let it output "Hello, world!" on the screen every three seconds! .

Open the trigger editor in three ways:

1. Press the shortcut key "F4"

2. Press the button in the toolbar like the lower-case letter "".

3. Select "template" in the menu bar and select "trigger Editor" from the drop-down menu, for example:

As for the method that suits you, choose your own!

After the trigger editor is opened, the following screen appears, which triggers the compiler:

Now we need a clean environment to delete the default trigger on the far left. For example:

Then we create "category" and "Trigger" respectively ",

The final result is as follows:Myleibie"Category (folder icon), and a"Mytrigger"Trigger (file icon)

It is best to use English names instead of Chinese characters, because the name of the converted function is not intuitive!

Now let's look for a place to write the jass function.

Choose "edit"> "convert to custom text" in the menu bar ",

Note that this is irreversible unless you use the "undo" Function

The converted result is as follows:

Now we add our UDF helloworld at the top of the editor.

function HelloWorld takes nothing returns nothing    call DisplayTextToForce(GetPlayersAll(),"Hello world!")endfunction

Then call our function in trig_mytriggeractions:

Call helloworld ()

Finally, set the periodic call function in the inittrig_mytrigger function:

Call triggerregistertimereventperiodic (gg_trg_mytrigger, 3)

Final Result

Now, save the map and press Ctrl + F9 to test it.

You will see a message "Hello, world!" printed every three seconds on the screen! "

If you do not understand the meaning of jass above, go and check the relevant materials of various forums,

This is just an article that will introduce you to know where to write jass code and how to debug and run it.

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.