• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

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:
Level 28
Joined
Jan 26, 2007
Messages
4,789
  • 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