3006 Posts in 511 Topics - by 2197 Members - Latest Member: Nuttinut

Warcraft III: MapsModelsSkinsIconsSpellsToolsTutorials
WC3 JASS: Code SnippetsJASS and vJASS Spells and SystemsJass Tutorials
Chat @Discord

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - BlizzMod

Pages: [1] 2
1
Warcraft III Models / Iron Breaker
« on: November 21, 2017, 09:38:47 PM »
Keywords: Iron, breaker, dwarrf, WotTH
Model Type: Hero
Model Category: Dwarf
Rating: 5
Image/screenshot:
Warcraft III Model resource
« Created: November 21, 2017, 09:40:34 PM by moyack »

Related Topics or Resources


Iron Breaker

A model from the abandoned project War of the Three Hammers, a campaign developed initially by Camel's Hump and with the participation of an great staff of modellers, animators and skinners. This is one of the several models developed for this project.

I hope you can give a good use in your project.

ALL CREDITS TO THEIR RESPECTIVE AUTHORS.

2
Warcraft III Models / Iron Forge Guard
« on: November 13, 2017, 11:24:45 PM »
Keywords: Iron, forge, guard, dwarf, WotTH
Model Type: Unit
Model Category: Dwarf
Rating: 5
Image/screenshot:
Warcraft III Model resource
« Created: November 13, 2017, 11:26:16 PM by moyack »

Related Topics or Resources


Iron Forge Guard

A model from the abandoned project War of the Three Hammers, a campaign developed initially by Camel's Hump and with the participation of an great staff of modellers, animators and skinners. This is one of the several models developed for this project.

I hope you can give a good use in your project.

ALL CREDITS TO THEIR RESPECTIVE AUTHORS.

3
Warcraft III Models / Captain Drenn Stoneaxe
« on: November 12, 2017, 12:06:57 AM »
Keywords: Hero, Drenn, Stone, Axe, WotTH
Model Type: Hero
Model Category: Dwarf
Rating: 5
Image/screenshot:
Warcraft III Model resource
« Created: November 12, 2017, 12:08:33 AM by moyack »

Related Topics or Resources


Captain Drenn Stoneaxe

A model from the abandoned project War of the Three Hammers, a campaign developed initially by Camel's Hump and with the participation of an great staff of modellers, animators and skinners. This is one of the several models developed for this project.

I hope you can give a good use in your project.

ALL CREDITS TO THEIR RESPECTIVE AUTHORS.

Quote
Atlast he is finished! I present to you Captain Drenn Stoneaxe, main character of the Bronzebeard campaign. Model and skin by camel's_hump, animations and particles by Chriz.

4
Warcraft III Models / Hearth Guard
« on: October 27, 2017, 10:16:28 PM »
Keywords: Hearth, guard, WotTH
Model Type: Hero
Model Category: Dwarf
Rating: 5
Image/screenshot:
Warcraft III Model resource
« Created: October 27, 2017, 10:18:21 PM by moyack »

Related Topics or Resources


Hearth Guard

A model from the abandoned project War of the Three Hammers, a campaign developed initially by Camel's Hump and with the participation of an great staff of modellers, animators and skinners. This is one of the several models developed for this project.

I hope you can give a good use in your project.

ALL CREDITS TO THEIR RESPECTIVE AUTHORS.

Quote
The Hearthguards are great leaders of the Wildhammer army. With their skills in battle, mighty armor, stone swords, and two-headed axes, they have developed to be both deadly attackers and seasoned defenders.

Head model by Tufy, axe model by someone at wc3search, base model by Blizzard. Model and skin by camel's_hump.

5
Warcraft III Models / The Firelord
« on: October 16, 2017, 09:11:06 AM »
Keywords: Firelord, WotTH
Model Type: Unit
Model Category: Creep, Demon, Dwarf
Rating: 5
Image/screenshot:
Warcraft III Model resource
« Created: October 16, 2017, 09:15:52 AM by moyack »

Related Topics or Resources


The Firelord


A model from the abandoned project War of the Three Hammers, a campaign developed initially by Camel's Hump and with the participation of an great staff of modellers, animators and skinners. This is one of the several models developed for this project.

I hope you can give a good use in your project.

ALL CREDITS TO THEIR RESPECTIVE AUTHORS.

Quote from: Chriz.
The Firelord unit.. Fully animated and ready to go.

Animations include:
  • Stand
  • Stand 2
  • Stand Ready

  • Walk

  • Attack

  • Attack 2
  • Spell Channel

  • Death
  • Decay
  • Portrait

6
Warcraft III Models / Dwarven Priest
« on: October 15, 2017, 09:33:39 PM »
Keywords: Dwarf, priest, WotTH
Model Type: Unit
Model Category: Dwarf
Rating: 4
Image/screenshot:
Warcraft III Model resource
« Created: October 15, 2017, 09:35:30 PM by moyack »

Related Topics or Resources


Dwarven Priest

A model from the abandoned project War of the Three Hammers, a campaign developed initially by Camel's Hump and with the participation of an great staff of modellers, animators and skinners. This is one of the several models developed for this project.

I hope you can give a good use in your project.

ALL CREDITS TO THEIR RESPECTIVE AUTHORS.

7
Warcraft III Models / Dark Iron Warrior
« on: October 14, 2017, 11:27:02 PM »
Keywords: Dark, Iron, Warrior, Dwarf, WotTH
Model Type: Unit, Hero
Model Category: Dwarf
Rating: 5
Image/screenshot:
Warcraft III Model resource
« Created: October 14, 2017, 11:31:04 PM by moyack »

