Wanted to make a bubble sort and I've made it in Jass. I'm not sure if I've made it properly, but that beside the point for now.
This is my first attempt at using Jass so I have no idea how to call the Jass trigger from GUI! I get the error message "Expected a Function Name". How do I get the name of my function? I've tried:
call Test_Sort()
call TestSort()
call Test_Sort_Actions()
call InitTrig_Test_Sort()
No idea what I've named my function...? Lol.
The tutorial I'm following, http://www.hiveworkshop.com/forums/jass-ai-scripts-tutorials-280/jass-what-func-238298/, doesnt have all that init code after the comment.
This is my first attempt at using Jass so I have no idea how to call the Jass trigger from GUI! I get the error message "Expected a Function Name". How do I get the name of my function? I've tried:
call Test_Sort()
call TestSort()
call Test_Sort_Actions()
call InitTrig_Test_Sort()
No idea what I've named my function...? Lol.
JASS:
function Test_Sort_Actions takes nothing returns nothing
local boolean swap
local integer temp
local integer count = 0
loop
exitwhen swap == false
set swap = false
loop
exitwhen count == 4
if udg_sort[count] < udg_sort[count + 1] then
set temp = udg_sort[count]
set udg_sort[count] = udg_sort[count + 1]
set udg_sort[count + 1] = temp
set swap = true
endif
endloop
endloop
endfunction
//===========================================================================
function InitTrig_Test_Sort takes nothing returns nothing
local trigger Test_Sort = CreateTrigger()
set Test_Sort = CreateTrigger()
call TriggerAddAction( Test_Sort, function Test_Sort_Actions )
endfunction
The tutorial I'm following, http://www.hiveworkshop.com/forums/jass-ai-scripts-tutorials-280/jass-what-func-238298/, doesnt have all that init code after the comment.
-
Display Kills
-
Events
-
Player - Player 1 (Red) types a chat message containing -sort as An exact match
-
-
Conditions
-
Actions
-
Set sort[1] = 5
-
Set sort[2] = 6
-
Set sort[3] = 9
-
Set sort[4] = 4
-
Set sort[5] = 12
-
For each (Integer A) from 1 to 5, do (Actions)
-
Loop - Actions
-
Game - Display to (All players) for 3.00 seconds the text: (String(sort[(Integer A)]))
-
-
-
-------- --------- --------
-
-------- sort --------
-
-------- --------- --------
-
Custom script: call Test_Sort()
-
Wait 3.00 seconds
-
For each (Integer A) from 1 to 5, do (Actions)
-
Loop - Actions
-
Game - Display to (All players) for 3.00 seconds the text: (String(sort[(Integer A)]))
-
-
-
-