HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Hmm Global Variable, Always errors?

09-22-2006, 12:09 AM#1
Fr0zenLord
Hmmph... When I set for example udg_a = ( udg_a + 1 )
it usually comes up with Expected a variable name... do I have to declare them? like local? or do I have to make them in variables or something? I know this is a nooby question, lol... but its really starting to annoy me, because especially with long names it really is bad -.-

Example, right now this is what is giving me problems

Collapse JASS:
set udg_a = ( udg_a + 1 )

Collapse JASS:
function Trig_Text_Actions takes nothing returns nothing
    set udg_a = ( udg_a + 1 )
    call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,30, "|cfffff000"+udg_a+"|r"
endfunction

//===========================================================================
function InitTrig_Text takes nothing returns nothing
    call TimerStart(CreateTimer(), 0.03, true, function Text) 
endfunction

Edited by Blade.dk. Reason: Replaced PHP tags with jass tags.
09-22-2006, 12:11 AM#2
shadow1500
You declare them with the WE variable table, press CTRL+B in trigger editor. The variables declared in the WE trigger editor must be used with the "udg_" prefix in jass.

EDIT: You are posting in PHP tags, you must post in jass tags for jass source ([jass]).
09-22-2006, 02:31 AM#3
Rising_Dusk
You're calling this wrong.

Collapse JASS:
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,30, "|cfffff000"+udg_a+"|r"
It should be this.
Collapse JASS:
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,30, "|cfffff000"+I2S(udg_a)+"|r")
09-22-2006, 03:14 AM#4
Fr0zenLord
Yes thanks, I noticed a short while ago, I forgot the I2S,

Yeah sorry, about the "php" I have another forum where you have to use php they dont have jass tags I dont usually forget sorry:P - Thanks guys