Related Topics or Resources


Dark Iron Slave

A model from the abandoned project War of the Three Hammers, a campaign developed initially by Camel's Hump and with the participation of an great staff of modellers, animators and skinners. This is one of the several models developed for this project.

I hope you can give a good use in your project.

ALL CREDITS TO THEIR RESPECTIVE AUTHORS.

8
Warcraft III Models / Dark Iron Sorcerer
« on: October 14, 2017, 10:31:43 PM »
Keywords: Dark, Iron, Sorcerer, mage, Dwarf, WotTH
Model Type: Unit
Model Category: Dwarf
Rating: 5
Image/screenshot:
Warcraft III Model resource
« Created: October 14, 2017, 10:34:50 PM by moyack »

Related Topics or Resources


Dark Iron Sorcerer


A model from the abandoned project War of the Three Hammers, a campaign developed initially by Camel's Hump and with the participation of an great staff of modellers, animators and skinners. This is one of the several models developed for this project.

I hope you can give a good use in your project.

ALL CREDITS TO THEIR RESPECTIVE AUTHORS.


Quote
The sorcerers are some of the most senior magicians in the clan. They know the way o the mind, and can create false visions to fool the unwise, as well as urge on their own warriors. The sorcerers are often distrusted even by their masters because the way they manipulate the weak minded.

Model by Mc !, skin by Falcoknight

9
Warcraft III Models / Dark Iron Slave
« on: October 11, 2017, 10:16:20 PM »
Keywords: Dark, Iron, Slave, Dwarf, WotTH
Model Type: Unit
Model Category: Dwarf
Rating: 5
Image/screenshot:
Warcraft III Model resource
« Created: October 11, 2017, 10:19:13 PM by moyack »
« Last Edit: October 14, 2017, 10:33:29 PM by moyack »

Related Topics or Resources


Dark Iron Slave


A model from the abandoned project War of the Three Hammers, a campaign developed initially by Camel's Hump and with the participation of an great staff of modellers, animators and skinners. This is one of the several models developed for this project.

I hope you can give a good use in your project.

ALL CREDITS TO THEIR RESPECTIVE AUTHORS.


Quote
At the bottom of the Dark Iron hierarchy are the commoners. They serve their masters by doing lowly works like cutting timber or setting up buildings. Even though the ones above them sneer, these are the ones who make Dark Iron society go around.

Fully modeled, unwrapped and animated by Chriz.
Texture made by camel's_hump

10
Learning by Gaming Project / El Encuentro de las Especies
« on: September 24, 2017, 09:16:04 PM »
El Encuentro de las Especies.
por: William Salazar

Tipo: Supervivencia
Modo Campaña: (historia inicial) y Modo multiplayer.
Personajes: Cesar Correa, William, Moyack, Juan David Gómez

INTRODUCCIÓN
Año 2030, 6 amigos fueron de viaje . Pero un inesperado accidente hizo que
perdieran  la dirección de su barco, cayendo en una grieta espacio temporal que
los dirigió a otra dimensión. Mientras pasaban  por esta especie de túnel vieron y oyeron   
cosas extrañas y perturbadoras...

-Nuestros personajes se verán enfrentados a diversos retos encontrando múltiples
especies unas amigables y otras no tanto,
 serán capases de sobrevivir y encontrar la salida de este lugar ...?

HISTORIA

Año 2030, 6 Amigos fueron de viaje . Pero un inesperado accidente  hizo que
perdieran la dirección de su barco, cayendo en una grieta espacio temporal que
los dirigió a otra dimensión. Mientras pasaban  por esta especie de túnel vieron y oyeron 
cosas extrañas y perturbadoras.

Llegaron a un lugar muy parecido a la tierra, se podía respirar, había agua ,
habían frutas parecidas pero no sabían si eran toxicas o si el agua se podía tomar.
No lo hicieron hasta  que  tomaron  pequeñas cantidades de cada fruta o vegetal parecidos a los que ellos  conocían.

No sabían si era la tierra hasta que de repente  vieron un animal similar a un  mino tauro,
quimeras centauro y se dieron  cuenta que habían entrado  en  algo poco convencional solo
se acuerda que viajaron en algo al principio  pensaron que habían viajado al pasado.
Se repartieron tareas para quedarse en esa isla reunieron agua troncos para  hacer una
fogata para hervir el agua  los 3 hombres vigilaron al principio  hasta que pudieran  luego
despertar a las mujeres para que ellos pudieran dormir

2 hombres  y 1 mujer fueron a navegar alrededor  encontrando una isla pero parecía
 más peligrosa y como simios pero tenían inteligencia y conciencia, con 5 dedos lo cual era raro,
 se podían comunicar pero no le dieron importancia  ya  que se veían  amigables , volvieron  e hicieron
 una balsa más grande  y fueron todos.

A William le  hirieron con una lanza así que fueron a su isla para intentar no
recibir más daños e hicieron su propio armamento para intentar comunicarse,
no lograron e intentaban solo herir a los hombres ya que las mujeres se parecían a las de su especie.

Regresando a su isla se percataron de que los estaban siguiendo.Al llegar intentaron llevarse a las mujeres
se escondieron durante un tiempo no savian como detenerlos o como regresar a casa..


