(Solved but needs more help) Creating a Moving Dome

Hello again, I’m currently creating a dome that moves (like the fire dome preset). The dome I’m creating is supposed to move every few minutes forcing players to reposition. The dome will move for a few seconds and then stop. The script I created moves the dome however its either delayed or doesn’t move at all. Now I experimented with “match time” and the “total time elasped” condition and I also used the “chase global variable at rate” action. Anyone can see what proper codes I should use?

Edit: I managed to solve the problem however if you can there is another problem located in another reply.

This will be the action you will likely want to use. Assuming that Global Variable(C) is the center of the dome, and Global Variable(T) is the next destination, you will want Global Variable(C) to chase the destination Global Variable(T) at any rate you like.

Edit: didn’t check the share code, will do that soon

Remind you, when I tested it with “total time elasped” let’s say for example the dome moves every minute, so after 60 seconds of elasped time the dome will move and a message will display. The message displayes but the dome doesn’t move, however it moves much seconds later. Just wanted to let you know

Edit: I may have found a solution to my problem

Keep in mind that vectors can chase vectors. Here is an example, where a white sphere follows each player.

5GQAK

Oh okay I see, when I was testing some things out it seemed like one reason why it seemed delayed was because the radius was probably to big, I had it at 300 and when I changed it back to 200 everything was fine. Thanks though, however another small problem, the dome is supposed to kill anyone that’s steps out. Again I created the script but players are dying even when there standing in the dome. I can send you the game code if you can check it out.

If global variable C is the center of the dome:

rule: ongoing - each player

condition:
- distance between(event player, global variable(C)) > 200

action:
- kill(event player, null)

See I have that it’s just instead of a global variable I just have the vector of the center of the dome. I’ll try a global variable instead though to see if it will work

If you used create effect(sphere, red, [42,42,42]) and not set global variable(C, [42,42,42]) --> create effect(sphere, red, global variable(C)), how are you able to move it then :face_with_raised_eyebrow:

Oh so I have a global variable (d) that is the radius of the sphere. I have a “chase global variable at rate” which is what moves the sphere.

I dont understand. Can you just type in the create effect action you are using?

Btw, this is how I suggest you to do it (if its not what you are doing already):

rule initialisation: ongoing - global

condition:
- none

action:
- set global variable(C, vector(42, 42, 42))
- set global variable(D, 200)
- create effect(all player(all teams), sphere, red, global variable(C), global variable(D), position and radius)
- chase global variable at rate(C, *whatever*)

You have direct access to the position and radius of the sphere and you can easily alter it later on.

Ok here is the scripts
Example 1

Event Ongoing Global
Condition
Global Variable (A) == 12

Action
Create Effect (All Players (All Teams), Sphere, White, Vector(28.628, 58.811, -156.895), Global Variable (D), Visible To Position And Radius)

Kills Players out of Dome

Ongoing Each Player
Condition
Distance Between (Event Player, Vector (28.868, 58.811, 156.885)) >= Global Variable (D)

Action
Kill(Event Player, null)

This moves the dome

Ongoing Global
Condition
Total Time Elasped < 60

Action
Set Global Variable (D,200)
Chase Global Variable At Rate (D,0,1, Destination and Rate) Wait (30, Ignore Condition) Stop Chasing Global Variable (D)

Ok, so by “moving the dome” you actually meant “making it smaller”.

If this is not a typo, you forgot the minus here.
If this is a typo, you can share your gamecode to look for bugs.

Oh yah that’s a typo, I did forget the minus sign there.

Then share your gamecode so we can directly look for bugs?

Still kinda need assistance with the code :grimacing: