#(JustinS) fake experience bar that "reloads" constantly

48 messages ยท Page 1 of 1 (latest)

wicked dagger
#

Im trying to make a fake experience bar that basically acts as a reload bar, or, say, a mana bar.
Basically, at standard the bar is full and when the player does a specific thing (e.g. cast a spell), the fake xp bar drains a little.
Now, the thing I'm not so sure about is how can I make it constantly recharge?
Most programming languages have a loop() or update() function though does denizen have something similar too? Or is there a different way

rain yokeBOT
#

(JustinS) fake experience bar that "reloads" constantly

rain yokeBOT
#

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.

slow crescent
#

denizen has repeat, while, and foreach

#

or do you mean constantly like at all times?

#

if so, then you can use the delta time event

#

!e delta time

balmy barnBOT
# slow crescent !e delta time
Group

Core

Event Lines

delta time hourly|minutely|secondly

Switches

every:<count> to only run the event every *count* times (like "on delta time secondly every:5" for every 5 seconds).

Triggers

every <count> seconds, minutes, or hours of game calculation time. Default repetitions count of 1.
This is specifically based on the rate of time advancement in the game server,
which is not necessarily equivalent to the real passage of time (for example, this event may fire slower if the server is lagging).
For real time, see !event system time.

Context

<context.second> returns the exact delta time since system start.

slow crescent
#

secondly

#
on delta time secondly:
- repeat 20:
  - ...
  - wait 1t
#

this is better than using the on tick event, btw

#

@wicked dagger ping

wicked dagger
wicked dagger
slow crescent
#

yea

wicked dagger
#

๐Ÿ‘

slow crescent
#

you could have a script running once every second, to check who, of all the players online, needs a "reload"

#

and then make that - run another script who will then have a tick per tick increase, so it's smoother

#

ie

#
on delta time secondly:
- foreach <server.online_players.filter[has_flag[...]]> as:player: #Or whatever other logic
  - run script def.player:<[player]>
wicked dagger
slow crescent
#

i may have misinterpreted your intention

#

disregard that

wicked dagger
#

๐Ÿ‘

#

Ill try it out. Ill leave this open for now because I'm 90% sure I'll run into an error regarding this lol

hallow dew
balmy barnBOT
wicked dagger
#

How can I prevent my logs from spasming out like in the video when using

on delta time secondly:
- repeat 20:
  - ...
  - wait 1t```
#

I added the debug:false though that doesnt change anything in the logs ๐Ÿ˜•

cosmic wigeon
#

!debug

balmy barnBOT
# cosmic wigeon !debug
Info: debug

If you need help with a script issue, one of the most powerful tools Denizen has to offer is full debug output. This is displaying in your console whenever scripts are running until you turn debug off. To share a debug log quickly and easily with helpers, simply run the command /denizen debug -r in-game to begin recording, then run through the part of the script you need help with, then run the command /denizen submit. This will give you a link to a paste of the debug log, which you can then copy/paste back to us!

cosmic wigeon
#

Oh

#

you probably still have /denizen debug -o on

#

run this command again ^

wicked dagger
cosmic wigeon
#

no longer override

wicked dagger
#

Now Im just getting 19.9 every second lol

#

every tick

cosmic wigeon
#

Who knows what your script is doing

wicked dagger
#

I was just about to share it but my cat jumped on my laptop

cosmic wigeon
#
  • narrate <[player].flag[force_energy]>
#

You're narrating it

wicked dagger
#

why the hell am I doing that?

#

yup that fixes it

#

Thanks for noticing that