11
Warcraft III Models / Dark Iron Magi
« on: September 21, 2017, 10:57:26 PM »
Keywords: Dark, Iron, Magi, WotTH
Model Type: Unit
Model Category: Dwarf
Rating: 5
Image/screenshot:
Warcraft III Model resource
« Created: September 21, 2017, 10:59:16 PM by BlizzMod »

Related Topics or Resources


Dark Iron Magi


A model from the abandoned project War of the Three Hammers, a campaign developed initially by Camel's Hump and with the participation of an great staff of modellers, animators and skinners. This is one of the several models developed for this project.

I hope you can give a good use in your project.

ALL CREDITS TO THEIR RESPECTIVE AUTHORS.


Quote
The magi of the Dark Iron dwarves are indeed masters of fire, and the most powerful ones can even summon the mighty fire elementals to aid them in battle.

Model by Mc !
Texture by camel's_hump
Animations by Chriz.

12
Warcraft III Models / Dark Iron Devoted
« on: September 20, 2017, 12:14:13 AM »
Keywords: Dark, Iron, Devoted, Hero, WotTH
Model Type: Hero
Model Category: Dwarf
Rating: 5
Image/screenshot:
Warcraft III Model resource
« Created: September 20, 2017, 12:16:49 AM by moyack »

Related Topics or Resources


Dark Iron Devoted


A model from the abandoned project War of the Three Hammers, a campaign developed initially by Camel's Hump and with the participation of an great staff of modellers, animators and skinners. This is one of the several models developed for this project.

I hope you can give a good use in your project.

ALL CREDITS TO THEIR RESPECTIVE AUTHORS.


Quote
The devoted ones are often younger dwarves who wish to prove themselves in battle. Even though their swords are particularly sharp, or their armor especially strong, the willpower and their courage alone may well hold of the enemy long enough for spell casters to get themselves ready.

Model and skin by camel's Hump, base model by Blizzard.

13
Warcraft III Models / Dark Iron Beserker
« on: September 18, 2017, 12:30:29 AM »
Keywords: Dark, Iron, Berseker, Hero, WotTH
Model Type: Hero
Model Category: Dwarf
Rating: 5
Image/screenshot:
Warcraft III Model resource
« Created: September 18, 2017, 12:33:48 AM by moyack »

Related Topics or Resources


Dark Iron Berseker


A model from the abandoned project War of the Three Hammers, a campaign developed initially by Camel's Hump and with the participation of an great staff of modellers, animators and skinners. This is one of the several models developed for this project.

I hope you can give a good use in your project.

ALL CREDITS TO THEIR RESPECTIVE AUTHORS.


Quote
Older warriors, who have survived long enough are elected to become berserkers. They take a special concoction on regular basis, which allows them to, when called for, go into a frenzy. When they do, not many will stand up to them.

Model by Norinrad and camel's_hump, skin by Falcoknight and camel's_hump.

14
Warcraft III Models / Bronze Beard Thane
« on: August 19, 2017, 07:06:02 AM »
Keywords: Bronzebeard, Thane, Hero, WotTH
Model Type: Hero
Model Category: Dwarf
Rating: 5
Image/screenshot:
Warcraft III Model resource
« Created: August 19, 2017, 07:08:16 AM by BlizzMod »

Related Topics or Resources


Bronze Beard Thane


A model from the abandoned project War of the Three Hammers, a campaign developed initially by Camel's Hump and with the participation of an great staff of modellers, animators and skinners. This is one of the several models developed for this project.

I hope you can give a good use in your project.

ALL CREDITS TO THEIR RESPECTIVE AUTHORS.

15
Warcraft III Models / Bronze Beard Crossbowman (Caped)
« on: August 18, 2017, 10:59:57 PM »
Keywords: Bronzebeard, crossbowman, WotTH
Model Type: Unit
Model Category: Dwarf
Rating: 5
Image/screenshot:
Warcraft III Model resource
« Created: August 18, 2017, 11:01:31 PM by BlizzMod »

Related Topics or Resources


Bronze Beard Crossbowman (Caped)


A model from the abandoned project War of the Three Hammers, a campaign developed initially by Camel's Hump and with the participation of an great staff of modellers, animators and skinners. This is one of the several models developed for this project.

I hope you can give a good use in your project.

ALL CREDITS TO THEIR RESPECTIVE AUTHORS.

16
Warcraft III Models / Bronze Beard King Warrior
« on: July 26, 2017, 10:08:40 PM »
Keywords: Bronze, Beard, King warrior, WotTH
Model Type: Unit
Model Category: Dwarf
Rating: 5
Image/screenshot:
Warcraft III Model resource
« Created: July 26, 2017, 10:08:40 PM by BlizzMod »

Related Topics or Resources


Bronze Beard King Warrior


A model from the abandoned project War of the Three Hammers, a campaign developed initially by Camel's Hump and with the participation of an great staff of modellers, animators and skinners. This is one of the several models developed for this project.

I hope you can give a good use in your project.

This model manages team color on all his armor, allowing to have different representations or armors, which could be useful in giving the idea of different warrior types.

ALL CREDITS TO THEIR RESPECTIVE AUTHORS.

17
Warcraft III Models / Bronze Beard Worker
« on: July 25, 2017, 08:29:29 PM »
Keywords: Broze, Beard, worker, WotTH
Model Type: Unit
Model Category: Dwarf
Rating: 5
Image/screenshot:
Warcraft III Model resource
« Created: July 25, 2017, 08:29:29 PM by moyack »
« Last Edit: July 25, 2017, 10:12:03 PM by BlizzMod »

Related Topics or Resources


