2 begginer jass questions.

B

Beelzebubson

Guest
ok, 1) i was wondering which is easier: setting 30+ variables 1-30 like having to click on the 1 change it to 2, then to 3 etc or doing that in jass?
2) How do i know how many spaces form the edge somethign should be?
 
B

Beelzebubson

Guest
alright thanks and how would i write something like set tempinteger = tempinteger + 1? also how do i just write set integers 1 = 73?
 

emjlr3

Change can be a good thing
Reaction score
395
er just like that....

set i = 55

set i = i + 5
 
B

Beelzebubson

Guest
no, i mean an integer variable, like temp integer. every time i try typing the name of my var it comes up with errors
 

uberfoop

~=Admiral Stukov=~
Reaction score
177
erm, lets see. If its a global variable (the ones you edit in the edit variables list), you need to put a udg_ in front of it. So if you have a global integer variable called RAWR, you would do something like:
set udg_RAWR = udg_RAWR + 1


local variables, which must be declared at the begining of a function, are referenced just by their name. So a integer local variable, you could use like:

function nub takes nothing returns nothing
local integer nub
set nub = 5
set nub = nub + 5
endfunction
 
B

Beelzebubson

Guest
thanks, i didnt have udg_ anyways 1 more question :p hwo do i do an if/then/else function? three under each other with 2 boolen conditions for each?
 

AceHart

Your Friendly Neighborhood Admin
Reaction score
1,495
> how do I do an if/then/else

With "if then else"...

If test1 then
- ...
elseif test2 or test3 then
- ...
elseif test4 and test5 and test6 then
- ...
else
- ...
endif

"elseif" and "else" parts are optional.
No need to put them if you have no actions there.

Tried reading some "Introduction to JASS"?
 
B

Beelzebubson

Guest
yes, but in most of them it starts off with displaying text to people, and then goes onto other things, if there is a tutorial with if/then/else help on them could i please have alink? also AceHart i dotn quite understand what you mean i want 3 if then else functions all under each other and each has 2 boolen conditions.
 

SFilip

Gone but not forgotten
Reaction score
634
> if there is a tutorial with if/then/else help on them could i please have alink?
tried this one?
 
M

Mythic Fr0st

Guest
hmm

Beel,

Like this (I think)

if PlayerHasPickedHero = true
(Then actions)
elseif PlayerHasLoadedHero = True
(Then Actions)
elseif DoYouUnderStandThis = false
(Then Actions)
endif

(Elseif, is like another IF statement, but much easier, so its like having 2 if then else multiple functions, in GUI (I think))

And the spacing is called "Indents" and usually 4

local i = 0
call DisplayTextToPlayer(Player(0),"Hello" )

(calling stuff is 4, and setting local's is 1 I think, lol)
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top