Mirror code: WSB5D
I want to set a vector to be the center of the mirror, like how 0 0 0 is the central point of the mirror, the only place where all of the bots can truly be in the same place.
Mirror code: WSB5D
I want to set a vector to be the center of the mirror, like how 0 0 0 is the central point of the mirror, the only place where all of the bots can truly be in the same place.
First you need to set the mirrorCenter. Then you when you do calculations, you need to know the direction from your position to your mirrorCenter. Below is how you create the dummy bots around your set center.
Note: if this doesn’t work, turn off all your other rules. You’ll need to convert all your other rules to use direction vectors too.
variables
{
player:
0: mirrorCenter
}
rule("Global")
{
event
{
Ongoing - Global;
}
conditions
{
Has Spawned(Host Player) == True;
}
actions
{
Host Player.mirrorCenter = Vector(10, 0, 10);
Create Dummy Bot(Hero Of(Host Player), Team Of(Host Player), -1, (Host Player.mirrorCenter - Position Of(Host Player))
* 2 + Position Of(Host Player), Vector(0, 0, 0));
Create Dummy Bot(Hero Of(Host Player), Team Of(Host Player), -1, (Vector(X Component Of(Host Player.mirrorCenter), Y Component Of(
Host Player.mirrorCenter), 0) - Vector(X Component Of(Position Of(Host Player)), Y Component Of(Position Of(Host Player)), 0))
* 2 + Position Of(Host Player), Vector(0, 0, 0));
Create Dummy Bot(Hero Of(Host Player), Team Of(Host Player), -1, (Vector(0, Y Component Of(Host Player.mirrorCenter),
Z Component Of(Host Player.mirrorCenter)) - Vector(0, Y Component Of(Position Of(Host Player)), Z Component Of(Position Of(
Host Player)))) * 2 + Position Of(Host Player), Vector(0, 0, 0));
}
}
Formulas:
direction = mirror center - player position
mirror position = player position + 2*direction
mirror position = (mirror center - player position) * 2 + player position
mirror position left = (z less mirror center - z less player position) * 2 + player position
mirror position right = (x less mirror center - x less player position) * 2 + player position