[Log in / Register]
| News | Chat | Pastebin | Donations | Tutorials | Rules | Forums |
| Maps | Skins | Icons | Models | Spells | Tools | Jass | Packs | Hosted Projects | Starcraft II Modding | Starcraft II Resources | Galaxy Wiki |
(Keeps Hive Alive)
Go Back   The Hive Workshop > Warcraft III Modding > WarCraft III Tutorials > JASS/AI Scripts Tutorials


JASS/AI Scripts Tutorials Contains tutorials regarding JASS scripting and the AI editor.
Read the Rules before posting.

Reply
 
Thread Tools
Old 08-09-2012, 10:29 AM   #1 (permalink)
Registered User Nestharus
User
 
Nestharus's Avatar
 
Join Date: Jul 2007
Posts: 4,910
Nestharus has disabled reputation
Video Tutorial Series for vJASS

Generally Good Resources To Have
Part 0: Setting up NewGen

Getting NewGen

Jass Newgen Pack 2.0 Alpha - Recruiting for testing
YouTube Movie
Common Errors

File Exist Error:

Not Windows 8: start, run, %temp%, delete everything
Windows 8: Right click dashboard area in bottom left corner, click on run, type %temp%, delete everything
Setting Up NewGen

YouTube Movie


Part 0.5: Intro to WE

Exploring WE


Create a map with deep water and then go to the Terrain Editor and click on Apply Height. From there, click on the Raise tool and apply it to the map until the ground goes above the water level. This is used to get more natural water. Alternatively, cliffs can be used, but those look horrible.

More water techniques: [Terrain] Advanced Water Effects
Exploring the Object Editor

YouTube Movie
Creating a Trigger

Trigger Actions

The Variable Editor

Trigger Conditions

Trigger Events



Part 1: GUI to vJASS

Converting a Trigger

What is JASS? (with comments)


Practice
Getting Used to the Teaching Pack

Teaching Pack 1
JASS Variables

Teaching Pack 2
Integers

Teaching Pack 3
Actions

Teaching Pack 4

Number Systems
http://numbermonk.com/decimal/14239
http://elenzil.com/esoterica/baseConversion.html
http://wims.unice.fr/wims/en_tool~nu...seconv.en.html

Quick Rules

Integer Memory

Teaching Pack 5
Reals

Teaching Pack 6
Math

Teaching Pack 7


Outdated

Part 1: Variables


Part 2: Calling functions, special integers (hex, ascii, octal? (not sure if I hit octal)), unit type ids

If I didn't hit octal, octal integers start with 0 instead of 0x -> 0123
Octal: 01234567
Hexadecimal: 0123456789ABCDEF
For more information on number systems, please see Saving and Loading
YouTube Movie


Part 3: Setting variables, math expressions, string expressions, passing variables into functions, setting variables to functions


Part 4: creating functions, introduction to scope, local variables, returning values


Part 5: globals block, if statements, boolean expressions, loops, exitwhen


Part 6: scopes, public, private, initializers, libraries, uses/requires (library ordering)

I say nested functions at one point for initializers, but I meant to say nested scopes.
YouTube Movie


Part 7: intro to structs: fields, methods, static, onInit, this, thistype, create, destroy, structs as types, typecasting


Part 8: textmacro, module, preprocessor directive, module onInit, interesting module uses, module implementation


Part 9: optional modules, more interesting uses for modules, timer, timerdialog


Part 10: stacks, allocation/deallocation

Alloc from video

I made a slight mistake in the video for deallocating.

Notice the == -1. When a struct is allocated, it's set to -1, so this would always end up throwing an error.
debug if (recycler[this] == -1 or this == 0) then

It should be != -1
debug if (recycler[this] != -1 or this == 0) then

When it is deallocated or wasn't allocated before, it's going to have a value that isn't -1. The only instances with a value of -1 are allocated instances.

The fixed code is found below (using DisplayTimedText instead of Print so that it is ready for use).
Jass:
    module Alloc
        private static integer array recycler
        private static integer instanceCount = 0
        debug private static boolean enabled = true
       
        static method allocate takes nothing returns thistype
            local thistype this = recycler[0]
           
            debug if (not enabled) then
                debug return 1/0
            debug endif
           
            if (this == 0) then
                debug if (instanceCount == 8191) then
                    debug call DisplayTimedTextToPlayer(GetLocalPlayer(),0,0,60,"OVERFLOW")
                    debug set enabled = false
                    debug set this = 1/0
                debug endif
           
                set this = instanceCount + 1
                set instanceCount = this
            else
                set recycler[0] = recycler[this]
            endif
           
            debug set recycler[this] = -1
           
            return this
        endmethod
       
        method deallocate takes nothing returns nothing
            debug if (not enabled) then
                debug set this = 1/0
            debug endif
           
            debug if (recycler[this] != -1 or this == 0) then
                debug call DisplayTimedTextToPlayer(GetLocalPlayer(),0,0,60,"ATTEMPT TO DEALLOCATE NULL STRUCT INSTANCE")
                debug set this = 1/0
                debug set enabled = false
            debug endif
           
            set recycler[this] = recycler[0]
            set recycler[0] = this
        endmethod
    endmodule

