- Joined
- Jul 10, 2007
- Messages
- 6,306
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)
Getting Used to the Teaching Pack
JASS Variables
Integers
Actions
Teaching Pack 4
[youtube][/youtube]
Number Systems
http://numbermonk.com/decimal/14239
http://elenzil.com/esoterica/baseConversion.html
http://wims.unice.fr/wims/en_tool~number~baseconv.en.html
Quick Rules
Integer Memory
Reals
Math
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.
It should be != -1
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).
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
- http://www.hiveworkshop.com/forums/submissions-414/std-collections-collections-221515/
- http://www.hiveworkshop.com/forums/submissions-414/alloc-alternative-221493/
- http://www.hiveworkshop.com/forums/jass-resources-412/snippet-new-table-188084/
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)
Getting Used to the Teaching Pack
JASS Variables
Integers
Actions
Teaching Pack 4
[youtube][/youtube]
Number Systems
http://numbermonk.com/decimal/14239
http://elenzil.com/esoterica/baseConversion.html
http://wims.unice.fr/wims/en_tool~number~baseconv.en.html
Quick Rules
Integer Memory
Reals
Math
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
Last edited: