The quick fix would be to set the reevaluation of the orb to something that doesnt contain position. This fix is unnecessary though if you want to clean up your code:
split the create effect action into:
set global variable(A, random value in array(global variable(V)))
create effect(all players(all teams), orb, white, global variable(A), 0, visible to position and radius)
change the condition in the 3rd rule to: distance between(event player, global variable(A)) < 1
change the action of the 3rd rule to: set status(event player, null, hacked, 1)
Putting a RNG action in an attribute that gets reevaluated doesnt work well, because apparently workshop uses the state of the match to determine randomness.
It Works!
How can I avoid spawning the multiple orbs on a Vector Position because i added now 2 Orbs . 3 Orbs Total, and sometimes 2 Orbs spawnen on the Same Vector.
Add the line: set global variable(V, remove from array(global variable(V), global variable(A)))
after the line set global variable(A, random value in array(global variable(V)))
This: modify global variable(V, remove from array(global variable(A)) might work aswell.
So its Look Like This ? I cant follow you actually
Rule Name"CREATE EFFECT ORB A"
EVENT = ON GOING GLOBAL
Action
set global variable(V, remove from array(global variable(V), global variable(A)))
set global variable(A, random value in array(global variable(V)))
Create Effect(ALL PLAYERS(ALL TEAMS),ORB, PURPLE, GLOBAL VARIABLE(A), 0, VISIBLE TO POSITION AND RADIUS)
No I meant the other way round. Sorry, english isnt my native language, so its sometimes a bit difficult for me to explain something clearly.
Its this:
Rule Name"CREATE EFFECT ORB A"
EVENT = ON GOING GLOBAL
Action
set global variable(A, random value in array(global variable(V)))
set global variable(V, remove from array(global variable(V), global variable(A)))
Create Effect(ALL PLAYERS(ALL TEAMS),ORB, PURPLE, GLOBAL VARIABLE(A), 0, VISIBLE TO POSITION AND RADIUS)
Because after you have chosen a random vector you are removing this vector from the “list” of possible vectors to avoid choosing the same vector twice.
LOL i just messed up with the order of the Action ! im so sorry! Thank you very much Shanalotte! I had so many Questions xD because im already not done :o My Problem is… i Need to practice more because i want just creating more stuff like that… and i dont had expirence… your help is very importent for me to better understanding Scripting
Thank you! Its hard for me to because english speaking is no Problem , but the writing Thing its just horrible for me
Thats Good
But i Asking Simple Question first because if im asking what i want, its more as one rule xD
Now i want that when im running in the Orb, that ALL Other Player are frozen in 20 Yards for 3 seconds…
Rule Name"CREATE EFFECT ORB A|ICON ASTERISK"
EVENT ONGOING - GLOBAL
Action:
{
SET GLOBAL VARIABLE(A, RANDOM VALUE IN ARRAY(GLOBAL VARIABLE(V)))
}
{
SET GLOBAL VARIABLE (V, REMOVE FROM ARRAY(GLOBAL VARIABLE(V), GLOBAL VARIABLE(A)))
}
{
CREATE EFFECT(ALL PLAYERS(ALL TEAM), ORB, BLUE, GLOBAL VARIABLE(A), 0, VISIBLE TO POSITION AND RADIUS)
}
{
CREATE ICON(ALL PLAYERS(ALL TEAM), GLOBAL VARIABLE(A),ASTERISK, VISIBLE TO AND POSITION, BLUE, TRUE)
}
Rule Name “Near ORB A = FROZEN”
EVENT ONGOING - EACH PLAYER
TEAM ALL
PLAYER ALL
Condition:
{
DISTANCE BETWEEN(EVENT PLAYER, GLOBAL VARAIBLE(A))< 3
}
Action:
{
SET STATUS(EVENT PLAYER, NULL, FROZEN, 3)
}
Thats correct so far. You can give the “set status” action an array of players. So instead of “SET STATUS(EVENT PLAYER, NULL, FROZEN, 3)” you use: set status(players within radius(position of(event player), 20, all teams, off), null, frozen, 3)
I dont know how much 20 yards are, so I just used 20 “overwatch distance units” whatever that is ^^
Oh If im go in that Orb im frozen to did you know how all other Player are frozen unless me ?
How i can “trigger” all 3 Vector so i can use a jumparea like that.
Rule Name “VECTOR = Z = JUMPAREA”
EVENT ONGOING - GLOBAL
Action
SET GLOBAL VARIABLE(Z, VECTOR(X,Y,Z))
SET GLOBAL VARIABLE(Z, VECTOR(X,Y,Z))
SET GLOBAL VARIABLE(Z, VECTOR(X,Y,Z))
Rule Name “Near Z = Jump”
Action
CREATE EFFECT(ALL PLAYERS(ALL TEAMS), RING, GREEN, GLOBAL VARIABLE(Z), 2, VISIBLE TO POSITION AND RADIUS
CREATE ICON(ALL PLAYERS(ALL TEAMS), GLOBAL VARIABLE(Z), ARROW: UP, VISIBLE TO AND POSITION, GREEN, TRUE)
APPLY IMPULSE(EVENT PLAYER, UP, 20, TO WORLD, CANCEL CONTRARY MOTION)
use a filtered array: set status(filtered array(players within radius(position of(event player), 20, all teams, off), compare(current array element, !=, event player)), null, frozen, 3)
Im not sure what you want to do here. If you want to have a circular area at vector(x,y,z) with radius 2 then you just do it like you did it with the orb
Im Testing that Frozen Thing when Friends are Online Thank you!
EDIT IT WORK!
its like the Jumparea on chateau gaillard
But when im go in that Game. so actually just one Vector affected by this Action i tested this with the distance beetween it doesnt work just for one Vector i want that all 3 vectors had this apply Impulse effect
Rule Name “VECTOR = Z = JUMPAREA”
EVENT ONGOING - GLOBAL
Action
SET GLOBAL VARIABLE(Z, VECTOR(X,Y,Z))
SET GLOBAL VARIABLE(Z, VECTOR(X,Y,Z))
SET GLOBAL VARIABLE(Z, VECTOR(X,Y,Z))
Rule Name “CREATE EFFECT Z”
ONGOING - GLOBAL
Action
CREATE EFFECT(ALL PLAYERS(ALL TEAMS), RING, GREEN, GLOBAL VARIABLE(Z), 2, VISIBLE TO POSITION AND RADIUS)
CREATE ICON(ALL PLAYERS(ALL TEAMS), GLOBAL VARAIBLE(Z), ARROW: UP, VISIBLE TO AND POSITION, GREEN, TRUE)
Rule Name “Near Z = Jump”
Condition
DISTANCE BETWEEN(EVENT PLAYER, GLOBAL VARIABLE(Z)) < 2
Even if you meant 3 different vectors with the “vector(x,y,z)” (like vector(x1,y1,z1), vector(x2,y2,z2) and vector(x3,y3,z3) you still set the same variable. So after the third set operation the variable will only contain the last vector. So what you actually need to do is to store them in 3 different variables or an array:
Rule Name “VECTOR = Z = JUMPAREA”
EVENT ONGOING - GLOBAL
Action
SET GLOBAL VARIABLE AT INDEX(Z, 0, VECTOR(X1,Y1,Z1))
SET GLOBAL VARIABLE AT INDEX(Z, 1, VECTOR(X2,Y2,Z2))
SET GLOBAL VARIABLE AT INDEX(Z, 2, VECTOR(X3,Y3,Z3))
You also need to create 3 effects and icons instead of 1:
Rule Name “CREATE EFFECT Z”
ONGOING - GLOBAL
Action
CREATE EFFECT(ALL PLAYERS(ALL TEAMS), RING, GREEN, VALUE IN ARRAY(GLOBAL VARIABLE(Z), 0), 2, VISIBLE TO POSITION AND RADIUS)
CREATE ICON(ALL PLAYERS(ALL TEAMS), VALUE IN ARRAY(GLOBAL VARIABLE(Z), 0), ARROW: UP, VISIBLE TO AND POSITION, GREEN, TRUE)
CREATE EFFECT(ALL PLAYERS(ALL TEAMS), RING, GREEN, VALUE IN ARRAY(GLOBAL VARIABLE(Z), 1), 2, VISIBLE TO POSITION AND RADIUS)
CREATE ICON(ALL PLAYERS(ALL TEAMS), VALUE IN ARRAY(GLOBAL VARIABLE(Z), 1), ARROW: UP, VISIBLE TO AND POSITION, GREEN, TRUE)
CREATE EFFECT(ALL PLAYERS(ALL TEAMS), RING, GREEN, VALUE IN ARRAY(GLOBAL VARIABLE(Z), 2), 2, VISIBLE TO POSITION AND RADIUS)
CREATE ICON(ALL PLAYERS(ALL TEAMS), VALUE IN ARRAY(GLOBAL VARIABLE(Z), 2), ARROW: UP, VISIBLE TO AND POSITION, GREEN, TRUE)
Then you have 2 different ways to check for when a player enters these areas. You can use 3 rules with “distance between” for each vector, or you can do it in a single rule like this:
Rule Name “Near Z = Jump”
Condition
- is true for any(global variable(Z), compare(distance between(current array element, event player), <, 2)) == true
Action
APPLY IMPULSE(EVENT PLAYER, UP, 25, TO WORLD, CANCEL CONTRARY MOTITION)
How long did it take you to know this all things? Thank you very Much!
Im afraid to Ask, but did you now how i can pick up the Orbs?
And had it to my " Inventory " (HERO ICON?)i want press interact to activate their effect with it … The Frozen Orb for Example …
If im look into the Workshop Gamemode “Endgame” im very confused ….
QWKJW
ik its a pain in the … im realy understand if you didnt wanna help here xD
A few years of programming experience, a few weeks with the workshop and a few month in the workshop forum
This is actually quite simple. You need to edit the “Near orb A = frozen” rule to increase a player variable that represents the amount of orbs a player has picked up:
Rule Name “Near ORB A = FROZEN”
EVENT ONGOING - EACH PLAYER
TEAM ALL
PLAYER ALL
Condition:
{
DISTANCE BETWEEN(EVENT PLAYER, GLOBAL VARAIBLE(A))< 3
}
Action:
{
modify player variable(event player, O, add(1))
}
Then you make another rule where you consume one of the orbs with interact:
rule name "use freeze orb"
event ongoing - each player
team all - player all
condition:
- is button held(event player, interact) == true
- player variable(event player, O) > 0
action:
- modify player variable(event player, O, subtract(1))
- set status(filtered array(players within radius(position of(event player), 20, all teams, off), compare(current array element, !=, event player)), null, frozen, 3)
No worries, you dont ask for anything complicated. And about the “endgame” mode … I havent take a look into it, but debugging (and understanding) workshop codes is quite hard sometimes because of the absense of custom variable names, objects and comments.
No worries, I wont bite … probably
Edit:
I make a guess and say the next thing you need for your mode is to dynamically spawn multiple orbs
WoW nice yes, i worked on a FFA mode and im already finished , so my next step is working on a teamdeathmatch… i can give you all idea´s next post if you want
How i can pick up the orbs ? i mean that Thing About hero Icon etc did you now that ? because it more mobile to use than with interact
I can Share YOU the Code if you want, add me if you want Alwayspo1nts#2192