Quote: "Hmm... It looks like someone is, for what ever reason, using 5 variables for the price of one :p
If timer is still global, and resets to timer causes issues... then the only point to that script is to allow make makeshift programing instead of strong procedural programming."
Hmm, seems like someone doesn't have a clue about what this script is for if they can't unsderstand why its using 5 variables.
The only problem with my script is the usage.
Of course you will have a conflict if you have other scripts modifying the global timer.
Of course you will need to write a different script or modify this one to get results other than those intended by its design.
This timer script was written for a specific function, and it works perfectly as it was intended with proper usage.
This script was intended to create a system to allow for 5 independent timers (even seconds only) using the one global timer that is provided with the stock engine.
If you use other scripts that reset the global timer, then YES, you will have a conflict and I have explained the scripts usage many times in the forums.
The whole point of this script was to use variables as timers independently without having multiple scripts using the global timer. (you could have many more than 5)
You reset each timer outside of this script (setvar=0 in other scripts to reset them) but you never mess with the global timer.
This should be the only script in your game that uses the global timer if you are using this script.
The purpose of it is to allow multiple timers, which it does, by incrementing the 5 variables once each second.
You simply read that variables value to determine how many seconds have past since you reset that paticular timer (that variable).
Quote: "A) Timer may be global, but the script is not. You need to have the script follow you in the form of an entity because script processing is based on the distance the player is from a running script."
That is why the entity using the TImer script has it ALWAYS ACTIVE set to YES, then the distance doesn't matter.
Quote: "But thats rather weak coding.If someone were to use globalvar=0 for themselves then we'd run into a few problems... lets fix it"
There is no fix for having two scripts using the same variable.
That is a conflict no matter how weak or strong the code is, and the only fix for that is to use a different variable for one of the scripts so there is no conflict.
Quote: "then the only point to that script is to allow make makeshift programing instead of strong procedural programming"
Makeshift?
Yes!
This script was a work around for the lack of multiple timers in the stock engine, and it served its purpose well for me.
Sorry I troubled you all without my makeshift code by sharing.
Quote: "this code forces globalvar=0 to always be the correct value. It say screw you to anyone who attempts to modify it, and will never fail any script that uses said timer, unless there exists another script using timer (which, I assume, was the point of your script)."
That is my point, no matter what you do, if you have another script starting the global timer then any change to this is in vain.
There is no fix for the problem he had, other than getting rid of this or the conflicting script.
You are attempting to fix something when you are assuming its purpose.
The fact is, that it works fine for what it was intended to do as it is, IF you use it properly.
Please, do not say that my script should be written another way if you don't know what it is for or you do not know how to use it properly.
Could be coded differently, yes, should be, no.
I am capable of coding in FPI, and when I need help I will ask for it.
If you want to modify my script or write your own that is better, then fine, but don't tell me how I should code.
Quote: "Hmm, you seem to have some influence conjured."
Not much.