#long reload time

1 messages · Page 1 of 1 (latest)

smoky ruin
#

the skript takes 2.5 seconds to reload which is 2.2 seconds longer than other skript with similar size. Can someone tell me why?

neat pier
#

i'd guess its because you have a whole bunch of long lines

#

the every 1 tick: loop all entities: doesnt help either

smoky ruin
#

would it help if i put all the every 1 tick: in one skirpt and in one event?

#

from all skripts

#

the one above is with out the every 1 tick: the one below with

neat pier
#

I would make a function to freeze entities instead of looping all of them every tick

olive moth
#

yeaaa

#

looping like that is horrible

neat pier
#

its pretty easy too

olive moth
#

especially every tick

smoky ruin
#

doesnt a function get called multiple times for one entity if it gets frozen multiple times? So if i freeze an entity with a function 2 times, wont two functions run at the same time?

neat pier
#

you can check if they are already frozen

#

or just overwrite the last one

smoky ruin
#

can i also add them?

neat pier
#

increase the duration? yes

smoky ruin
#

ah

#

ok

#

so like i make a function with the UUID and the duration that gets added and then i add it and after that check if they are already frozen?

#

and if yes cancel it

neat pier
#

possible, yes

smoky ruin
#

and that would eliminate the extreme loop?

neat pier
#

it would yes

smoky ruin
#

ok

neat pier
#

but id say it wont shorten parse times by too much, as youre still doing a lot of heavy particle stuff.
you can put parentheses around this, but itll still be a bit slower than other scripts

smoky ruin
#

well all the skript have that meny particles

#

but this is the only one that takes so long

#

maybe because i set one particle shape on load and all the others have it in the event

#

do i cancel a function with stop or cancel event?

#

would this work

#
    if {hn.%{UUID}%::ice::freezetime} is not set:
        set {hn.%{UUID}%::ice::freezeloc} to location of {UUID}
        add {duration} to {hn.%{UUID}%::ice::freezetime}
        while {hn.%{UUID}%::ice::freezetime} > 0:
            teleport {UUID} to {hn.%{UUID}%::ice::freezeloc}
            remove 1 from {hn.%{UUID}%::ice::freezetime}
            draw shape {ice::freezer} at location 1 block above {UUID}
            wait 1 tick
        delete {hn.%{UUID}%::ice::freezetime}
        stop
    else:
        add {duration} to {hn.%{UUID}%::ice::freezetime}
        stop
#

?

#

it doesnt work

#

i call it with freeze(victim,3)

#

i need help

#

please

neat pier
#

UUID should be local

#

Not sure why you named it uuid either

smoky ruin