local the global varible

X.Terror.X

New Member
Reaction score
10
hey sorry for me to ask it on this but irealy couldnt find it on the tutorial forum i guess im unexperianced with finding the thing i want mabye can give me some hints how ifind the easyest way what i want

but my question was whats the custom script of localisizing the global varible i thought it was something like this but it didnt worked out
im not very good with jass/ custom cripts

Custom script: Local integer udg_[my varbile name]

thanks for the help anyway
 

Rushhour

New Member
Reaction score
46
I'm not familiar with this MUI global locals, but in Jass "local" mustn't have a capital letter
so try "local integer udg_[my varbile name]
(your variable name ofc without [] )^^
 

X.Terror.X

New Member
Reaction score
10
thanks alot :rolleyes:

mabye u know something about this too

ive been looking in jass forums google and gui forums to see if anything like this is posted there but it keeps making errors and i can't find it

Code:
Custom script:   call RemoveInteger (udg_n)
 

X.Terror.X

New Member
Reaction score
10
ok this is strange when i post it apart in a trigger
Custom script: local integer (udg_n)
i can enable him

when i post it in diffrent trigger

Actions
Code:
Custom script:   local integer (udg_n)
    Set n = 1
    Unit - Order (Triggering unit) to Move To ((Position of (Triggering unit)) offset by 1000.00 towards (90.00 x (Real(n))) degrees
)

i cant enable it and cant be saved with them on this is strange :X
 

X.Terror.X

New Member
Reaction score
10
ok but how to local the integer
i think i want to use the integer longer for that trigger and i dont wanna use array since that will be alot of work
the local works in a empty trigger but when adding it in the trigger
(see excample) it says line 325 exspected a code estatement
 

Komaqtion

You can change this now in User CP.
Reaction score
469
And... Why use a global integer anyways ? :S
Why not just simply use a local one ?
 

ZugZugZealot

New Member
Reaction score
33
Adding "udg_" to the name of a variable doesn't make a variable a global. It's merely a format that Blizzard uses for variables made in the variable editor. Blizzard has game globals as well "gg_" the whole purpose is to avoid variable name conflictions.

Perhaps you mean declaring global variables outside of the variable editor? In which case you'll need a higher level Jass compiler such as Jasshelper for doing global blocks. Which can't be declared inside "actions" (functions).

JASS:
globals
   integer number
endglobals
 

X.Terror.X

New Member
Reaction score
10
u mean create a varible with custrom script?
i just learned this from kindof a tutorial thought that would be nice idea to add

and im using the same varibles in diffrent triggers to set the angle
so if varible is 1 90 decrees shoot
if varible 2 180
ect
so i dont know if i bug it

i just wanted the global to be local in the trigger
i hope u understand what i mean my english grammer isnt so good
 

Romek

Super Moderator
Reaction score
963
Shadowing local/global variables no longer works. It was 'fixed' in one of the patches.

I guess that means you can no longer do this:
Trigger:
  • Custom Script: local unit udg_Unit // ....
    • Unit - Kill (Unit)
 

ZugZugZealot

New Member
Reaction score
33
So you mean being able to select local variables in the GUI functions?

Trigger:
  • Actions
    • Custom script: local integer value
    • Unit - Create value Footman for Player 1 (Red) at (Center of (Playable map area)) facing Default building facing degrees
If this is what you mean, it can't be done.

This is the only way to use locals in GUI.
Trigger:
  • Actions
    • Custom script: local integer value
    • Custom script: call CreateNUnitsAtLoc( value, 'hfoo', Player(0), GetRectCenter(GetPlayableMapRect()), bj_UNIT_FACING )
In which case, you may as well just use Jass, which I highly encourage people to use Jass. ^_^
 

Romek

Super Moderator
Reaction score
963
> [ljass] local integer value[/ljass]
[ljass]local integer udg_value[/ljass]

And yes, you're correct.

Simplified; this won't work:
JASS:
globals
   integer udg_Hello
endglobals

function Lol takes nothing returns nothing
   local integer udg_Hello
  // Do stuff
endfunction
 

X.Terror.X

New Member
Reaction score
10
jass is still to hard for me
thats a problem what i face now
how ideal with this
i made this local integer varible for each integer
but i got a trigger like this


Code:
Unit - Order (Triggering unit) to Move To ((Position of (Triggering unit)) offset by 1000.00 towards (90.00 x (Real(([COLOR="Red"]The Local Varible[/COLOR])))) degrees)

how do i input the local varible into my gui code? i tried get string handle ID i thought that whould be the one that fixed it but i have no idea now
so normaly u pick the global varible out the list but u cant since its a local varible
and i have no intrests in doing it al into jass since i want to change it if i want it
 

X.Terror.X

New Member
Reaction score
10
My problem is im not a jass user i have not enoug experiance for that

the first option is if i use locals with custom script i have no idea how to get those local putted in when i make a GUI trigger like explained 1 post up

the 2nd option is making a global local but that is been fixed i hear and doesnt work anymore on warcraft

the 3th is making a global but gives the chance the triggers will glitch with each other

so i want to know how i can fix the chance of glitching
 

Komaqtion

You can change this now in User CP.
Reaction score
469
Well, you should use your 1st option there ;)
And, if you want (And don't want to learn how to use only JASS yet) you can download EGUI, which offers the opportunity to use JASS in any GUI action ;)
 

Romek

Super Moderator
Reaction score
963
> And, if you want (And don't want to learn how to use only JASS yet) you can download EGUI, which offers the opportunity to use JASS in any GUI action
UMSWE adds that too.
So, get newgen, enable UMSWE, and use the locals where you need them.
 

X.Terror.X

New Member
Reaction score
10
so where can i download a trusted EGUI newgen? :banghead:
instead looking all trough google i have no idea what im looking for
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top