Skip to content

eGlint/Warcraft-III-Noise-Library

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Warcraft III Noise Library

Build

This repository contains Kenneth Perlin's Improved Noise, Kurt Spencer's Open Simplex, and implemented it to popular Warcraft 3 scripting languages.

Visit this repository for the Wurst version of the Noise library.

If you are not familiar with adding octaves to Perlin Noise, Flafla2's Octave Perlin, is an optional package that can help you.

Installation

Most Warcraft III map makers already know the common method of putting a script in a custom map: copy & paste the code in the Trigger Editor.

If you are not familiar with this method, here are the following instructions.

  1. You have a working copy of Warcraft III.
  2. You can open the official World Editor in two ways:
    1. Battle.net:
      • Open your Battle.net Launcher.
      • Select Warcraft III Reforged.
      • Above the Game Version, press the Launch Editor to start the World Editor.
    2. World Editor.exe:
      • Locate your Warcraft III installtion. The default Wndows installtion should be C:\Program Files\Warcraft III.
      • In the install path of Warcraft III, go to _retail_\x86_64\World Editor.exe.
  3. Once the World Editor is open, either create a new map or open an existing map you the Noise Library to become available.
  4. By default, JASS is the default scripting language of Warcraft III maps. If you are unsure about the current scripting language.
    1. In the menu bar: Scenario > Map Options....
    2. Under Scripting Language, the optio in the dropdown menu should either be JASS or Lua.
  5. Once a map is open, open the Trigger Editor. There are 3 ways to open it.
    1. Find the yellow "A" icon in tool bar.
    2. In the menu bar: Module > Trigger Editor.
    3. Press F4 in your keyboard.
  6. Optional. If you want to use vJass, it is required your Scripting Language to be JASS. On the Trigger Editor's menu bar: JassHelper > Enable JassHelper and make sure Enable vJass is enabled or checked.
  7. To keep it simple, select the top-most node of the tree view: The scroll icon with the name of the current map.
  8. Once you click the top-most node, you should be in the Custom Script Code.
  9. Now browse this repository, select the folder based on the scripting language you want to use: JASS, vJASS or Lua.
  10. Copy the raw content of Noise.j or Noise.lua and paste it at the Custom Script Code textbox.
  11. Optional. Copy the raw content of OctavePerlin.j or OctavePerlin.lua and strictly paste it below the Noise Library for JASS. For vJass and Lua, you can paste it above or below.
  12. Please thoroughly read the comments of the Noise Library script for any additional installtion instructions.

Setup

Before using the noise functions, make sure to call the folliwng initialization functions:

JASS:

function MyInitialization takes nothing returns nothing 
    call InitNoise()
endfunction

vJASS:
The library automatically calls Noise.initialize() by default.

Lua:
The library automatically calls Noise.initialize() by default.

Calling this initialization function will generate random values (uses Warcraft III's GetRandomInt) to the permutation table and set the constant values for the JASS/vJASS versions of the gradient table.

If you are having any issues with your noise functions during initialization, your permutation and gradient table are possibly uninitialized.

In case your library that uses the noise functions initializes ahead of the Noise library's initialization, call InitNoise (JASS) or Noise.initialize() (vJASS/Lua) in your initializer.

Demo Map

If you are stumped on how to make this library work, you can download a demo map of the Noise Library in the Hive Workshop.

Contributing

Become part of the contributors by doing a pull request.

Changelogs