Why are all vitals set in hundredths?
Moderator: POL Developer
- MontuZ
- Forum Regular
- Posts: 338
- Joined: Fri Feb 10, 2006 8:08 am
- Location: Myrtle Beach, South Carolina
Why are all vitals set in hundredths?
Just curious, I can't seem to find any real point to it.
Clarify it for me?
Clarify it for me?
Re: Why are all vitals set in hundredths?
So that vitals can be incremented by fractions instead of whole numbers.
For example, a game is level based, and each level, the character's hitpoints go up by 1.5.
Level 1: 10 (10)
Level 2: 11 (11.5)
Level 3: 13 (13)
Level 4: 14 (14.5)
For example, a game is level based, and each level, the character's hitpoints go up by 1.5.
Level 1: 10 (10)
Level 2: 11 (11.5)
Level 3: 13 (13)
Level 4: 14 (14.5)
Re: Why are all vitals set in hundredths?
That one puzzles me greatly. Why couldn't they just be float or something.
Actually I came across numerous of bugs because of this.
Actually I came across numerous of bugs because of this.
Re: Why are all vitals set in hundredths?
Came across, or caused? If its "came across" then let us know so we can fix them in the Distro.
In POL, reals are stored as doubles, integers as longs. The size required by each variable is thus half, and the computing time of int math is much faster than float math. Still, if using hundredths is confusing, I would suggest a function like the following:
Pass it a whole number or float, and you wont have to worry about it.
In POL, reals are stored as doubles, integers as longs. The size required by each variable is thus half, and the computing time of int math is much faster than float math. Still, if using hundredths is confusing, I would suggest a function like the following:
Code: Select all
function ToVitalValue(val)
return CInt(CDbl(val) * 100);
endfunction
Re: Why are all vitals set in hundredths?
We aren't based on distro, so I can't really know if there are any problems in it. I just wanted to point out that thats probably the most confusing thing I ever encountered and leads to many scripters with POL92 background (me including) to creating bugs. Anyway if you beleive in such things as computing time these days, doesn't it make it even slower if you convert values via escript?
-Cheers
PS: Thanks for the tips Luth.
-Cheers
PS: Thanks for the tips Luth.
Re: Why are all vitals set in hundredths?
Having made games for handheld systems like the DS, which uses fixed-point math for its calculations, yes, I believe in computing speed. But that's me.
Please remember that its entirely possible, and likely a good idea, to write wrapper functions for many of these operations. I, and likely most others I would think, have an "attributes.inc" file that has such functions as "SetHp" which take floats and convert them to hundredths-ints internally. It allows for the bug-free and easy-to-understand coding everywhere else in the project that you desire. If you dont have one of these available, I'm sure either Distro has one, or I can send you mine to edit to your needs.
Please remember that its entirely possible, and likely a good idea, to write wrapper functions for many of these operations. I, and likely most others I would think, have an "attributes.inc" file that has such functions as "SetHp" which take floats and convert them to hundredths-ints internally. It allows for the bug-free and easy-to-understand coding everywhere else in the project that you desire. If you dont have one of these available, I'm sure either Distro has one, or I can send you mine to edit to your needs.
-
- Distro Developer
- Posts: 2825
- Joined: Thu Feb 02, 2006 1:41 pm
- Location: San Antonio, Texas
- Contact:
Re: Why are all vitals set in hundredths?
I am glad there are still programmers who are concerned with "time", ie. processor cycles.
Re: Why are all vitals set in hundredths?
Well I am concerned about CPU cycles as well, but if I choose between getting something done (probably not the fastest way possble), or posponding it to laters because it will take forever to do it the elegant way. I'd choose to have it now. Isn't that the reason they actually invented high level languages, like Java or Python?
Re: Why are all vitals set in hundredths?
Well first remember that POL is 12 years old. Do you remember what we were running on 12 years ago?
Second, what you want is fully at your disposal, by either writing it (5 mins, tops) or downloading it (30 secs, tops). Either way, you're covered by what POL and its community has provided. Cheers!
Second, what you want is fully at your disposal, by either writing it (5 mins, tops) or downloading it (30 secs, tops). Either way, you're covered by what POL and its community has provided. Cheers!
- MontuZ
- Forum Regular
- Posts: 338
- Joined: Fri Feb 10, 2006 8:08 am
- Location: Myrtle Beach, South Carolina
Re: Why are all vitals set in hundredths?
I just get confused with the vital functions;
Oh shit, what do I have to divide/multiply this by again? 100, 1000? *Checks docs*
Do I have to do any extra math with this vital function? *Checks docs*
I mainly rely on short term memory when scripting, I forget things =)
Oh shit, what do I have to divide/multiply this by again? 100, 1000? *Checks docs*
Do I have to do any extra math with this vital function? *Checks docs*
I mainly rely on short term memory when scripting, I forget things =)
Re: Why are all vitals set in hundredths?
Well then do what us old guys do, write a function to do that stuff for us, and never mess with Vitals directly again!
-
- Distro Developer
- Posts: 2825
- Joined: Thu Feb 02, 2006 1:41 pm
- Location: San Antonio, Texas
- Contact:
Re: Why are all vitals set in hundredths?
Oh Luth!
You have an answer for everything don't you?
*grins*
You have an answer for everything don't you?
*grins*
Re: Why are all vitals set in hundredths?
I... I don't know.