Hey there, im pretty noob at this, but i was trying to create a variable which follows each player and create an effect which follows that variable.
I know it would be easier to attach the effect directly on the player and not on the variable which follows the player, but it is for learning purpose.
What did i do wrong?
I created an action and set for the variable->
Action : Set player variable
Player : Event player
Variable: A
Value: Position of
Player: Event player
And for the effect->
Action: Create effect
Visible to: All players
Team: Team-> All
Type: Ring
Color: Color-> Black
Position: Position of
Player: Player Variable
Player: Event Player
Variable: A
Radius: 5
Reevaluation: Position and radius
Another question I have is: how to create a variable at the position of an effect?
While your HUD does Reevaluate where it is supposed to be, the Variable “Snapshots” the Player position.
I.E the Variable stays at the position of the Player on the frame it was created.
One loop less solution for the Variable would be to use Chase Player Variable, select as Destination the Position of the event player.
Looking like this in Workshop Code
rule("Rule 1")
{
event
{
Ongoing - Each Player;
All;
All;
}
actions
{
Event Player.A = Position Of(Event Player);
Chase Player Variable At Rate(Event Player, A, Position Of(Event Player), 30, Destination and Rate);
Create Effect(All Players(All Teams), Ring, Color(Black), Event Player.A, 1, Position and Radius);
}
}
And Like this in Drop down
Action: Set player variable
Player: Event player
Variable: A
Value: Position of
Player: Event player
Action: Chase Player Variable at Rate
Player: Event Player
Variable: A
Destination: Position Of
Player: Event Player
Rate: Number
Number: 30
Reevaluation: Destination and Rate
Action: Create effect
Visible to: All players
Team: Team
Team: All
Type: Ring
Color: Color
Color: Black
Position: Player Variable
Player: Event Player
Variable: A
Radius: 5
Reevaluation: Position and radius
Another thing, the Ring won’t be visible to the player if it is Created before the Player spawns (In general players that spawn after the effect is created), that would be why you’d want to Reevaluate “Visible To” as well.
My goal was that after a player was killed, 3 spheres with different colors appear next to each other and the attacker could chose from 1 of 3 spheres/items. to collect them the attacker should be in range/inside the spheres. but i thought it was only possible to detect them with “last created entity”; thats why i suggested creating a variable on each sphere instead of that.
correct me if im wrong, i may talk much nonsensexD
I don’t know if that question has been answered for you already, but you might need to think about it the other way round: First you save the 3 positions in variables or an array when the player dies, then you create 3 spheres at these positions by loading the variables or the array. This way you can use the variables or the array to check for proximity of the spheres.
Oh, I understand, thank you
The variable/ring disappeares as soon as the enemy respawns. How can I fix it to the dead body position till it is destroyed?