Ruk33 / vrJASS

A just-for-fun programming language which compiles down to JASS (Warcraft 3). It aims to improve and replace the beloved vJASS.
6 stars 3 forks source link

call a function that doesn't exist #29

Closed MasterHK closed 8 years ago

MasterHK commented 8 years ago

When compiling the script, any trigger that doesn't have a InitTrig_TrgName function cause errors and prevent map from start!

I've used MPQEditors to see what code looks like after compling by JassHelpers. Vexorian's has generated: //Function not found: call InitTrig_natives()

But your one's has generated: call InitTrig_natives( )

For instance you can download this map Try "SharpCraft - Natives.w3x" file. and you just need to open the map in editor and save it while vrJASS is activated; the map doesn't seem to be work after that.

Ruk33 commented 8 years ago

Hi MasterHK, I'm gonna be checking, thanks for reporting.

Ruk33 commented 8 years ago

Hi MasterHK, I've tried the map with only the 'natives' trigger enabled and it worked.

Are you using the last version of vrJASS?, what triggers do you have enabled?, what version of JNGP are you using?, did it generated/opened any log file?

MasterHK commented 8 years ago

Are you using the last version of vrJASS?

Yes, v1.9

what triggers do you have enabled?

No more, I'd just press the "Save button"

what version of JNGP are you using?

v2.0.9, from the main thread.

did it generated/opened any log file?

No. This is my actual Problem!

However, this is my wehack.lua if you want to take a look...

Ruk33 commented 8 years ago

Ok, checking. Meanwhile, could you please paste here the generated code (war3map.j).

MasterHK commented 8 years ago

sure, here.

Ruk33 commented 8 years ago

MasterHK I tried with your wehack.lua but it gives many errors when saving the map. Please try with a clean installation of JNGP (it worked for me).

The result of the compiler is:

132:40 Syntax error no viable alternative at input 'nativeHttpRequesttakesstringmethod'

native StringPos       takes string str, string sub returns integer
native StringReverse   takes string str returns string
native StringTrim      takes string str returns string
native StringTrimStart takes string str returns string
native StringTrimEnd   takes string str returns string
native StringSplit     takes string str, string sub, integer index returns string
native StringInsert    takes string str, integer index, string val returns string

// HTTP
native HttpRequest         takes string method, string url, string cookies, string values returns string
----------------------------------------^
native HttpLastCookie      takes nothing returns string
native HttpPendingResponse takes integer id returns string
native StartRequest        takes string method, string url, string cookies, string values, integer id returns nothing

// Thread
//native NewThread takes code func returns nothing//===========================================================================
function InitCustomTriggers takes nothing returns nothing
    call InitTrig_natives(  )
endfunction

(method is a keyword)

MasterHK commented 8 years ago

But InitTrig_natives() is an undefined method!

I tried with your wehack.lua but it gives many errors when saving the map.

This is a big problem because I don't get any error...

However I want to check something about that and I will post the result here.

Ruk33 commented 8 years ago

Don't worry about it. The compiler takes care and will remove it if necessary ^^

MasterHK commented 8 years ago

I promise we won't be able to find out how it can be done!

2016_9_18_20_41_43

2016_9_18_20_45_10

check these map files please.

Ruk33 commented 8 years ago

Ok, remember that I'm only testing the 'natives' trigger (since the other have features that are yet not supported by vrJASS, for example readonly)

image

image

Are you sure that vrJASS is actually running?. To try it, please disable all triggers, create a new one and paste this:

library Test
    function onInit
        call BJDebugMsg(1)
    end
end

It should throw you an error (or at least create a log file):

105:13 Element <msg> must have/return a value of type <string> but given <integer>
MasterHK commented 8 years ago

Saved without any error throw!

Give me your wehack.lua please.

Ruk33 commented 8 years ago

It is the one that the JNGP came with: wehack.zip

MasterHK commented 8 years ago

Could you please explain this for me? blizzmod\\MTT.exe --vrjass=

( and I have to say map saved without error when compiling again... :/ )

Ruk33 commented 8 years ago

I was also looking at that, but its something from moyack so I couldn't tell :.

MasterHK commented 8 years ago

I mean, is it correct?

MasterHK commented 8 years ago

Now I want to ask you... :)

what version of JNGP are you using?

Ruk33 commented 8 years ago

I mean, is it correct?

I got the same thing (and its working) so yes ^^

what version of JNGP are you using?

Same as you, v2.0.9 from the main thread.

MasterHK commented 8 years ago

what version of JNGP are you using? Same as you, v2.0.9 from the main thread.

Are you sure? :|

grim.exists("jasshelper\\ruke\\vrjassc-jar-with-dependencies.jar")

Ruk33 commented 8 years ago

Yep, I just downloaded and tested everything with that version (I also got that line on my wehack.lua).

MasterHK commented 8 years ago

I have downloaded this version: jngp_209.7z 5.94 MB (6,234,622 bytes)

and this is my archive content: jngp_209

After rename the jass helper folder and move vrjassc... to jasshelper\ruke directory from vrJASS directory JassHelper appeared but still I have this error when I press the Save button err

It's pretty clear that blizzmod\MTT doesn't meet vrjass yet and so he doesn't like him...

Nevermind, Link me to your JNGP please... :)

Ruk33 commented 8 years ago

Apparently moyack already included vrJASS in this version so you don't have to do anything (just unzip and you're ready to go).

MasterHK commented 8 years ago

Now When I save map and vrJASS activated, this is what I get:

safe

Can I use this command instead? toolresult = wehack.runprocess2("java -jar vrjass/vrjassc-jar-with-dependencies.jar \"" .. mappath .. "\" -log=vrjass.txt -result=\"" .. mappath .. "\"")

Ruk33 commented 8 years ago

Excellent, I have a similar error, did the log file showed up?

And yes, you can change the command but use this instead: wehack.runprocess2("java -jar jasshelper/ruke/vrjassc-jar-with-dependencies.jar jasshelper/ruke/common.j jasshelper/ruke/Blizzard.j \"" .. mappath .. "\" -log=vrjass.txt -result=\"" .. mappath .. "\"")

MasterHK commented 8 years ago

did the log file showed up?

Not Yet... :/

Good News! with java -jar jasshelper/ruke/vrjassc-jar-with-dependencies.jar... command everything seems to be fine now :) vrjass got accepted -log with the open hugs! and shows me my compile errors (opens vrjass.txt in notepad as you had expected).

I'm gonna be checking them and testing map and answer here soon, But I guess it must be fixed at the meantime...

Thanks for all of your help...

Ruk33 commented 8 years ago

Great!

You're welcome ^^, let me know if anything else happens.