1. Updated Resource Submission Rules: All model & skin resource submissions must now include an in-game screenshot. This is to help speed up the moderation process and to show how the model and/or texture looks like from the in-game camera.
    Dismiss Notice
  2. DID YOU KNOW - That you can unlock new rank icons by posting on the forums or winning contests? Click here to customize your rank or read our User Rank Policy to see a list of ranks that you can unlock. Have you won a contest and still haven't received your rank award? Then please contact the administration.
    Dismiss Notice
  3. The reforging of the races is complete. Come see the 14th Techtree Contest Results.
    Dismiss Notice
  4. It's time to choose your horse in the race - the 32nd Modeling Contest Poll is up!
    Dismiss Notice
  5. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

Jasshelper 2011-12-19

Discussion in 'Warcraft Editing Tools' started by cohadar, Dec 19, 2011.

  1. Troll-Brain

    Troll-Brain

    Joined:
    Apr 27, 2008
    Messages:
    2,372
    Resources:
    1
    JASS:
    1
    Resources:
    1
    Are you sure you don't want some GUI adepts crying about that "your" jasshelper disable all trigger stuff ?

    Seriously, i don't see something wrong with calling InitGlobals before vJass initializers, if it is through an ExecuteFunc, or whatever else which creates a new thread.
    I mean even if InitGlobals reach the limit op, the main function won't be broken, and you will be able to use GUI variables in vJass initializers, which is not really possible for now.

    For the silent crash of InitGlobals, instead of ExecuteFunc you can TriggerEvaluate it and get the returned boolean, to display a warning error in game, in debug mode.
    Or still use ExecuteFunc but with a global boolean at the end.
    (you set it to false in the global definition, and true in the last line of InitGlobals.
    After the InitGlobals call, if the variable is true then InitGlobals didn't crash, else it did and the variable is equal to false)
    Or implement a built-in limit op checker :p (joke ofc)

    Now, if i'm missing something, in case that InitGlobals can still crash the whole main function, that is not the same thing.
     
    Last edited: Feb 7, 2012
  2. Nestharus

    Nestharus

    Joined:
    Jul 10, 2007
    Messages:
    6,146
    Resources:
    8
    Spells:
    3
    Tutorials:
    4
    JASS:
    1
    Resources:
    8
    So, are you making it throw errors stating that the variables do not exist right now?

    edit
    also, it'd be neato if you looked at the init stuff generated by GUI and removed the stupid things, like all array initializations ;D.
     
  3. cohadar

    cohadar

    Joined:
    Jun 16, 2007
    Messages:
    234
    Resources:
    0
    Resources:
    0
    I assume that GUI users know about global array initialization problems or their maps would crash all the time with or without jasshelper.

    As for jass people wanting to use GUI globals in onInit methods I guess I could call InitGlobals before jasshelper inits.
    But how many jassers really use GUI global variables?

    I am inclined to leave all this as it is.
    Jasshelper called it after structs for years now and there were no big public outcries.

    As it is right now, this "issue" is at the bottom of my priority list.
     
  4. Luorax

    Luorax

    Joined:
    Aug 7, 2009
    Messages:
    1,301
    Resources:
    1
    Maps:
    1
    Resources:
    1
    Well, I'm using a lot of GUI variables right now, but I'll try to reduce this amount in the future
     
  5. Nestharus

    Nestharus

    Joined:
    Jul 10, 2007
    Messages:
    6,146
    Resources:
    8
    Spells:
    3
    Tutorials:
    4
    JASS:
    1
    Resources:
    8
    Er.. the thing is, I am working with preplaced map rects -.-... I have 0 GUI variables, I never use them, but I do occasionally use preplaced destructables/rects, soo... and those are the things that your jasshelper is throwing errors at me for.
     
  6. Luorax

    Luorax

    Joined:
    Aug 7, 2009
    Messages:
    1,301
    Resources:
    1
    Maps:
    1
    Resources:
    1
    I'm using preplaced rects (and a few buildings) too, and with the old JASSHelper (0.A.2.B). A one-shot timer with "0." expiration time works perfectly for me.
     
  7. cohadar

    cohadar

    Joined:
    Jun 16, 2007
    Messages:
    234
    Resources:
    0
    Resources:
    0
    Nestharus is just trolling, ignore him.
    I already told him about 0.0 solution earlier in the thread.
     
  8. Nestharus

    Nestharus

    Joined:
    Jul 10, 2007
    Messages:
    6,146
    Resources:
    8
    Spells:
    3
    Tutorials:
    4
    JASS:
    1
    Resources:
    8
    I'm not trolling, I just don't think you should have to do the TimerStart thing. I know I don't have to do it with vex's jasshelper.

    Code (vJASS):

    library Paths uses Path, Testing
        struct Paths extends array
            private static Path array leftp
            private static Path array rightp
            static method operator [] takes integer pid returns thistype
                return pid/3
            endmethod
            method operator left takes nothing returns Path
                return leftp[this]
            endmethod
            method operator right takes nothing returns Path
                return rightp[this]
            endmethod
            private static method onInit takes nothing returns nothing
                local Path topLeft = Path.create()
                local Path topRight = Path.create()
                local Path bottomLeft = Path.create()
                local Path bottomRight = Path.create()
               
                set leftp[0] = bottomLeft
                set rightp[0] = bottomRight
                set leftp[1] = topLeft
                set rightp[1] = topRight
               
                call topLeft.add(gg_rct_Middle_Center_Top_Left)
                call topLeft.add(gg_rct_Middle_Top_Left)
                call topLeft.add(gg_rct_Top_Left)
                call topLeft.add(gg_rct_Top_Center)
                call topLeft.add(gg_rct_Load_Top)
               
                call topRight.add(gg_rct_Middle_Center_Top_Right)
                call topRight.add(gg_rct_Middle_Top_Right)
                call topRight.add(gg_rct_Top_Right)
                call topRight.add(gg_rct_Top_Center)
                call topRight.add(gg_rct_Load_Top)
               
                call bottomLeft.add(gg_rct_Middle_Center_Bottom_Left)
                call bottomLeft.add(gg_rct_Middle_Bottom_Left)
                call bottomLeft.add(gg_rct_Bottom_Left)
                call bottomLeft.add(gg_rct_Bottom_Center)
                call bottomLeft.add(gg_rct_Load_Bottom)
               
                call bottomRight.add(gg_rct_Middle_Center_Bottom_Right)
                call bottomRight.add(gg_rct_Middle_Bottom_Right)
                call bottomRight.add(gg_rct_Bottom_Right)
                call bottomRight.add(gg_rct_Bottom_Center)
                call bottomRight.add(gg_rct_Load_Bottom)
            endmethod
        endstruct
    endlibrary
     


    That is the code that throws a million syntax errors in yours (undefined variables).



    Why are you breaking functionality?
     
  9. cohadar

    cohadar

    Joined:
    Jun 16, 2007
    Messages:
    234
    Resources:
    0
    Resources:
    0
    Preplaced rects work fine for me.
    Until you come up with a better bug report there is nothing I can do to help you.

    Code (vJASS):

    function main takes nothing returns nothing
        call SetCameraBounds(- 7680.0 + GetCameraMargin(CAMERA_MARGIN_LEFT), - 7680.0 + GetCameraMargin(CAMERA_MARGIN_BOTTOM), 7168.0 - GetCameraMargin(CAMERA_MARGIN_RIGHT), 7168.0 - GetCameraMargin(CAMERA_MARGIN_TOP), - 7680.0 + GetCameraMargin(CAMERA_MARGIN_LEFT), 7168.0 - GetCameraMargin(CAMERA_MARGIN_TOP), 7168.0 - GetCameraMargin(CAMERA_MARGIN_RIGHT), - 7680.0 + GetCameraMargin(CAMERA_MARGIN_BOTTOM))
        call SetDayNightModels("Environment\\DNC\\DNCLordaeron\\DNCLordaeronTerrain\\DNCLordaeronTerrain.mdl", "Environment\\DNC\\DNCLordaeron\\DNCLordaeronUnit\\DNCLordaeronUnit.mdl")
        call NewSoundEnvironment("Default")
        call SetAmbientDaySound("SunkenRuinsDay")
        call SetAmbientNightSound("SunkenRuinsNight")
        call SetMapMusic("Music", true, 0)
        call InitSounds()
        call CreateRegions()   // <--------<<  rects are created here
        call CreateAllDestructables()
        call CreateAllUnits()
        call InitBlizzard()

    call ExecuteFunc("jasshelper__initstructs5502")   // <------<< vJass inits

        call InitGlobals()  // <------<< GUI global variables
        call InitCustomTriggers()
        call RunInitializationTriggers()

    endfunction

     


    Now stop trolling.
     
  10. Nestharus

    Nestharus

    Joined:
    Jul 10, 2007
    Messages:
    6,146
    Resources:
    8
    Spells:
    3
    Tutorials:
    4
    JASS:
    1
    Resources:
    8
    Then try saving this map with your JH and see what happens >.>.


    It tells me that the variables do not exist.


    This map also had the broken main function.


    Also extract luadir to your grimext folder in order to make it run.


    And yes, that map runs perfectly with plain JH, but blows to pieces under yours ;\.

    edit
    sry if I'm being harsh ^)^, I was just going wth at all the weird syntax errors + I've been up all night : P.
     

    Attached Files:

  11. cohadar

    cohadar

    Joined:
    Jun 16, 2007
    Messages:
    234
    Resources:
    0
    Resources:
    0
    I need tis file too: luajass.WmW_Masters.j
     
  12. Nestharus

    Nestharus

    Joined:
    Jul 10, 2007
    Messages:
    6,146
    Resources:
    8
    Spells:
    3
    Tutorials:
    4
    JASS:
    1
    Resources:
    8
    oh sry, my bad. Put this in jass folder in jassnewgen folder (the import folder)
     

    Attached Files:

  13. cohadar

    cohadar

    Joined:
    Jun 16, 2007
    Messages:
    234
    Resources:
    0
    Resources:
    0
    It works fine for me.
    Did you by any chance forget to update to the latest version from today?
    2012-02-07b
     
  14. Nestharus

    Nestharus

    Joined:
    Jul 10, 2007
    Messages:
    6,146
    Resources:
    8
    Spells:
    3
    Tutorials:
    4
    JASS:
    1
    Resources:
    8
    ah, I hadn't tried it since you did the update to fix imports ; P
     
  15. cohadar

    cohadar

    Joined:
    Jun 16, 2007
    Messages:
    234
    Resources:
    0
    Resources:
    0
    I guess //! import directive did not strike you as important in a map with 40 external files?

    F****** Troll
     
  16. Nestharus

    Nestharus

    Joined:
    Jul 10, 2007
    Messages:
    6,146
    Resources:
    8
    Spells:
    3
    Tutorials:
    4
    JASS:
    1
    Resources:
    8
    no, I just wasn't thinking that it was causing the error ;\. As I said, I've been up all night, so I'm tripping out atm.
     
  17. Troll-Brain

    Troll-Brain

    Joined:
    Apr 27, 2008
    Messages:
    2,372
    Resources:
    1
    JASS:
    1
    Resources:
    1
    It's not like you are always an arrogant harsh.
     
  18. cohadar

    cohadar

    Joined:
    Jun 16, 2007
    Messages:
    234
    Resources:
    0
    Resources:
    0
    Bugfix 2012-02-07c
    Fixed //! external directive bug caused by //! import directive fix

    It is a good thing Nestharus gave me his buggy map to experiment on :ogre_hurrhurr:

    This recent jasshelper instability just goes to show how many things I needed to change to make proper initialization order.
    It took me 4 days of hard work for it, dusk till dawn.
     
  19. Laiev

    Laiev

    Joined:
    Oct 11, 2008
    Messages:
    273
    Resources:
    1
    Template:
    1
    Resources:
    1
    Nes, JassHelper ALWAYS has that 'bug' (read, thanks Blizzard) about the GUI variable.

    You can search all the forum, here or thehelper, and you'll find lots of people asking about something like that.

    Why my function based on Rect don't work?
    Why my preplaced unit don't work?

    It's all about 'initializer', in the older JH, it just compile and show no error, but still didn't work, also, if you want it to work, you need to do it at some 'normal onInit' (not module) and/or call it from the init function.
     
  20. Nestharus

    Nestharus

    Joined:
    Jul 10, 2007
    Messages:
    6,146
    Resources:
    8
    Spells:
    3
    Tutorials:
    4
    JASS:
    1
    Resources:
    8
    They work for me? lol

    oh yea, Cohador, improve your parsing of to and for. Variables might be named that. Whenever you add new keywords, be sure to do some excellent parsing on them, otherwise you will break resources that have those labels ^)^. For example, my Timer Tools resource does not work on this jasshelper because it shorthands timeout -> to.