Bronze Beard Worker


A model from the abandoned project War of the Three Hammers, a campaign developed initially by Camel's Hump and with the participation of an great staff of modellers, animators and skinners. This is one of the several models developed for this project.

I hope you can give a good use in your project.

So, you thought WC3 needed a Dwarf model?? here it is!!! with nice animations and all the fancy stuff. And don't forget his beard, it's sexy  ;D

ALL CREDITS TO THEIR RESPECTIVE AUTHORS.

18
Updated Bronze Beard warrior

19
Warcraft III Models / Bronze Beard Warrior
« on: July 24, 2017, 10:17:38 PM »
Keywords: Bronze, Bear, warrior
Model Type: Unit, Hero
Model Category: Dwarf
Rating: 5
Image/screenshot:
Warcraft III Model resource
« Created: July 24, 2017, 10:17:39 PM by BlizzMod »

Related Topics or Resources


Bronze Beard Warrior


A model from the abandoned project War of the Three Hammers, a campaign developed initially by Camel's Hump and with the participation of an great staff of modellers, animators and skinners. This is one of the several models developed for this project.

I hope you can give a good use in your project.

Notes: This model has no team color, but it has a lot of animations. It can be used as unit or hero, but mostly as a hero because it doesn't have decay animations.


ALL CREDITS TO THEIR RESPECTIVE AUTHORS.

20
Uploaded BB_Crossbowman.

21
Warcraft III Models / Bronze Beard Crossbowman
« on: July 23, 2017, 09:48:50 PM »
Keywords: BB, Crossbowman
Model Type: Unit
Model Category: Dwarf
Rating: 5
Image/screenshot:
Warcraft III Model resource
« Created: July 23, 2017, 09:48:50 PM by BlizzMod »

Related Topics or Resources


Bronze Beard Crossbowman


A model from the abandoned project War of the Three Hammers, a campaign developed initially by Camel's Hump and with the participation of an great staff of modellers, animators and skinners. This is one of the several models developed for this project.

I hope you can give a good use in your project.

ALL CREDITS TO THEIR RESPECTIVE AUTHORS.

22
Uploaded BB_Ramrider... at last!!!!

23
Warcraft III Models / Bronze Beard Ram Rider
« on: July 23, 2017, 09:00:55 PM »
Keywords: WotTH, BB, Ramrider
Model Type: Unit
Model Category: Dwarf
Rating: 5
Image/screenshot:
Warcraft III Model resource
« Created: July 23, 2017, 09:00:55 PM by BlizzMod »

Related Topics or Resources


Bronze Beard Ram Rider


A model from the abandoned project War of the Three Hammers, a campaign developed initially by Camel's Hump and with the participation of an great staff of modellers, animators and skinners. This is one of the several models developed for this project.

I hope you can give a good use in your project.

ALL CREDITS TO THEIR RESPECTIVE AUTHORS.

24
Jass Tutorials / Trackables (Mouse detection)
« on: July 09, 2017, 01:51:10 AM »
Tutorial originally made by wonderpriest inspired in Kattana original tutorial.

Trackables

A trackable is just something like a doodad, let's say. But it is different as it can't be selected, it can't be moved, it can't die, and it can't be eliminated. It doesn't even have to be seen if you don't want it to.
The point of a trackable is to harness the mouse detection for usage in triggers. Mouse detection just means the game registers when your mouse pointer moves over an object, or clicks it.

FAQ
As I get more questions, I will answer them here so you don't have to sift through the posts.
Code: Text  [Select]
  1. Q. Do trackables work in multiplayer maps?
  2. A. Yes, they work fine. As for tracking which player triggered the trackable, you would need a handler system for that.

Limitations
Although Blizzard gave us these functions to use mouse detection, it doesn't seem they really cared to finsh the code, because you can not retrieve a triggering player from a trackable event. Nor can a trackable be owned by a player.
The usage of trackables is very limited, because you can not manipulate anything about a trackable once you create it, or before. This means you can not move, scale, color, or make any other kind of modification. You just create it, and that's it.
Also, one of the reasons not many people know of trackables, is because they require JASS to fully use. You can create and manipulate trackables through the Custom Script action, but there is no event in GUI that uses trackables.
Fortunately, the functions are not very hard to understand and require little, if any, JASS knowledge.


Usage
I wanted to bring these trackables to attention, because even many JASSers seem to not know what they are. Trackables are a powerful tool that can be used to make better interactive systems, and even things like mini-games.

To use trackables, first you must create them. They can not be pre-placed in a map, so you must make them through triggers. They are created somewhat like units are created, only you use a model string to determine the model of the trackable, not an id or name.
This is actually very useful, because you can use any valid model path. This includes units, buildings, doodads...anything with a model path. If you use a unit or buildiing model, the trackable will appear looking like a neutral hostile unit, with no team colors.
Trackables do play animations. If you want a trackable to be invisible, you just insert a void string argument (""). Here is the function to create a trackable:

Code: jass  [Select]
  1. CreateTrackable(string modelpath, real x, real y, real facing)
  2.  
  3. modelpath is the path of the model you would like to use. Use "" for an invisable trackable. Remember to use \\ instead of \.
  4. real x and real y are the coordinates of the location to create the trackable
  5. facing is the angle that the trackable faces (remember this cannot be changed after creation)

The events for trackables are as follows:

Code: jass  [Select]
  1. TriggerRegisterTrackableHitEvent(trigger whichTrigger, trackable t)
  2. TriggerRegisterTrackableTrackEvent(trigger whichTrigger, trackable t)
  3.  
  4. trackable is a handle that you use like any other handle (unit, location...).

