• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Video Tutorial Series for vJASS

Generally Good Resources To Have


Getting NewGen

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




Exploring WE

[youtube][/youtube]

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: http://www.hiveworkshop.com/forums/...ls-278/terrain-advanced-water-effects-210516/

Exploring the Object Editor


Creating a Trigger

[youtube][/youtube]

Trigger Actions

[youtube][/youtube]

The Variable Editor

[youtube][/youtube]

Trigger Conditions

[youtube][/youtube]

Trigger Events

[youtube][/youtube]



Converting a Trigger

[youtube][/youtube]

What is JASS? (with comments)

[youtube][/youtube]

Practice

Getting Used to the Teaching Pack

Teaching Pack 1
[youtube][/youtube]

JASS Variables

Teaching Pack 2
[youtube][/youtube]

Integers

Teaching Pack 3
[youtube][/youtube]

Actions

Integer Memory

Teaching Pack 5
[youtube][/youtube]

Reals

Teaching Pack 6
[youtube][/youtube]

Math

Teaching Pack 7
[youtube][/youtube]


Outdated





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 http://www.hiveworkshop.com/forums/jass-ai-scripts-tutorials-280/saving-loading-192851/












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













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
















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.









texttag limit is 100, not 255



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.



Missing Things
interfaces - useless
function interfaces - useless
delegates - useful, but limited
 

Attachments

  • Teaching Stuff.w3m
    13.7 KB · Views: 268
Last edited:
Level 23
Joined
Apr 16, 2012
Messages
4,041
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
 
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
 
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++.
 
Last edited:
Level 16
Joined
Aug 7, 2009
Messages
1,406
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).
 
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
 
Level 16
Joined
Aug 7, 2009
Messages
1,406
I also do cover stacks in the part 10 video. I added a little description to each video =P.

Yea, I've already watched the 10th one :) I skipped most of them as they contain nothing new for me, and though I'm familiar with stacks, I watched it as early in the morning, when my buddies are still in bed, it's relaxing to just sit down and watch a video about programming.

AFAIK queues are kinda similar to linked list, but since I don't really know much about them, I'm looking forward to that episode.

Oh, and as a little off-topic: I envy your typing speed :O
 
Level 3
Joined
May 5, 2007
Messages
21
i'm at video 3 atm, however i got to ask about vjass sub1:
Your editor clearly shows the jasstypes in the variable editor, but mine doesn't.
do i need to enable it if i want it the show the jasstype?

edit: scratch that, had forgoten to activate UME, however, i'm getting lots of errors at startup for example:
attachment.php
 

Attachments

  • error.png
    error.png
    25.3 KB · Views: 677
Level 23
Joined
Apr 16, 2012
Messages
4,041
the part 14 is quite short but good
You should mention that passing arguments to ExecuteFunc will crash the game and that we can only ExecuteFunc those functions which takes nothing
Also Not everyone uses conditions nowadays. I still use actions!! :D
 
Added the last tuts. Not sure how effective the trigger one is since it's been awhile since I've done them and I didn't quite remember what was covered and what wasn't ; D. Also, I didn't want to rewrite all the code that I did on my first attempt at the tut when my WE suddenly stopped working.


I'm going to be adding a 19th part for working with standard pointers, but I gotta get Malloc working perfectly first.
 
Level 23
Joined
Apr 16, 2012
Messages
4,041
Nice tutorials but in vid 15 you didnt say what TriggerEvaluate is so Im asking, what it does, why its there, what is its use? :D

Edit: in vJass18 at 5:10 you said we can only have 255 texttags which is false as you know :D
 
Last edited:
Overall, really good job. It is a nice approach to learning and I can tell a good amount of work was put into the videos and the structure itself.

Nah, I actually winged all of it, no kidding, seriously. However long the videos are = how long I spent on them (unless I had to redo them due to WE bugs or outside interference, which I did have to do a couple of times).

15+ (excluding special), don't know how good they are ; \, especially 15. I did them while I had crazy allergies, so I rushed through them as fast as I could and could barely think. Furthermore, in 15, it was a week after the previous, so I didn't quite remember what was covered and what wasn't covered. As I said, I winged them all. I didn't even bother to watch the previous videos when bringing the tut series back up, a testament to my laziness, heh.


Anyways... does this deserve a sticky so that it doesn't fall down? It does contain a ton of useful information ; ).
 
Level 23
Joined
Apr 16, 2012
Messages
4,041
would you do one about how hook works? or will you explain it here? Im very curious how Vexorian/Cohadar did the hooking to natives.

