• 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.

jass errors ??

Status
Not open for further replies.
Level 2
Joined
Dec 5, 2011
Messages
13
When open and save map have Jass, i meet errors.


http://www.upanh.com/jassloi_upanh/v/cnb02q6k7jx.htm
cnb02q6k7jx.htm
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,258
This is because StarCraft II uses the galaxy scripting lanuage. JASS and Galaxy are completly different lanuages synaticly so are incompatible with each other. Anything made for WarCraft III is not compatible with StarCraft II.

Moved to World Editor Help Zone as this is a WarCraft III question not a StarCraft II question.

You make reference to a "CustomPolledWait" fuction in your JASS script. This function must not have been declared or is declared after you reference it. Remember that you can only call functions that are located above the position of calling within the script file.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,258
You make reference to a "CustomPolledWait" fuction in your JASS script. This function must not have been declared or is declared after you reference it. Remember that you can only call functions that are located above the position of calling within the script file.
This is the problem. In the map script, the CustomPolledWait function must be declared above all references to it.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,258
Your friend must have the "CustomPolledWait" function declared above where he is referencing it in his script. "CustomPolledWait" definatly is not declared by native and standard blizzard scripts so you will need to declare it.

Check the map header of the map (the root of the trigger file structure) for this function if you are importing a ready made system.
 
1. Ask your friend for his map.

2. Open his map.

3. Open the trigger editor.

4. Look on the left side.

5. Click the map's name. (above all the triggers)

6. Look on the right side and you should see some text. Look for a function named CustomPolledWait

If you don't see it in the header, then you can try looking in his other triggers. You can also open the map with an MPQ editor, and export the .j file. Then you can open it with notepad and just use CTRL+F (finder) to find the CustomPolledWait function.

7. Copy that function and paste it into your own header.

Then you should be good to go.

Alternatively, you can just use this old function by vexorian:
JASS:
function CustomPolledWait takes real duration returns nothing
 local real timeRemaining
 local real st=TimerGetElapsed( bj_gameStartedTimer)
    if st <= 0 then
        set bj_gameStartedTimer = CreateTimer()
        call TimerStart(bj_gameStartedTimer, 1000000, false, null)
    endif
    if (duration > 0) then
        loop
            set timeRemaining = duration - TimerGetElapsed( bj_gameStartedTimer) + st
            exitwhen timeRemaining <= 0
            if (timeRemaining > bj_POLLED_WAIT_SKIP_THRESHOLD) then
                call TriggerSleepAction(0.1 * timeRemaining)
            else
                call TriggerSleepAction(bj_POLLED_WAIT_INTERVAL)
            endif
        endloop
    endif
endfunction

You can just put that in your map's header.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,258
The trigger BichHuyet has a syntax error.
private constant real array MAX_X_DAMAGE
It is impossible to have a constant array due to how the language opperates.

Replace it with this line to fix (remove constant).
private real array MAX_X_DAMAGE
Please report this to the maker of the ability as this is a major error.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,258
u can download and test save map.
What on earth do you think I have done? Ofcourse I did that...

i think not errow in map.
Well you thought wrong... It is impossible to have a constant array in JASS thus why it is generating a syntax error. Where as saving generated syntax errors with the version I downloaded, once I corrected the line detailed above all syntax errors vanished and the map saved perfectly (no errors). The reason is because JASS does not allow you to initialize arrays to a value. Constants require being initialized to a value (when they are declared they must be given a value) so it is impossible to declare a constant array in JASS.

if i want use jass, what i must install ?
WarCraft III RoC and its expansion TFT. The map however uses VJASS so you will want to use the third party editor expansion JNGP (Jass New Generation Pack).
 
Status
Not open for further replies.
Top