TriggerRegisterTrackableHitEvent registers when a player clicks on a trackable. TriggerRegisterTrackableTrackEvent registers when a player moves his mouse across a trackable.
You may notice that this same system is in place with normal units in Warcraft III. When you click a unit, you select it. When you pass over a unit with your mouse, a bar shows it's health.
Trackable events work like any other event, but you also need to specify a trackable for the event to register.

A Trigger:
This trigger will create a trackable, and when someone passes over it, a message will be sent.
Code: jass  [Select]
  1. function Massage takes nothing returns nothing
  2.     call DisplayTextToForce(GetPlayersAll(),"Peasant: OOh, that feels nice.") //Displays the pleasure of the peasant when we rub him with our mouse
  3. endfunction
  4.  
  5. //===========================================================================
  6. function InitTrig_zomg takes nothing returns nothing
  7.  local trigger t=CreateTrigger() //Creates the trigger
  8.  local trackable tr=CreateTrackable("units\\human\\Peasant\\Peasant.mdl",0,0,-90) //Creates our trackable, with the peasant model
  9.     call TriggerRegisterTrackableTrackEvent(t,tr) //Registers when someone passes over tr with their mouse
  10.     call TriggerAddAction(t,function Massage) //Calls our actions function
  11. endfunction

You may notice I display the message to all players. This is because there is no 'GetTriggeringPlayer' for a trackable event, which is probably the biggest limitation of trackables. But, there is a 'GetTriggeringTrackable'. Which opens up possibilites to fix the missing TriggeringPlayer problem. (With 'GetTriggeringTrackable', you may be able to stimulate a Triggering Player, maybe by using the Handle Vars or another system)

The Result:



ADD: Trackable Workarounds (credits to KaTTana)
Using Handle Vars With Trackables
KaTTana wrote this part better than I can, so here it is.
You can find KaTTana's Trackables tutorial here: Link
You can find KaTTana's Handle Var turorial here: Link

A Part of KaTTana's Tutorial:
"We don't have any natives for getting the (x,y) coordinates of a trackable, but we can handle that ourselves with the Local Handle Variables.
Here is a custom API for extended use of trackables.

Code: jass  [Select]
  1. // ===========================
  2. //   Trackable API
  3.  
  4. function GetTrackableX takes trackable tc returns real
  5.     return GetHandleReal(tc, "x")
  6. endfunction
  7. function GetTrackableY takes trackable tc returns real
  8.     return GetHandleReal(tc, "y")
  9. endfunction
  10. function GetTrackableFacing takes trackable tc returns real
  11.     return GetHandleReal(tc, "facing")
  12. endfunction
  13. function GetTrackablePath takes trackable tc returns string
  14.     return GetHandleString(tc, "path")
  15. endfunction
  16.  
  17. function NewTrackable takes string path, real x, real y, real facing returns trackable
  18.     local trackable tc = CreateTrackable(path, x, y, facing)
  19.     call SetHandleReal(tc, "x", x)
  20.     call SetHandleReal(tc, "y", y)
  21.     call SetHandleReal(tc, "facing", facing)
  22.     call SetHandleString(tc, "path", path)
  23.     return tc
  24. endfunction

Trackables in Multiplayer
Previously, the tutorial stated that trackables didn't work in multiplayer, but that was wrong. They work fine, and they don't desynchronize the game.
However, there is no way to determine which player triggered the event on a trackable. We can work around this by creating a trackable for each player - each can only be triggered by one player.

Code: jass  [Select]
  1.     // t1 and t2 are visually the same trackable, but in fact they only work for one player each
  2.     local trackable t1 // Player 1's trackable
  3.     local trackable t2 // Player 2's trackable
  4.     local string peasant = "units\\human\\Peasant\\Peasant.mdl"
  5.     local string invisible = ""
  6.     local string path = invisible
  7.  
  8.     if ( GetLocalPlayer() == Player(0) ) then
  9.         set path = peasant
  10.     endif
  11.     set t1 = CreateTrackable(path, -500, 0, 0)
  12.  
  13.     set path = invisible
  14.     if ( GetLocalPlayer() == Player(1) ) then
  15.         set path = peasant
  16.     endif
  17.     set t2 = CreateTrackable(path, -500, 0, 0)
  18.  
  19.     call SetHandleInt(t1, "player", 0) // Store which player "owns" this trackable
  20.     call SetHandleInt(t2, "player", 1) // Same for player 2
  21.  
  22.     // Add events to register track/hit on t1 and t2...

After this, you can determine the player triggering a trackable by reading the local integer named "player" on the triggering trackable.

We can extend to NewTrackable if you like:
Code: jass  [Select]
  1. function GetTrackableOwner takes trackable t returns player
  2.     return Player(GetHandleInt(t, "player"))
  3. endfunction
  4.  
  5. function NewTrackable takes string path, real x, real y, real facing, player owner returns trackable
  6.     local trackable tc
  7.     local string invisible = ""
  8.     if GetLocalPlayer() != owner then
  9.         set path = invisible
  10.     endif
  11.     set tc = CreateTrackable(path, x, y, facing)
  12.     call SetHandleReal(tc, "x", x)
  13.     call SetHandleReal(tc, "y", y)
  14.     call SetHandleReal(tc, "facing", facing)
  15.     call SetHandleString(tc, "path", path)
  16.     call SetHandleInt(tc, "player", GetPlayerId(owner))
  17.     return tc
  18. endfunction

