Variables - Interger VS Real

Wummi

Just Relax and Smile!
Reaction score
58
Hi guys, I don't know much about computer programming language, and I am confused between Real and Interger variables. What is the difference between two of them? They're both numbers, and I don't know when to use a real or interger variable.
And another question I have is that when I make a trigger, it says "Loop Actions" like:
Pick every unit in (Region 01) and do Actions
Loop - Actions
Order (Picked unit) to (Attack Move) to (Region 02)

Now what does that Loop-Actions mean? what happens if it isn't a Loop? What is a Loop?
 

Lobster

Old Fogey ofthe site
Reaction score
90
Real: a decimal number

Integer: a non decimal number

A loop is something that is repeated until the endloop condition is met
 

canons200

New Member
Reaction score
50
just as lobster posted, real allow decimal, precisely decimal, in the case of 3/10, the real will treats it as fraction, so if you do perform calculation, the trigger will take 3/10 do action rather than 0.333333333333 do action, even through they look like same, but in the long run, they are different.

anyway, you can allow convert real to integer or vice versa
 

perkeyone

something clever
Reaction score
71
it might be useful to know that when you divide integers, you get integers,
(example: 5÷3=1)

and when you divide reals you get reals.
(example: 5.0÷3.0=1.6666)

furthermore, if you want the remainder of a division WE has a modulo function
(example 5%3=2)

loops are a type of "control flow statement" which allows a set of instructions to be repeated a specified number of times,

in your example "loop-actions" is just a label, just as the "events" and "conditions" are.
its just there to let you know that the actions below it are going to be repeated for each unit that is inside that region.

if it was not a loop, then only one unit from the region would be picked
 

Wummi

Just Relax and Smile!
Reaction score
58
in your example "loop-actions" is just a label, just as the "events" and "conditions" are.
its just there to let you know that the actions below it are going to be repeated for each unit that is inside that region.

if it was not a loop, then only one unit from the region would be picked

So if I make a trigger do something like:
Event -
A unit beings casting an ability
Conditions -
Ability being cast equals to Thunder Clap
Actions -
Pick every unit within 800 of (Triggering Unit) and do Actions:
Loop - Actions
Cause (Triggering Unit) to deal 1000 damage to (Picked Unit)


Then because the Action is being looped, shouldn't that mean it will keep doing 1000 damage to the picked units until they die? I know it doesn't, but I don't get the logic behind the loop.
 

canons200

New Member
Reaction score
50
base on your example, the trigger unit will deal 1000 damage to each pick unit. Each pick unit 1 time will be damaged for only 1 time, eg 10 units, each unit takes 1000 damage.

if you are confuse with the word loop, just ignore it
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top