YouTube Movie


Part 11: collection modules, queues, dequeues, and linked lists


Part 12: unit groups


Part 13: intro to triggers


Part 14: execute func, threading, trigger sleep action


Part 15

triggers, boolexpr, force group enum for evaluation

There are some things I didn't make clear in this video due to the state I was in while making it. Watch the video before reading these points.
#1: TriggerEvaluate runs all conditions on a trigger. Conditions are boolean expressions (Condition native) that wrap up functions. They are stored in a trigger as triggercondition.
#2: TriggerExecute runs all actions on a trigger. Actions are just functions. They are stored in a trigger as triggeraction.
#3: The op limit is the thing that determines how much code you can run before a thread crashes. If you run too much code, your thread will crash.
#4: Triggers start their own threads, meaning that they get their own internal op limits. They are useful for avoiding op limit.
#5: Trigger actions are synchronous, meaning that they stay sync'd for all players in the game. This means that they can use TriggerSleepAction. They are also slower due to this.
#6: Trigger evaluations are also useful for dynamic code. You can't run a function dynamically unless you use ExecuteFunc, TriggerExecute, TriggerEvaluate, or ForceGroupEnum.
#7: In terms of speed, TriggerEvaluate > ForceGroupEnum (only slightly slower) > TriggerExecute > ExecuteFunc.
#8: Use ForceGroupEnum for evaluating single functions. Use TriggerEvaluate for evaluating multiple.
YouTube Movie


Part 16: method operators


Part 17: static ifs, keywords, keys


Part 18: local code

texttag limit is 100, not 255
YouTube Movie


Special: memory

This last video takes everything you learned and delves deep into how memory is actually managed in JASS, Galaxy, and languages like c++. You will learn how identifiers work, how structs/classes really work, and you will even learn how to move from vjass to c++ and code a Linked List without relying on arrays. I really recommend this video.
YouTube Movie



Missing Things
interfaces - useless
function interfaces - useless
delegates - useful, but limited
Attached Files
File Type: w3m Teaching Stuff.w3m (13.7 KB, 107 views)

Last edited by Nestharus; 04-28-2013 at 04:34 AM.
Nestharus is online now   Reply With Quote
Old 08-09-2012, 12:46 PM   #2 (permalink)
Administrator Pharaoh_
It's pixel WarCraft!
 
Pharaoh_'s Avatar
Administrator
 
Join Date: Nov 2008
Posts: 7,678
Pharaoh_ has been here far too long (2882)Pharaoh_ has been here far too long (2882)Pharaoh_ has been here far too long (2882)Pharaoh_ has been here far too long (2882)Pharaoh_ has been here far too long (2882)Pharaoh_ has been here far too long (2882)
Merit Badge - Level 0: This user has proven to be extremely valuable to the Warcraft III Modding Community. User of the Year: 2011 Short Story Contest #6 - Winner: When Death Reflects Life Voice Acting Contest #2 - Winner: Dark Angel 
I see this as an improvement to our tutorials section. Well done, keep up!
__________________
Pharaoh_ is offline   Reply With Quote
Old 08-09-2012, 07:56 PM   #3 (permalink)
Registered User Chaosy
Mr. GUI
 
Chaosy's Avatar
 
Join Date: Jun 2011
Posts: 1,761
Chaosy is just really nice (389)Chaosy is just really nice (389)Chaosy is just really nice (389)Chaosy is just really nice (389)
PayPal Donor: This user has donated to The Hive. 
I will watch this now, wanna know about vjass
Chaosy is offline   Reply With Quote
Old 08-09-2012, 08:50 PM   #4 (permalink)
Registered User edo494
User
 
edo494's Avatar
 
Join Date: Apr 2012
Posts: 978
edo494 is a jewel in the rough (203)edo494 is a jewel in the rough (203)
0:56:27 "Im tired right now its 2:30 in the morning" but you still type twice fast as I do :D
also the sound gets a little off the video I think(your typing noises are around 3-4 seconds before its "typed" on the video at that point).
You could name the video somehow normally you know :D, 20120809 0123 54 doesnt really looks like its going to do something with jass except the tag vjass :D
__________________
my resources
GetLastCastAbility, Reputation System(Awaiting approval), GetKiller(Awaiting approval), Spell Steal
[22-00-51] Geries: edo494, no
[22-00-57] Geries: edo494, but I'm gay
edo494 is online now   Reply With Quote
Old 08-09-2012, 09:17 PM   #5 (permalink)
Forum Moderator Magtheridon96
JESUS MAN
 
