• Check out the results of the Techtree Contest #19!
  • Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!

[General] Looping until a point != itself

Status
Not open for further replies.
Hey do you have any idea how to solve this problem?
the idea is:
loop until RaceCurrentInt != RaceRandomInt.
If != , then set it to RaceRandomInt.
The goal here is to avoid setting/re-setting the new point where the previous point was.
  • For each (Integer A) from 1 to 10, do (Actions)
    • Loop - Actions
      • Set Race_RandomInt = (Random integer number between 1 and Settings_Race_Jumps)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Race_CurrentInt Not equal to Race_RandomInt
        • Then - Actions
          • Set Race_CurrentInt = Race_RandomInt
          • Set Race_CurrentPoint = KOTH_POINTS[(Random integer number between 1 and Settings_Race_Jumps)]
          • Item - Create Race Flag at Race_CurrentPoint
          • Skip remaining actions
        • Else - Actions
 
Last edited:
I think I might solved it
JASS:
function Trig_SetNextPoint takes nothing returns nothing
  
    loop
        exitwhen udg_Race_CurrentInt != udg_Race_RandomInt
        set udg_Race_RandomInt = GetRandomInt(1, udg_Settings_Race_Jumps)
    endloop
    set udg_Race_CurrentInt = udg_Race_RandomInt
    set udg_Race_CurrentPoint = udg_KOTH_POINTS[GetRandomInt(1, udg_Settings_Race_Jumps)]
    call CreateItemLoc( 'rflx', udg_Race_CurrentPoint )
    call DisplayTextToForce( GetPlayersAll(), "A new flag has been spawned! Check the minimap!" )
endfunction

//===========================================================================
function InitTrig_Race_Set_Next_Point takes nothing returns nothing
    set gg_trg_Race_Set_Next_Point = CreateTrigger(  )
    call TriggerAddAction( gg_trg_Race_Set_Next_Point, function Trig_SetNextPoint )
endfunction
 
Sure, if you have jass knowledge it is easier. Wrda tried to keep things in GUI.
 
Status
Not open for further replies.
Back
Top