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.
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.
- You have a working copy of Warcraft III.
- You can open the official World Editor in two ways:
- Battle.net:
- Open your Battle.net Launcher.
- Select Warcraft III Reforged.
- Above the Game Version, press the Launch Editor to start the World Editor.
- 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
.
- Locate your Warcraft III installtion. The default Wndows installtion should be
- Battle.net:
- Once the World Editor is open, either create a new map or open an existing map you the Noise Library to become available.
- By default, JASS is the default scripting language of Warcraft III maps. If you are unsure about the current scripting language.
- In the menu bar:
Scenario > Map Options...
. - Under Scripting Language, the optio in the dropdown menu should either be JASS or Lua.
- In the menu bar:
- Once a map is open, open the Trigger Editor. There are 3 ways to open it.
- Find the yellow "A" icon in tool bar.
- In the menu bar:
Module > Trigger Editor
. - Press
F4
in your keyboard.
- 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 sureEnable vJass
is enabled or checked. - To keep it simple, select the top-most node of the tree view: The scroll icon with the name of the current map.
- Once you click the top-most node, you should be in the Custom Script Code.
- Now browse this repository, select the folder based on the scripting language you want to use: JASS, vJASS or Lua.
- Copy the raw content of Noise.j or Noise.lua and paste it at the Custom Script Code textbox.
- 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.
- Please thoroughly read the comments of the Noise Library script for any additional installtion instructions.
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.
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.
Become part of the contributors by doing a pull request.