Giving height to Trackables
Although the natives do not allow it, a simple workaround enables us to create trackables at a given height above ground.
Code: jass  [Select]
  1. function CreateTrackableZ takes string path, real x, real y, real z, real face returns trackable
  2.     local destructable d = CreateDestructableZ( 'OTip', x, y, z, 0.00, 1, 0 )
  3.     local trackable tr = CreateTrackable( path, x, y, face )
  4.     call RemoveDestructable( d )
  5.     set d = null
  6.     return tr
  7. endfunction
It works by creating an Invisible Platform at the given height, and then creating the trackable on top of that. After removing the platform, the trackable stays in place."
_________________________________________________________________

Once again, that was part of KaTTana's trackable tutorial, which you can find here: Link


That's it for the Trackables tutorial, thanks for reading, and hope you have fun using these in your map!

Questions, comments, and suggestions are welcome, and appreciated!

ADD: If anyone finds this confusing, or wants a demo map to look at, just say iit and I will make a demo map using all of the Trackable functions.

25
Jass Tutorials / Creating simple AIs for Hero Arena-type maps
« on: July 09, 2017, 01:42:59 AM »
Developed by Blade.dk

This tutorial will help you add a simple, but cool, AI to hero arena type maps.

The AI you’ll learn how to make here will not be perfect. The one we will create here will attack other heroes, pick up items, learn and use spells, but it won’t be as effective as a human player.

However, when you’ve learned the basics you should be able to improve it yourself.

Requires

JASS Knowledge – This tutorial uses JASS examples, and JASS-only features, so you will need to know JASS to follow this tutorial and make the AI. Technically it can be done in the GUI, but I won’t recommend that due to memory leaks, tons of unneeded code, and because using return bug and game cache based systems isn’t possible in the GUI. If you don’t know JASS, check the JASS tutorials at The JASS Vault and Wc3Campaigns.
You also need to know what a rawcode are, if you don’t, just search the different Warcraft 3 sites to find out.
A game cache and return bug based system – This can be KaTTaNa’s Local Handle Variables, Vexorian’s CSCache module (a part of the Caster System) or any other similar system.
In this tutorial I’ll use the CSCache module.
This map – A small map I’ve created that shows a simple AI like the one we’ll make in action. It is important that you have this map, as the tutorial often refers to it.

Notes
- The AI we’ll make here is not as good as a human player, but better than nothing. And when you’ve learned the basics, you should be able to improve it yourself.
- A lot of numbers (player numbers, for example) starts from 1 in the GUI, but while they starts from 0 in JASS. As this is a JASS tutorial, they start from 0 here.
- You don’t have to do the things exactly like I do them; I do it in my way, but if your way is better or you just feel more comfortable with it, do it your own way. I’m not perfect, and this tutorial isn’t perfect either, but hopefully it will help somebody.
- You could use the AI from my demo map without creating your own (if you do so, give me credit), but I suggest making your own, as maps can be very different, and because you should be able to learn more from making it yourself.
- The demo map is probably not perfectly unbugged, and it isn’t the funniest map either. Remember that it was just a map I quickly created to show a simple AI, if you want to see a better map with a good AI, take a look at Azeroth’s Arcane Arena.
- I would like to specially thank Vexorian for encouraging me to make my first AI for my map, giving me tips on how to do it, and for showing me his AI, which helped me improve mine. Thanks!

Initialization

First create a new trigger with the “Player - Player 1 (Red) leaves the game” event. Convert it to JASS. We need that trigger to register when a player leaves the game, so we can start the AI for that player. At the moment it will only register when player 0 leaves the game, so we’ll use a loop to make it register when any player from 0-11 leaves instead.

We want the AI to use abilities. This may sound hard, but it isn’t. We just have to make the Heroes learn the abilities, and they’ll cast them themselves.

NOTE: The situation where a computer-controlled hero will cast a spell is always the same situation as where it would cast the spell it’s based on. So if you have a custom spell based on Silence, it will cast it in situations where it would cast it in melee games. NEVER base your spells of the “Channel” ability, as the AI never will use them. Changing the OrderString field on a spell in the Object Editor does nothing, it will still be the same as on the base spell.

To know which spells the heroes have, we create a game cache to store it in.

In the example map my trigger creates a gamecache at map initialization and saves it in the udg_GameCache global variable. Note that the cache HAS to be initialized before we starts using it, so I will do that in the first InitTrig function of my map.

In my map I create a function called “SetupSkills”. In the AI trigger’s InitTrig function I use the ExecuteFunc native (read more about that native here) to execute that function in another thread. This is to prevent the map initialization thread from getting too long, and crash.

My SetupSkills function looks like this:

Code: jass  [Select]
  1.  function SetupSkills takes nothing returns nothing
  2.     local string h // Create a local string variable
  3. // Paladin // Here we’ll initialise the Paladin’s skills, repeat this for all other heroes
  4.     set h = UnitId2String('Hpal') // Store the returned value of UnitId2String(‘Hpal’) in the local
  5.     call StoreInteger(udg_GameCache, h, "BaseSkill1", 'AHhb') // One of his base skills is Holy Light, store it as “BaseSkill1”
  6.     call StoreInteger(udg_GameCache, h, "BaseSkill2", 'AHds') // Store Divine Shield as “BaseSkill2”
  7.     call StoreInteger(udg_GameCache, h, "BaseSkill3", 'AHad') // Store Devotion Aura as “BaseSkill3”
  8.     call StoreInteger(udg_GameCache, h, "UltimateSkill", 'AHre') // Store Resurrection as his “UltimateSkill”
  9. // Repeat for each Hero.
  10. endfunction

