• 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 faction for Warcraft 3 and enter Hive's 19th Techtree Contest: Co-Op Commanders! Click here to enter!
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 21st Texturing Contest: Upgrade is now concluded, time to vote for your favourite set of icons! Click here to vote!

Can someone convert this to GUI please?

Status
Not open for further replies.
Level 9
Joined
Aug 11, 2007
Messages
429
Hey guys, can anyone convert this to GUI?

JASS:
function Trig_Income_Func002Func004C takes nothing returns boolean
	if(not(udg_reals16[GetForLoopIndexA()]==0.00))then
		return false
	endif
	return true
endfunction

function Trig_Income_Func002Func011C takes nothing returns boolean
	if(not(udg_integers49[GetForLoopIndexA()]<=-5))then
		return false
	endif
	return true
endfunction

function Trig_Income_Actions takes nothing returns nothing
	set bj_forLoopAIndex=1
	set bj_forLoopAIndexEnd=12
	loop
		exitwhen bj_forLoopAIndex>bj_forLoopAIndexEnd
		set udg_integers46[GetForLoopIndexA()]=GetPlayerState(udg_players01[GetForLoopIndexA()],PLAYER_STATE_RESOURCE_FOOD_USED)
		set udg_integers47[GetForLoopIndexA()]=GetPlayerState(udg_players01[GetForLoopIndexA()],PLAYER_STATE_RESOURCE_LUMBER)
		set udg_reals16[GetForLoopIndexA()]=(1.00-(I2R(udg_integers46[GetForLoopIndexA()])*0.01))
		if(Trig_Income_Func002Func004C())then
			set udg_reals17[GetForLoopIndexA()]=((I2R(udg_integers47[GetForLoopIndexA()])/10.00)-100.00)
		else
			set udg_reals17[GetForLoopIndexA()]=((I2R(udg_integers47[GetForLoopIndexA()])/10.00)*udg_reals16[GetForLoopIndexA()])
		endif
		set udg_integers48[GetForLoopIndexA()]=R2I(udg_reals17[GetForLoopIndexA()])
		call DisplayTimedTextToPlayer(udg_players01[GetForLoopIndexA()],0,0,10.00,"TRIGSTR_703")
		call DisplayTimedTextToPlayer(udg_players01[GetForLoopIndexA()],0,0,10.00,("Peasants:"+I2S(udg_integers47[GetForLoopIndexA()])))
		call DisplayTimedTextToPlayer(udg_players01[GetForLoopIndexA()],0,0,10.00,("Military:"+I2S(udg_integers46[GetForLoopIndexA()])))
		call DisplayTimedTextToPlayer(udg_players01[GetForLoopIndexA()],0,0,10.00,("Income:"+I2S(udg_integers48[GetForLoopIndexA()])))
		call AdjustPlayerStateBJ(udg_integers48[GetForLoopIndexA()],udg_players01[GetForLoopIndexA()],PLAYER_STATE_RESOURCE_GOLD)
		if(Trig_Income_Func002Func011C())then
			set udg_integers49[GetForLoopIndexA()]=(udg_integers49[GetForLoopIndexA()]+5)
		else
			call DoNothing()
		endif
		set bj_forLoopAIndex=bj_forLoopAIndex+1
	endloop
endfunction

Any variables can be marked as so:
Variable Name - Type - Array [Yes/No] - Initial Value
 
Level 6
Joined
Aug 22, 2008
Messages
123
  • Income
  • Events
    • (none)
  • Conditions
    • (none)
  • Actions
    • For each Integer A from 1 to 12 do
      • Actions
        • set integers46[Integer A]=Used food of (players01[Integer A])
        • set integers47[Integer A]= Player (players01[Integer A])'s current lumber
        • set reals16[Integer A]=(1.00-( Real (integers46[Integer A])*0.01))
        • if reals16[Integer A]=0.00
        • then
          • set reals17[Integer A]= ((Real (integers47[Integer A])/10.00) -100.00)
        • else
          • set reals17[Integer A]=((Real (integers47[Integer A])/10.00)* reals16[Integer A])
        • (endif)
        • set integers48[Integer A]=Integer(reals17[Integer A])
        • Display to (players01[Integer A]) the text "TRIGSTR_703" //<not sure what this may be, check the Triggerstrings!
        • Display to (players01[Integer A]) the text ("Peasants:"+String (integers47[Integer A]))
        • Display to (players01[Integer A]) the text ("Military:"+String(integers46[Integer A]))
        • Display to (players01[Integer A]) the text ("Income:" + String (integers48[Integer A])))
        • Increase players01[Integer A]'s current gold by integers48[Integer A]
        • if (integers49[Integer A]<=-5)then
          • set integers49[Integer A]=(integers49[Integer A]+5)
        • (endif)
Thats it. You hopefully do not try to hack a map. If you do so, I will not help you any further.:angry:

@The one below:
Your actions are highly impolite. You added nothing new to this theme and sell the work I did as yours. Should be counted as negative -rep.
 
Last edited:
  • Income
  • Events
    • (none)
  • Conditions
    • (none)
  • Actions
    • For each Integer A from 1 to 12 do
      • Actions
        • set integers46[Integer A]=Used food of (players01[Integer A])
        • set integers47[Integer A]= Player (players01[Integer A])'s current lumber
        • set reals16[Integer A]=(1.00-( Real (integers46[Integer A])*0.01))
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • reals16[Integer A] Equal to 0.00
          • Then - Actions
            • set reals17[Integer A]= ((Real (integers47[Integer A])/10.00) -100.00)
          • Else - Actions
            • set reals17[Integer A]=((Real (integers47[Integer A])/10.00)* reals16[Integer A])
        • set integers48[Integer A]=Integer(reals17[Integer A])
        • Display to (players01[Integer A]) the text "TRIGSTR_703" //<not sure what this may be, check the Triggerstrings!
        • Display to (players01[Integer A]) the text ("Peasants:"+String (integers47[Integer A]))
        • Display to (players01[Integer A]) the text ("Military:"+String(integers46[Integer A]))
        • Display to (players01[Integer A]) the text ("Income:" + String (integers48[Integer A])))
        • Increase players01[Integer A]'s current gold by integers48[Integer A]
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • (integers49[Integer A] Less than or equal to-5)
          • Then - Actions
            • set integers49[Integer A]=(integers49[Integer A]+5)
          • Else - Actions
Learn to use trigger-tags, they exist for a reason.
(I've also fixed a few things, like the if/then/elses).
 
Status
Not open for further replies.
Top