Magtheridon96's Avatar
Resource Moderator
 
Join Date: Dec 2008
Posts: 5,700
Magtheridon96 has a brilliant future (1809)
Merit Badge - Level 0: This user has proven to be extremely valuable to the Warcraft III Modding Community. 
I was going to make a vJASS tutorial :P
It's good that you made one ^_^
__________________
Magtheridon96 is offline   Reply With Quote
Old 08-09-2012, 10:18 PM   #6 (permalink)
Registered User Nestharus
User
 
Nestharus's Avatar
 
Join Date: Jul 2007
Posts: 4,910
Nestharus has disabled reputation
Quote:
Originally Posted by edo494 View Post
0:56:27 "Im tired right now its 2:30 in the morning" but you still type twice fast as I do :D
also the sound gets a little off the video I think(your typing noises are around 3-4 seconds before its "typed" on the video at that point).
You could name the video somehow normally you know :D, 20120809 0123 54 doesnt really looks like its going to do something with jass except the tag vjass :D
Actually, the sound is 3-4 seconds off through the whole video. The video is also 700 megs, and I'm not uploading it again just to fix the filename ;p. Also, I don't know how to fix the sound, I used a program to record my screen or w/e.

edit
wow, it really does get more and more off =o
__________________

Anime-Planet.com - anime | manga | reviews
Nestharus is online now   Reply With Quote
Old 08-09-2012, 11:27 PM   #7 (permalink)
Forum Moderator PurgeandFire
ʕ•͡ᴥ•ʔ
 
PurgeandFire's Avatar
Resource & Tutorial Moderator
 
Join Date: Nov 2006
Posts: 3,544
PurgeandFire has much of which to be proud (1098)PurgeandFire has much of which to be proud (1098)PurgeandFire has much of which to be proud (1098)PurgeandFire has much of which to be proud (1098)PurgeandFire has much of which to be proud (1098)
I didn't know anyone pronounced GUI as "gooey". xD

On a more serious note, I'll check out the rest and review it later. I just felt like posting that since it made me laugh.
PurgeandFire is offline   Reply With Quote
Old 08-09-2012, 11:42 PM   #8 (permalink)
Registered User Nestharus
User
 
Nestharus's Avatar
 
Join Date: Jul 2007
Posts: 4,910
Nestharus has disabled reputation
Quote:
Originally Posted by PurgeandFire111 View Post
I didn't know anyone pronounced GUI as "gooey". xD

On a more serious note, I'll check out the rest and review it later. I just felt like posting that since it made me laugh.
http://forum.wordreference.com/showthread.php?t=208003

edit
I'm working on a c++ tutorial too ^_^

Here is the intro code using definitions
Code:
Function(hello)
End

OnInit
	display("Hello World");
End
;D
__________________

Anime-Planet.com - anime | manga | reviews
Nestharus is online now   Reply With Quote
Old 08-10-2012, 12:25 AM   #9 (permalink)
Registered User mckill2009
SSJ99999 Pinoy!
 
mckill2009's Avatar
 
Join Date: Mar 2009
Posts: 4,380
mckill2009 is a splendid one to behold (847)mckill2009 is a splendid one to behold (847)mckill2009 is a splendid one to behold (847)mckill2009 is a splendid one to behold (847)mckill2009 is a splendid one to behold (847)
it would be more awesome if you zoom in when you write something...
__________________
My Resources:
My Maps
My Systems/Spells

Your ideas tend to result in unnecessary violence so shut the F*** up!
mckill2009 is offline   Reply With Quote
Old 08-10-2012, 06:01 AM   #10 (permalink)
Registered User Nestharus
User
 
Nestharus's Avatar
 
Join Date: Jul 2007
Posts: 4,910
Nestharus has disabled reputation
Ok, redid. Let me know what you think all.

The videos now have zooming, are much smaller, and have good quality ; ).


Parts 1-6 cover: variables, functions, scopes, libraries, initializers, lib requirements

Done Parts 7-8: structs
Done Part 9: timers
Part 10: triggers, boolexpr, and force group enum for evaluations
Part 11: unit groups and group enum
Part 12: execute func, threading, trigger sleep action
Part 13: local code, data synchronization
Done Part 14: stacks (arrays, linked)
Done Part 15: allocation and deallocation
Done Part 16: queues, dequeues, and linked lists

static ifs