Here’s my InitTrig_AI function:

Code: jass  [Select]
  1.  function InitTrig_AI takes nothing returns nothing
  2.     local integer i = 0
  3.     set gg_trg_AI = CreateTrigger(  )
  4.     loop
  5.         exitwhen i > 11
  6.         call TriggerRegisterPlayerEventLeave( gg_trg_AI, Player(i) )
  7.         set i = i + 1
  8.     endloop
  9.     call TriggerAddAction( gg_trg_AI, function PlayerLeaves )
  10.     call ExecuteFunc("SetupSkills")
  11. endfunction

Starting the AI for a hero

To control the AI I will use a timer. I create a function called “StartAI” that takes a single unit argument: the hero (check the function in the example map). The function just creates a timer, "attaches" the hero to it, and starts it (just make the expiration function now, we will out some actions into it later, but you need the function and endfunction lines to prevent getting compile errors).

This is the empty AILoop function and the StartAI function from the example map:

Code: jass  [Select]
  1. function AILoop takes nothing returns nothing
  2. endfunction
  3.  
  4. function StartAI takes unit hero returns nothing
  5.     local timer m = CreateTimer()
  6.     call AttachObject(m, "hero", hero)
  7.     call TimerStart(m, 0, false, function AILoop)
  8.     set m = null
  9. endfunction

Note that I’m starting it as a “one-shot” timer, by using false as the 'periodic' boolean value (we’ll get back to that later).

Now just make your hero selection system call that function when a computer controlled player chooses a hero, and go to the function that is executed when a player leaves the game. Check if the player has a hero, if he/she has one, call the function that starts the AI on that hero. Example:

Code: jass  [Select]
  1. function PlayerLeaves takes nothing returns nothing
  2.     local player p = GetTriggerPlayer()
  3.     call DisplayTextToForce(bj_FORCE_ALL_PLAYERS, GetPlayerName(p)+" has left the game.")
  4.     if udg_Hero[GetPlayerId(p)] != null then
  5.         call StartAI(udg_Hero[GetPlayerId(p)])
  6.     endif
  7.     set p = null
  8. endfunction

NOTE: This will make the AI take control of a leaving player's hero, this is not needed, if you want to do something else when a player leaves.

Making the AI do something

Whenever the timer expires there are some things we want it to do:
  •    If the hero is dead, wait until he/she/it is revived.
  •    If the hero is about to die, order him/her/it to move to the fountain at the map center.
  •    If the hero has a fine amount of health, check if an enemy is close. If true, order the Hero to attack it, else check for items close to the hero, if any, issue a smart order so the Hero will pick the up. if there isn’t any, just order the hero to patrol to a random point in the arena.
  •    If the hero is alive and has any unused skill points, learn a skill.

We’ll start with declaring all the variables.  Notice the real variable 'e' in my function, it defines how long time will elapse before the timer expires again, so we can wait shorter time if the hero is dead, or longer time if he/she/it is attacking. That variable is initialized with the value 5.

Declare the local variables:

Code: jass  [Select]
  1. function AILoop takes nothing returns nothing
  2.     local string a = GetAttachmentTable(GetExpiredTimer())
  3.     local unit h = GetTableUnit(a, "hero")
  4.     local rect i
  5.     local location r
  6.     local real x = GetUnitX(h)
  7.     local real y = GetUnitY(h)
  8.     local group g
  9.     local boolexpr b
  10.     local boolexpr be
  11.     local unit f
  12.     local string o = OrderId2String(GetUnitCurrentOrder(h))
  13.     local real l = GetUnitState(h, UNIT_STATE_LIFE)
  14.     local real e = 5

We start with checking if the hero is dead, if he/she/it is, set the real variable to 1.5 (because waiting 5 seconds after revival is too long time, we don’t want that).

