World Editor stuck at validating script

DaFatalGigabyte

New Member
Reaction score
0
I tried saving a map with a custom test script:

Code:
function funcTest takes real paramInput returns string
endfunction

and it locks up when generating the map script.

Has anyone had this problem before? How do you fix it?
 

PurgeandFire

zxcvmkgdfg
Reaction score
509
You said "returns string" but you don't have an actual return. So you should add a line to return a string:
JASS:
function funcTest takes real paramInput returns string
    return ""
endfunction


You might want to look into JASS NewGen Pack, iirc the pjass parser won't lock up when checking that. I'm not positive though.
 

DaFatalGigabyte

New Member
Reaction score
0
Thanks for the help. I installed NewGen and pJass to see if it would help. After turning off CampaignBuilder which apparently doesn't work (or needs some more ingredients I don't know about to function), I can save a map, and it doesn't lock up at script validation I think. But now, it won't save because of line 7118. Line 7118 is empty. When I double click on the error, it highlights "else" in:
Code:
function GetFadeFromSeconds takes real seconds returns integer
 
    if (seconds != 0) then
 
        return 128 / seconds
 
    else
 
        return 10000
 
    endif
 
endfunction

Error: "Cannot convert returned value from real to integer."
 

Imp Midna

Active Member
Reaction score
52
World Editor tends to mark the wrong lines. Also, Jass somehow isn't always capable of doing implicit casts from float to integers. You divided an integer (128) by a real (seconds), the result seems to be a real while your functions wants to return an integer. You have to manually cast it to an Integer using R2I() to make it work.
 

DaFatalGigabyte

New Member
Reaction score
0
Thanks, but it's Blizzard's script that pJASS says has an error, not mine.

This is the custom script converted from a GUI trigger that sets an integer to 5/10. pJASS didn't say there was an error.

Code:
function Trig_Untitled_Trigger_001_Actions takes nothing returns nothing
    set udg_i = ( 5 / 10 )
endfunction
 
//===========================================================================
function InitTrig_Untitled_Trigger_001 takes nothing returns nothing
    set gg_trg_Untitled_Trigger_001 = CreateTrigger(  )
    call TriggerAddAction( gg_trg_Untitled_Trigger_001, function Trig_Untitled_Trigger_001_Actions )
endfunction

pJASS said udg_i and gg_trg_Untitled_Trigger_001 didn't exist. Anyway, I fixed my function :oops: so there's nothing wrong :D . Thanks for the help!
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top