That one that wrote:I refer to the pixel as the smallest square visible in the map customization grid, and the square, those that are formed by 10x10 pixels.
If I wanted to define a region to move randomly within a 30x30 pixel square, following its instructions:
1) create a trigger and choose the action "Set the value of variable 'A' to a random integer in the range 0..B-1"
In Parameter A, I must put the name of the variable.
Now in parameter B, how should I put the information in it?
0 <= Variable A <= 30?
or
0.30?
As for the second instruction, it says that I have to assign this random value to my variable, in which case I must use the action "Add the value 'B' to the value of the variable 'A' " next:
Parameter A (Variable): Variable A
Parameter B (Value to be Assigned): Variable A
Is this right?
In summary, my doubts are:
1) How is the information written in parameter B to define the range of values that the variable will assume?
2) How do I add the value that the previous trigger action achieved for variable A? Should I use the action of adding value B to variable A and placing Variable A in both parameters?
I'm sorry for the confusion back there, I hope I was clear this time :s
So let's say you have a map that is 30 squares wide, and the x coordinate of the left side of the map is 200, it would go like this:
Set value of variable 'A' to random integer number in range 0..B-1
Parameter A: SomeVariableName
Parameter B: 3000
Add value 'B' to value of variable 'A'
Parameter A: SomeVariableName
Parameter B: 200
In action 1, parameter B has to be a single integer number. As 30 squares is 300 pixels and that is 3000 "units", we would use 3000 in the parameter. The reason it has to be in "units" is so that the region will be moved to the correct location, as the game doesn't think in squares or pixels. Basically, unit=1, pixel=10, square=100. The region can of course go into decimal places, such as x=0.5, but the trigger action by itself doesn't do decimal numbers.
in action 2, we are simply adding a number to the variable value which we got from the previous action. Adding the map's left border x coordinate to the random value is necessary because without it, the region would be moved to a random point between 0-3000, instead or the 200-3200 we would want in this example. 0-3000 may end up being outside the map.
Hope that clears it up at least to some extent.