The hero’s life ('l' is 0, just set e to 1.5 to make the timer check more frequently for the hero’s revival.

Code: jass  [Select]
  1.     if l <= 0 then
  2.         set e = 1.5
  3.     endif

Next I check if the hero’s life is below 20% of it's max life. If it is low, order the hero to move to fountain and set the variable 'e' to 3.

The hero’s life is less than 20% of max life, so order the hero to move to the position of the fountain:

Code: jass  [Select]
  1.     if l < GetUnitState(h, UNIT_STATE_MAX_LIFE)/5 then
  2.         call IssuePointOrder(h, "move", GetUnitX(gg_unit_nfoh_0001), GetUnitY(gg_unit_nfoh_0001))
  3.         set e = 3

If the hero isn’t weak, check if he/she/it has a common order (to prevent it from interrupting channel spells). If it is a standard order, we check if any enemies are within a radius of 500. If true, simply issue an attack order (don’t change the 'e' variable, 5 seconds is fine in this situation).

Code: jass  [Select]
  1.  function AIFilterEnemyConditions takes nothing returns boolean
  2.     return GetUnitState(GetFilterUnit(), UNIT_STATE_LIFE) > 0 and IsPlayerEnemy(GetOwningPlayer(GetFilterUnit()), GetOwningPlayer(GetAttachedUnit(GetExpiredTimer(), "hero")))
  3. endfunction
  4.  
  5.     else
  6.         if ((o == "smart") or (o == "attack") or (o == "patrol") or (o == "move") or (o == "stop") or (o == "hold") or (o == null)) then
  7.             set g = CreateGroup()
  8.             set b = Condition(function AIFilterEnemyConditions)
  9.             call GroupEnumUnitsInRange(g, x, y, 500, b)
  10.             set f = FirstOfGroup(g)
  11.             if f == null then
  12.             else
  13.                 call IssueTargetOrder(h, "attack", f)
  14.             endif
  15.             call DestroyGroup(g)
  16.             call DestroyBoolExpr(b)
  17.         endif


If no enemies are found, check for items. If an item is found, check if it’s a powerup. If it isn’t, check if the hero has any empty inventory slots, and order the hero to pick it up.

Code: jass  [Select]
  1.  function AISetItem takes nothing returns nothing
  2.     set bj_lastRemovedItem=GetEnumItem()
  3. endfunction
  4.  
  5. function AIItemFilter takes nothing returns boolean
  6. endfunction
  7.  
  8. function AIHasEmptyInventorySlot takes unit u returns boolean
  9.     return UnitItemInSlot(u, 0) == null or UnitItemInSlot(u, 1) == null or UnitItemInSlot(u, 2) == null or UnitItemInSlot(u, 3) == null or UnitItemInSlot(u, 4) == null or UnitItemInSlot(u, 5) == null
  10. endfunction
  11.  
  12.             if f == null then
  13.                 set i = Rect(x-800, y-800, x+800, y+800)
  14.                 set be = Condition(function AIItemFilter)
  15.                 set bj_lastRemovedItem=null
  16.                 call EnumItemsInRect(i, be, function AISetItem)
  17.                 if bj_lastRemovedItem != null and (GetItemType(bj_lastRemovedItem) == ITEM_TYPE_POWERUP or AIHasEmptyInventorySlot(h)) then
  18.                     call IssueTargetOrder(h, "smart", bj_lastRemovedItem)
  19.                 else
  20.                 endif
  21.                 call RemoveRect(i)
  22.                 call DestroyBoolExpr(be)

If the hero has items in all slots, or no items existed, order him/her/it to patrol to a random location in the map, to find new targets.

Code: jass  [Select]
  1.                 else
  2.                     set r = GetRandomLocInRect(bj_mapInitialPlayableArea)
  3.                     call IssuePointOrderLoc(h, "patrol", r)
  4.                     call RemoveLocation(r)

Now let’s check if the hero has any unused skill points (keep this separated from the attack/item pickup/patrol block).

If he/she/it has, call a function that learns a skill to the hero. In my example I’ve used a function that stores the number it has taught the hero an ability, to keep a special pattern in the ability learning:

Code: jass  [Select]
  1. function AILearnSkill takes unit h, string a returns nothing
  2.     local integer i = GetTableInt(a, "LearnSkillOrder")+1
  3.     if i == 1 or i == 4 or i == 8 then
  4.         call SelectHeroSkill(h, GetStoredInteger(udg_GameCache, UnitId2String(GetUnitTypeId(h)), "BaseSkill1"))
  5.     elseif i == 2 or i == 5 or i == 9 then
  6.         call SelectHeroSkill(h, GetStoredInteger(udg_GameCache, UnitId2String(GetUnitTypeId(h)), "BaseSkill2"))
  7.     elseif i == 3 or i == 7 or i == 10 then
  8.         call SelectHeroSkill(h, GetStoredInteger(udg_GameCache, UnitId2String(GetUnitTypeId(h)), "BaseSkill3"))
  9.     elseif i == 6 then
  10.         call SelectHeroSkill(h, GetStoredInteger(udg_GameCache, UnitId2String(GetUnitTypeId(h)), "UltimateSkill"))
  11.     endif
  12.     call SetTableInt(a, "LearnSkillOrder", i)
  13. endfunction
  14.  
  15.     if GetHeroSkillPoints(h) > 0 and l > 0 then
  16.         call AILearnSkill(h, a)
  17.     endif

Now simply make the timer expire again after 'e' seconds:

Code: jass  [Select]
  1.     call TimerStart(GetExpiredTimer(), e, true, function AILoop)

Last we need to set the local variables to null:

Code: jass  [Select]
  1.     set h = null
  2.     set i = null
  3.     set r = null
  4.     set g = null
  5.     set b = null
  6.     set f = null
  7.     set be = null

Final notes

This is the basics of it, it can be way better, but this should help you get started. Feel free to ask questions here or pm me.

It shouldn’t be complicated at all, but if you have just checked the tutorial it can be so. The map was made to give a better demonstration, so please check it.

When you have finished making your simple AI, try to add one or more of the following things to imrove it:

-   Try to make it find the weakest enemy close.
-   Try to make different AI players work together on killing a specific unit.
-   When most battles becomes centered about the fountain, make heroes run away from it when they’re fleeing.
-   Make the AI post text messages that varies depending on the situation (for example, an AI player can say “Die, sucker!” before killing you).

I hope this will help somebody!

Blade.dk

Pages: [1] 2
Blizzard Modding Information Center Starcraft II Modding Information Center Wacraft III Modding Information Center WC3JASS.com - The JASS Vault Chronicles of Darkness - A Warcraft III mod Jetcraft - A Starcraft II mod Troll Smash - A Warcraft III Arena
  Mod DB - Change the Game Power of Corruption - A Warcraft III altered melee map Chaos Realm - The world of Game modders and wc3 addicts Follow us on Facebook!!