The Malloc tut was good but Ill have to watch it several more times to fully understand it :D
 
Level 14
Joined
Aug 8, 2010
Messages
1,022
DUDE! Nice job, Nestharus! I will definitely start learning Jass with this tutorials. I can say i know GUI pretty well, so it's Jass time. Well, not actually because i have to finish my map before i start. I am so impatient to start Jass!! Also, your voice is not disturbing. Most of the other video tutorials have a retarded person who cannot make a whole sentence.

Good job there! :ogre_haosis:
 
Why don't you just open my CustomInventory?
I am pretty sure except for inject and hooks I used pretty much everything :D

Edit:
Nes, I checked parts your tutorial, just because I was curious.
In part 6, where you were supposed to talk about differences
between libraries and scopes, you forgot to mention the most important part:
Libraries are meant for systems, scopes for spells.
Due to that fact scopes do not have any uses or requires keywords and are always placed at the bottom.
I was kind of surprised because you seem to be a good coder but this is really one of the basics.

I may check your other videos and give some quality feedback later.
 
Ok, I think that I'm going to redo all of these tutorials so that each one only covers one topic, each one is extremely short, and so that each one is thoroughly planned before hand ; ).

I'd also like to specifically upload a map with the project, step by step, so that people can easily work alongside the tutorial. I also want to do exercises within these attached map + possible projects.
 
@ Nestharus
You are really a nice person :grin: but do you have the time to do that ?

I'm only going to release 1 a week : ).

edit
here is an example of the awesomeness I am planning.

This is the interactive tutorial section of the variables lesson (partially complete). Just run the map.

Variables in code show nothing except for 0 syntax errors, so I think that an interactive tutorial is great with them as it shows you creating units and storing them in variables ^)^. The interactive tutorial really shows what variables are for.

edit
as of now, here are the planned lessons. I am still formatting it so that each lesson is as small as possible. Structs are a behemoth, so I'm definitely going to split that one up ; ).


lesson 1
- scalar variables
- array variables

lesson 2
- variable operators and initialization
- setting variables

lesson 3
- number systems (octal, hexadecimal, ascii)

lesson 4
- calling functions
- passing variables into functions
- setting variables to functions

lesson 5
- globals block

lesson 6
- boolean expressions

lesson 7
- if statements

lesson 8
- loops

lesson 9
-functions
-returning values

lesson 10
-scope
-local variables

lesson 11
-scopes
-function initializer

lesson 12
-libraries
-uses, requires
-order of initialization

lesson 13
-preprocessor directive
-textmacro

lesson 14
-indexed array

lesson 15
-stack

lesson 16
-queue

lesson 17
-instantiation

lesson 18
-structs
-methods
-static methods
-fields
-structs as types
-typecasting
-this
-thistype
-onInit
-method operator

lesson 19
-module
-onInit
-interesting module uses
-module implementation
-optional modules

lesson 20
-static if
-keyword
-key

lesson 21
-timer
-timerdialog

lesson 22
-unit groups

lesson 23
-working on triggers similar to GUI
-events
-conditions
-actions

lesson 24
-building triggers
-working with conditions
-working with actions
-working with events

lesson 25
-local code

lesson 26
-texttags

lesson 27
-threading
-TriggerSleepAction, TriggerSyncStart(), TriggerSyncReady()
-syncronous, asynchronous
-ExecuteFunc, TriggerExecute, TriggerEvaluate, ForceGroupEnum

lesson 28
-heap

lesson 29
-general memory allocation

lesson 30
-general structs

lesson 31
-general inheritance

lesson 32
-polymorphism
 

Attachments

  • Variables.w3m
    22.8 KB · Views: 97
Last edited:
Redid part 0 =)

Hopefully it'll be much easier for people to figure out how to download JASS NewGen and set it up now : o.

Split into multiple smaller videos now too. Hoping for a max of 4-5 minute video lessons now =).

edit
Slowly working on Part .5. Each video is a lot of work. Have to first plan what I'm going to cover, then need to record it, then need to watch through it while editing it for all of the cool zooms and so on, then need to render it, check for quality, up to youtube, check for quality, add to playlist.
 
Last edited:
Level 1
Joined
May 2, 2013
Messages
4
When I was trying the 4th tutorial video I get this error up to this video I didn't get any error everything was going well. Why did I get this error ? I could not understand where did I make mistake. I guess I did exactly as you did. Can you please help me!

 
Top