Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
  • 0
zaszthedestroyer

Decorate time delay(timer)

Question

hey guys! i find myself stuck in my attempts to create a timer to check for a stat, say player health, every few minutes or so.

 

i found the delay function in ACS but im actively trying for decorate. i figured a wait function may work but i find no trace of it on google or the zdoom wiki. can

anyone help me out here?

 

as an addendum, i do have a working form of this however, it checks far too often as i have it installed in the players state definitions, what i need specifically is a wait to delay the check for at at least 12 minutes, minimum.

Share this post


Link to post

6 answers to this question

Recommended Posts

  • 0

Maybe just add a really long state (like TNT1 A 25200) between checks? That's 12 minutes in tics or should be. I don't know if this will work in your situation though.

Share this post


Link to post
  • 0

nevander, thank you for your prompt response. it is well appreciated.

----

oops meant 2 minutes, but 12 may be necessary as well.Your solution may be of significant use, but i was hoping for a more succinct coding.

ie, A_DELAY, or A_WAIT, or A_PAUSE. it occurs to me these may be non-viable in decorate.

 

Expanding on my thought, the chief reason i want to use decorate instead of acs is because i need a game-wide scope (am i using scope correctly?) for this particular trait. and as far as i know, ACS is map-specific.

 

however, should i fail to find a pleasing solution, this will suffice.

@Nevander if you or anyone else knows of any mods that serve a similar function(as i the one i am looking for...), i would happily look into it myself.

Share this post


Link to post
  • 0

You can use a Global scope variable in ACS, maybe using a OPEN script, or maybe an ENTER script so it would work individually for each player. You could make an array with a separate counter for each player. That still leaves quite a few details for you to work out, but I hope I have pointed you in the right direction.

https://zdoom.org/wiki/Scope

https://zdoom.org/wiki/Script_types

Share this post


Link to post
  • 0

This is a little more like what i was looking for. it's been a while since i dabbled in acs but i know it can be much more verstiaile than decorate. I will

give both you and nevanders suggestions a try.

i suspect, great difficulties ahead.

 

EDIT:

what if instead of checking every few minutes, i have the system constantly check (silently) often to see when the health goes down, and then displays a message once it gets too low? it's a different approach, that would not require a timer, only a constant state...

 

Spawn:

play a 25200 A_Jumpifinventory("health",25,healthrisk) 

goto quietcheck //wouldnt this state cause it to loop? gott admit im a little lost here...

 

QuietCheck:

tnt1 a 1 A_jumpifinventory("Health",25,healthrisk)

tnt1 a 1 A_jumpifinventory("Health",50,healthokay)

tnt1 a 1 A_jumpifinventory("Health",100,healthperfect)//one could argue this is pointless if youre in good helath, //unless there is no hud?

 

so if i did this right, it would quietly check your health, then if youre ehalth is low, it would tell you...

 

i apologize for the messy format, its alot of unscripting thinking the script is mostly like what i got, with the exception of the quiet check routine.....

 

Edited by zaszthedestroyer

Share this post


Link to post
  • 0
12 hours ago, zaszthedestroyer said:

i was hoping for a more succinct coding.

ie, A_DELAY, or A_WAIT, or A_PAUSE.

 

Frame duration not only can be, but even has to be specified on every frame. Nothing could possibly be more redundant in DECORATE than a delay action function.

 

10 hours ago, zaszthedestroyer said:

what if instead of checking every few minutes, i have the system constantly check (silently) often to see when the health goes down, and then displays a message once it gets too low? it's a different approach, that would not require a timer, only a constant state...

 

Honestly, I don't understand why did you ever think that checking only once per few minutes was a better idea than this.

Share this post


Link to post
  • 0
9 hours ago, scifista42 said:

 

Honestly, I don't understand why did you ever think that checking only once per few minutes was a better idea than this.

checking once every few minutes was my first idea. i thought on it, and improved. and i intend only to improve them from here on, the suggestions here have been very helpful.

9 hours ago, scifista42 said:

 

Frame duration not only can be, but even has to be specified on every frame. Nothing could possibly be more redundant in DECORATE than a delay action function.

 

short answer: i was attempting to do what i know how to do.

 

long answer: i am certain, i did not properly understand you at first. but you are correct.

i have most recently done a lot of programming in things like python where delay, wait, and/or pause is easily the most useful tool there, for making simple codes.(to me) i understand, that DOOMs engine is old,  and therefore would not necessarily share any of these qualities, 

i was only going with what i know.

 

 

@scifista42 i would also like to add, when i would search a question, and find myself here, i have noticed you are often the one to answer the question correctly. 

i just wanted to say thank you. you have helped me more than you know. i have a great deal of respect for you.

 

 

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×