Other data structures like binary search trees, avl trees, red-black trees, and so on can just be googled as you will have enough coding experience to understand them without a special tutorial ^_^.

If you look, there are no special tutorials on making things MUI or on memory leaks as they aren't needed.


My goal is to move GUIers to vjass and then move them to c++ and into regular game dev with game engines =).

Don't believe it's possible to get them into c++? Think again.
Code:
#include "Core.h"

prototype(nothing, firstFunction, nothing)

onInit
	call display("Hello World");

	local integer i = 5;

	call display(i);

	call firstFunction();
end

function(nothing, firstFunction, nothing)
	local integer i = 5;

	display("This is my first function ^^");

	if (i == 5) then
		display(i);
	endif

	loop
		exitwhen(true)
	endloop
endfunction
The above is c++ using definitions to transition people from vjass to c++.
__________________

Anime-Planet.com - anime | manga | reviews

Last edited by Nestharus; 08-11-2012 at 10:34 PM.
Nestharus is online now   Reply With Quote
Old 08-10-2012, 02:08 PM   #11 (permalink)
Registered User mckill2009
SSJ99999 Pinoy!
 
mckill2009's Avatar
 
Join Date: Mar 2009
Posts: 4,380
mckill2009 is a splendid one to behold (847)mckill2009 is a splendid one to behold (847)mckill2009 is a splendid one to behold (847)mckill2009 is a splendid one to behold (847)mckill2009 is a splendid one to behold (847)
your effort in doing this deserves more than +rep!

EDIT:
and your voice sounds sexy haha!
__________________
My Resources:
My Maps
My Systems/Spells

Your ideas tend to result in unnecessary violence so shut the F*** up!
mckill2009 is offline   Reply With Quote
Old 08-11-2012, 08:16 AM   #12 (permalink)
Registered User Nestharus
User
 
Nestharus's Avatar
 
Join Date: Jul 2007
Posts: 4,910
Nestharus has disabled reputation
Added many new sections to this tutorial

Check in every day, I'm trying to add between 1 and 6 sections a day until the tutorial is done =).
__________________

Anime-Planet.com - anime | manga | reviews
Nestharus is online now   Reply With Quote
Old 08-11-2012, 09:54 AM   #13 (permalink)
Registered User Luorax
Invasion in Duskwood
 
Luorax's Avatar
 
Join Date: Aug 2009
Posts: 1,114
Luorax is just really nice (375)Luorax is just really nice (375)Luorax is just really nice (375)Luorax is just really nice (375)
Part 16 looks interesting, I've always been lazy to read more about queues, stacks and linked lists are usually enough for my needs, and either way, school is starting in a few weeks, I'll lore about them soon or later :)

Good job anyways, would've definitely helped a lot if these had been available when I started learning vJASS, learning only from other resources is quite slow (but at least efficient).
__________________
Luorax is offline   Reply With Quote
Old 08-11-2012, 10:33 AM   #14 (permalink)
Registered User Nestharus
User
 
Nestharus's Avatar
 
Join Date: Jul 2007
Posts: 4,910
Nestharus has disabled reputation
I'm likely going over part 16 next so as to better cover the back structure of triggers and unit groups ;D.

I also do cover stacks in the part 10 video. I added a little description to each video =P.

For each tutorial, I really do spend a lot of time to explain and demonstrate the content extremely well ;o. The first tutorial is all about declaring variables, and it's 9.5 minutes long, lol. In part 10, I really dive into stacks as well as how struct allocation and deallocation works (as it is a great stack example). I also show vjass generated code and compare it to the code I write in the tutorial.


The latest outline is (for remaining stuff)

Part 11. queues, dequeues, linked lists
Part 12. unit groups
Part 13. triggers, boolexpr, force group enum for evaluation
Part 14. execute func, threading, trigger sleep action
Part 15. local code, data synchronization
__________________

Anime-Planet.com - anime | manga | reviews
Nestharus is online now   Reply With Quote
Old 08-11-2012, 10:39 AM   #15 (permalink)
Registered User edo494
User
 
edo494's Avatar
 
Join Date: Apr 2012
Posts: 978
edo494 is a jewel in the rough (203)edo494 is a jewel in the rough (203)
Its betrer then the one hella-long video and covers almost evertthing, but would you like to do one about static ifs as well? :D
I have no clue what they are except that they can be outside of functions :/
__________________
my resources
GetLastCastAbility, Reputation System(Awaiting approval), GetKiller(Awaiting approval), Spell Steal
[22-00-51] Geries: edo494, no
[22-00-57] Geries: edo494, but I'm gay
edo494 is online now   Reply With Quote
Reply

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


All times are GMT. The time now is 06:05 PM.





Powered by vBulletin
Copyright 2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.5.1 PL2
Copyright © Ralle