wurstscript / wurst4vscode

Wurst extension for Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=peterzeller.wurst
Apache License 2.0
24 stars 2 forks source link

ExecuteFunc problem in Legacy Map war3map.j #32

Closed yatyricky closed 6 years ago

yatyricky commented 6 years ago

Generated war3map.j through

.\clijasshelper.exe ..\temp\common.j ..\temp\blizzard.j "path\to\my\map.w3x"

raises syntax error

[Wurst] Wurst does only support ExecuteFunc with a single string as argument.

at

function Command___execfuncs takes string str returns nothing
    call ExecuteFunc(SubString(str, 5, StringLength(str)))
endfunction

Environment

What did I do

  1. Install wurst by WurstSetup.jar
  2. Create Project
  3. Open from VS Code
  4. Install extension
  5. Build MyWurstProject: success 👍
  6. Run ExampleMap.w3x: success 👍
  7. Extract war3map.j from my vJass map
  8. Replace MyWurstProject\wurst\war3map.j with generated jass
  9. Add -noExtractMapScript in wurst_run.args
  10. Replace mod/step/print with mod_nowurst and step_nowurst and print_nowurst because they are keywords
  11. Syntax error on ExecuteFunc 👎

tim20180402103449

The porject

https://www.dropbox.com/s/zetu2m21lbj2o5z/MyWurstProject.zip?dl=0

Frotty commented 6 years ago

That's not a problem, it's a limitation. Wurst simply doesn't allow using non-constant strings in ExecuteFunc because names aren't stable. Same goes for TRVE. So you need to implement that functionality otherwise.

If you explain why you need to call functions with some sort of substring calculation we can probably work out an alternative.

Thanks for the detailed report though. 🍺