#(pesce1234) Points around

40 messages · Page 1 of 1 (latest)

pale scroll
#

I can use .points_around x,y,z but how to custom points around direction

Im trying to make when player is holding an item, a particle circle appears at player's eye location

native oceanBOT
#

(pesce1234) Points arround

native oceanBOT
#

Hi I'm AutoThreadBot! Don't mind me, I'll just be adding the helper team to this thread so they can see it. A human will get to you soon.

pale scroll
#

(pesce1234) Points around

tropic quest
#

Here you go!

effect_monitor_world:
    debug: true
    type: world
    events:
        after player scrolls their hotbar item:stick:
            - define points <player.location.above[1.7].points_around_y[radius=3;points=16]>
            - foreach <[points]> as:point:
                - playeffect at:<[point]> effect:dragon_breath

Basically we want to iterate through the list that is provided from points_around_y.

As you can see in the example script we just store it in a temporary variable and use a foreach loop to iterate through it.

#

I found that 1.7 blocks above the player's location is eye height. You might feel the need to lower it slightly.

pale scroll
tropic quest
#

Try the facing vector and do around z

#

I am not at my computer anymore but that's what I would try

#

It's probably something like player.facing.forward[x] but I don't have the docs

tropic quest
#
    debug: true
    type: world
    events:
        after player scrolls their hotbar item:stick:
            - define points <player.location.forward[5].above[1.7].points_around_x[radius=4;points=20]>
            - foreach <[points]> as:point:
                - playeffect at:<[point]> effect:damage_indicator offset:0

            - define points <player.location.forward[9].above[1.7].points_around_x[radius=4;points=20]>
            - foreach <[points]> as:point:
                - playeffect at:<[point]> effect:damage_indicator offset:0

            - define points <player.location.forward[13].above[1.7].points_around_x[radius=4;points=20]>
            - foreach <[points]> as:point:
                - playeffect at:<[point]> effect:damage_indicator offset:0```
tropic quest
pale scroll
tropic quest
#

I was gonna write my own function for it that you can call anywhere but I'm struggling to remember all the denizen syntax 😅

#

I opened another thread on it to ask for help because I'm not actually a helper here, just saw you were looking for help and figured I'd try to help.

tropic quest
#

No worries, I'll try to figure it out and get back to you with what I find!

tropic quest
#

I'll be honest, I'm struggling quite a bit here.

effect_monitor_world:
    debug: true
    type: world
    events:
        after player scrolls their hotbar item:stick:
            - define location <player.location.above[1.7].forward[5]>
            # input location, amount, radius
            - define points <proc[points_procedure_script].context[<[location]>|30|4]>
            - foreach <[points]> as:point:
                - playeffect at:<[point]> effect:damage_indicator offset:0 quantity:1

points_procedure_script:
    debug: true
    type: procedure
    definitions: location[location with direction]|amount[number of points]|radius[size of circle]
    script:
    # Empty Container
    - define points <list>
    # Calculate Angle Step amount in radians.
    - define angle_step_radians <element[2].mul[<util.pi>].div[<[amount]>]>

    - repeat <[amount]>:
        # Get this element's rotation amount in radians based on the step amount and index of loop.
        - define angle_radians <[value].mul[<[angle_step_radians]>]>
        # Define the rotation vector's coordinates.
        - define x <[angle_radians].cos.mul[<[radius]>]>
        - define y <[angle_radians].sin.mul[<[radius]>]>
        - define z 0
        # Rotate the new point around the original location.
        - define direction <[location].normalize>
        - define rotated <[direction].rotate_around_x[<[x]>].rotate_around_y[<[y]>].rotate_around_z[<[z]>].add[<[location]>]>
        - define points <[points].include[<[rotated]>]>

    - determine <[points]>
#

I'll post what I have

#

But maybe you or someone else can take a look because I've been looking at this for a few hours now and I'm pretty sure I need to write my own rotation matrix script to make this work

#

You might be better off making a feature request.

#

What I wrote, well, it's not really working at all in its current state so maybe a helper can take a peak for you.

From what I can tell something is getting converted back into world coordinates instead of "local" coordinates.

I end up with a non-rotating messed up partial sphere.

pale scroll
tropic quest
#

Yeah it's a little tricky to figure this problem out. It's more than likely a feature request if I'm being 100% but there is absolutely a way to do it via script.

#

Best of luck!

pale scroll
#

I dont know if this help

tropic quest
#

The only two relevant functions in the documentation were

rotate_around_x/y/z and

points_around_x/y/z

#

Points around does not return a "local" result it uses the world coordinate without any rotation info to generate the points which is why it doesn't update the rotation in the first example.

#

Rotate around rotates a vector by the provided angle which saves you from writing a function however it doesn't use radians which is what's messing me up because the sample code I found online wants to write a rotation matrix function and using radians as inputs

#

Someone with more denizens scripting experience can definitely fix this up maybe I'll tackle it again if noone tries but I've also noticed my method of doing it manually is very expensive.

lofty zenith
#

@pale scroll do you still need help

tight storm
#

If not,

reef trailBOT
#
Thread Closing Reminder

Has your issue been resolved, or your question been answered?
If so, please use the </resolved:1028673926114594866> command to close your thread.
Or </invalid:1028673926898909185> if it's not possible to resolve.

If not yet resolved, please reply below to tell us what you still need.

(Note that if there is no reply for a few days, this thread will eventually close itself.)

#

@pale scroll

reef trailBOT
#
Resolved

Thread closed as resolved.

reef trailBOT
#
Thread Reopened

Thread was manually reopened by @stable flume.