The Daily Click ::. Forums ::. Klik Coding Help ::. Extension that allows handling of numbers with decimals ?
 

Post Reply  Post Oekaki 
 

Posted By Message

BattleCat



Registered
  08/09/2002
Points
  978

VIP MemberThe Cake is a LieIt's-a me, Mario!Wii OwnerPokemon Ball!
23rd July, 2003 at 15:29:27 -

I need an extension for Tgf that allows stuff numbers to be handled. I wanna do the % equation, like

5/30*100
(5/30 = 0.16 and that's causing the trouble for me)

can anyone name one for me ? and maybe link me as well ?

 
n/a

Shen

Possibly Insane

Registered
  14/05/2002
Points
  3497
23rd July, 2003 at 15:37:02 -

MMF allows decimals, though if you have an occult religion that forbids using computer programs with a U in them or something, Advanced Math might do the trick, but I've never used it.
What are stuff numbers?

 
gone fishin'

BattleCat



Registered
  08/09/2002
Points
  978

VIP MemberThe Cake is a LieIt's-a me, Mario!Wii OwnerPokemon Ball!
23rd July, 2003 at 16:59:58 -

Heh, stuff numbers = stuff like mana, health points and stuff whose values are stored in counters....



I've tried the MMF demo several times and it just doesn't seem to stick. But i'm probably gonna have to buy it anyway since it's just better technologically speaking (don't like the layout, and the frame editor alone makes me wanna puke!)

 
n/a

Aali [Crazy_Productions]



Registered
  13/10/2002
Points
  843
23rd July, 2003 at 17:05:50 -

just use large numbers... 5000/30000 = 160

 
"If Darl McBride was in charge, he'd probably make marriage unconstitutional too, since clearly it de-emphasizes the commercial nature of normal human interaction, and probably is a major impediment to the commercial growth of prostitution."
-- Linus Torvalds, December 5th 2003.

(Darl McBride is CEO of The SCO Group)


this place sucks but don't tell anyone, it's our little secret, ok?

Aali [Crazy_Productions]



Registered
  13/10/2002
Points
  843
23rd July, 2003 at 17:08:27 -

sorry i meant 5000/30 = 166

 
"If Darl McBride was in charge, he'd probably make marriage unconstitutional too, since clearly it de-emphasizes the commercial nature of normal human interaction, and probably is a major impediment to the commercial growth of prostitution."
-- Linus Torvalds, December 5th 2003.

(Darl McBride is CEO of The SCO Group)


this place sucks but don't tell anyone, it's our little secret, ok?

BattleCat



Registered
  08/09/2002
Points
  978

VIP MemberThe Cake is a LieIt's-a me, Mario!Wii OwnerPokemon Ball!
23rd July, 2003 at 17:20:29 -

yeah, that'll work for now, thx but it's very inaccurate due to the rounding up/down that Tgf does...but it works But i'm certain there's a plugin allows direct use of decimals......there must be

 
n/a

Pkeod

Oontz Oontz Oontz

Registered
  19/11/2002
Points
  93

VIP Member
23rd July, 2003 at 19:31:35 -

SURIVor

 
Faerie Solitaire - Get it now:

http://www.create-games.com/download.asp?id=7792

ShadowCaster

Possibly Insane

Registered
  02/01/2002
Points
  2203
23rd July, 2003 at 20:16:58 -

MMF allows decimals... though by default numbers will be integers. What you need to do is make your expressions use FP numbers in the calculation. If, for example, you want to divide two counters and get the FP result you could do something like this:

(Counter1 * 1.0) / Counter2

Which would convert Counter1 to a FP at the first operation, and for the second operation, since the result of the brackets is a FP, Counter2 would be converted to a FP as well. The counters themselves will remain integers (unless you set the result of the calculation back to one of the counters), but the result will always be a FP even if the number divides exactly.

Mike

 
"Now I guess we're... 'Path-E-Tech Management'" -Dilbert

DeadmanDines

Best Article Writer

Registered
  27/04/2006
Points
  4758
24th July, 2003 at 05:31:22 -

I'm pretty sure I managed to find a way some time ago to get percentages to work simply by arranging the equation differently.

Standard equation that textbooks teach you:

actual / total * fraction

However, you can get the same result from:

fraction * actual / total

The latter should hopefully not have the decimal problem because it involves the fraction (100 in the case of percentages) before the division.

Eg: For a score of 6 out of 23: (answers to 3dp)

Standard:
6/23 = 0.261
0.261 * 100 = 26.100%

The Other Way:
100*6 = 600
600 / 23 = 26.086%

(in this case, because we limitted ourselves to 3 decimal places, my method is actually more accurate)


 
191 / 9999 * 7 + 191 * 7

RapidFlash

Savior of the Universe

Registered
  14/05/2002
Points
  2712
24th July, 2003 at 11:22:44 -

Decimals can be weird in MMF, I tried making a custom movement with them and the one decimal I subtracted went a lot faster than the one I added. Just use big numbers.

 
http://www.klik-me.com

Jenswa

Possibly Insane

Registered
  26/08/2002
Points
  2722
24th July, 2003 at 12:54:21 -

Are u sure you need Floating points?
Advanced Math should do the trick.

ShadowCaster, do u get paid to convince to use (buy)
multimediafusion??

TGF works just as fine, although it's engine is a little out of date. And yes the interface of mmf isn't that neat.

Oh i am sorry you prolly didn't want my opinion,
but since SC gave his, i'll give mine.

 
Image jenswa.neocities.org

BattleCat



Registered
  08/09/2002
Points
  978

VIP MemberThe Cake is a LieIt's-a me, Mario!Wii OwnerPokemon Ball!
25th July, 2003 at 15:59:33 -

Can't someone PLEEASE make an example for me (in tgf) ? i've spent several days and i STILL can't get it to work. I'm getting _very_ frustrated ! plz !

 
n/a

Shen

Possibly Insane

Registered
  14/05/2002
Points
  3497
25th July, 2003 at 16:19:18 -

'TGF works just as fine, although it's engine is a little out of date'

And it can't allow decimals?

 
gone fishin'

Kris

Possibly Insane

Registered
  17/05/2002
Points
  2017
25th July, 2003 at 16:20:33 -

http://kris.acsv.net/example.gam

fully working example, compatible with tgf 1.06 and anything higher

 
"Say you're hanging from a huge cliff at the top of mt. everest and a guy comes along and says he'll save you, and proceeds to throw religious pamphlets at you while simultaniously giving a sermon." - Dustin G

BattleCat



Registered
  08/09/2002
Points
  978

VIP MemberThe Cake is a LieIt's-a me, Mario!Wii OwnerPokemon Ball!
25th July, 2003 at 16:33:02 -

what the... ? i'm very sure i tried that as well.....weird

 
n/a
   

Post Reply



 



Advertisement

Worth A Click