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 havn't received your rank award? Then please contact the administration.
    Dismiss Notice
  3. The Lich King demands your service! We've reached the 19th edition of the Icon Contest. Come along and make some chilling servants for the one true king.
    Dismiss Notice
  4. The 4th SFX Contest has started. Be sure to participate and have a fun factor in it.
    Dismiss Notice
  5. The poll for the 21st Terraining Contest is LIVE. Be sure to check out the entries and vote for one.
    Dismiss Notice
  6. The results are out! Check them out.
    Dismiss Notice
  7. Don’t forget to sign up for the Hive Cup. There’s a 555 EUR prize pool. Sign up now!
    Dismiss Notice
  8. The Hive Workshop Cup contest results have been announced! See the maps that'll be featured in the Hive Workshop Cup tournament!
    Dismiss Notice
  9. 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.

Converting GUI into JASS

Discussion in 'Triggers & Scripts' started by GIMLI_2, Dec 16, 2015.

  1. Wietlol

    Wietlol

    Joined:
    Aug 1, 2013
    Messages:
    4,641
    Resources:
    3
    Spells:
    3
    Resources:
    3
    you can leave it like that, but most vJASSers use scopes.
     
  2. GIMLI_2

    GIMLI_2

    Joined:
    Mar 21, 2011
    Messages:
    1,319
    Resources:
    2
    Maps:
    2
    Resources:
    2
    ok

    is it possible to return 2 values? i want my function to return a location (2 real values)
     
  3. Wietlol

    Wietlol

    Joined:
    Aug 1, 2013
    Messages:
    4,641
    Resources:
    3
    Spells:
    3
    Resources:
    3
    That is not possible.
    You can place them in global variables though or you can use a struct that defines an object like a location.
     
  4. GIMLI_2

    GIMLI_2

    Joined:
    Mar 21, 2011
    Messages:
    1,319
    Resources:
    2
    Maps:
    2
    Resources:
    2
    is it ok to return a location then?
     
  5. IcemanBo

    IcemanBo

    Joined:
    Sep 6, 2013
    Messages:
    6,166
    Resources:
    22
    Maps:
    3
    Spells:
    11
    Template:
    1
    Tutorials:
    4
    JASS:
    3
    Resources:
    22
    You can write "return location", but you can not directly return 2 real values.
    Then you woul need to store them somewhere where you have public access.
     
  6. GIMLI_2

    GIMLI_2

    Joined:
    Mar 21, 2011
    Messages:
    1,319
    Resources:
    2
    Maps:
    2
    Resources:
    2
    ok


    a trigger i just created, i'm not sure about the event, i think i've done sth wrong there probably. but it works :D

    Code (vJASS):

    function Trig_Explosive_Mines_Conditions takes nothing returns boolean

            local unit u = GetTriggerUnit()
            local player p = GetOwningPlayer(u)
            local unit m

        if ( GetUnitTypeId(u) == 'n000' and  GetUnitTypeId(GoblinHero[GetPlayerId(p)]) == 'H000' and GetRandomInt(0, 99) <= 17 ) then

            set m = CreateUnit(p, 'n006', GetUnitX(u), GetUnitY(u), bj_UNIT_FACING )
            call RemoveUnit(u)
            call SetUnitAnimation(m, "birth")
       
        endif
       
            set u = null
            set m = null
            set p = null
       
        return false
       
       
    endfunction



    //===========================================================================
    function InitTrig_Explosive_Mines takes nothing returns nothing
        local region r = CreateRegion()
        call RegionAddRect(r, bj_mapInitialPlayableArea)
        set gg_trg_Explosive_Mines = CreateTrigger(  )
        call TriggerRegisterEnterRegion( gg_trg_Explosive_Mines, r, null )
        call TriggerAddCondition( gg_trg_Explosive_Mines, Condition( function Trig_Explosive_Mines_Conditions ) )
        set r = null
    endfunction
     
     
  7. GIMLI_2

    GIMLI_2

    Joined:
    Mar 21, 2011
    Messages:
    1,319
    Resources:
    2
    Maps:
    2
    Resources:
    2
    I have a problem with a function i made. Whenever i call the function in my trigger, the trigger wont continue from tha point. My function counts how many slots are used in the inventory. It takes a unit and returns an integer. I cannot show you the code right now, im not at home. It gives me no errors, it just stops the trigger
     
  8. GIMLI_2

    GIMLI_2

    Joined:
    Mar 21, 2011
    Messages:
    1,319
    Resources:
    2
    Maps:
    2
    Resources:
    2
    So, i did take a look at timers and have some questions about that. you told me to use a timer system and i did a research on that and ended up with TimerUtils or TimerTools.
    From where do i get the code and which one should i use?