The Daily Click ::. Forums ::. Klik Coding Help ::. Desimal numbers (Lol i hope you understand)
 

Post Reply  Post Oekaki 
 

Posted By Message

EleXor



Registered
  21/01/2003
Points
  269
5th May, 2004 at 10:33:18 -

I don't know what numbers like 1.2, 6.7 or 8.14 are as english, so I call them desimal (They are "Desimaali" as my country...)
So i ask, because I got this following experience system:
Only one action when event loops +
Counter(Exp) is = or => Counter(Exp needed)-> Add 1 to counter level, Set Counter(Exp) to Counter(exp)"value" x 2)

So it's Quite dull, because I wan't 99 to max level, And I calculated it, lol, it was toooooooooo big number. Is there anyway to make it like:
Counter(Exp) is = or => Counter(Exp needed)-> Add 1 to counter level, Set Counter(Exp) to Counter(exp)"value" x 1.2)
Cheers, I hope you understand


 
n/a

Kramy



Registered
  08/06/2002
Points
  1888
5th May, 2004 at 12:52:55 -

In English they're written as "decimals", but sound like "desimals". Basically the same.

You could reset "counter(exp)" every time you gain a level.

Counter(exp) => Counter(exp needed)
--Add 1 to Counter(level)
--Set Counter(exp) to 0;
--Add Counter(exp needed)+(Counter(exp needed)/2) to Counter(exp needed)

If Counter(exp needed) is 10
Counter(exp needed)+(Counter(exp needed)/2) = 15

If Counter(exp needed) is 15
Counter(exp needed)+(Counter(exp needed)/2) = 15+7 = 22

 
Kramy

Assault Andy

Administrator
I make other people create vaporware

Registered
  29/07/2002
Points
  5686

Game of the Week WinnerVIP Member360 OwnerGOTM JUNE - 2009 - WINNER!GOTM FEB - 2010 - WINNER!	I donated an open source project
6th May, 2004 at 05:28:25 -

Or you could have three counters (one for level, one for exp, one for needed exp)

Then

Always set level.val to exp.val\needed exp.val

Then whenever you need to change the amount of experience you need for the next level just change the needed exp. (This system means you have need the same amount of experience for each level. This could be changed with differant code though)

 
Creator of Faerie Solitaire:
http://www.create-games.com/download.asp?id=7792
Also creator of ZDay20 and Dungeon Dash.
http://www.Jigxor.com
http://twitter.com/JigxorAndy

RapidFlash

Savior of the Universe

Registered
  14/05/2002
Points
  2712
6th May, 2004 at 19:44:34 -

Don't counters, well, hold only integers?
If you're having a problem with counters and decimals, then use Alterable Values.

 
http://www.klik-me.com

Evil Monkey



Registered
  08/12/2002
Points
  598
7th May, 2004 at 07:22:30 -

It's easy to use decimals in an expression. Just add .0 to the end of any number in the expression.

 
Project Progress:

1.: Droid Runner (5% Complete)
Finishing Up Game Engine

EleXor



Registered
  21/01/2003
Points
  269
7th May, 2004 at 09:36:28 -

Hmm sounds snacksy Thanks folks!
"It's easy to use decimals in an expression. Just add .0 to the end of any number in the expression."

It just said cannot understand

Image Edited by the Author.

 
n/a

Kramy



Registered
  08/06/2002
Points
  1888
7th May, 2004 at 18:41:54 -

Integer = 1
Integer = 4
Decimal = 1.8
Decimal = 4.0

1/2 = 0
4/2 = 2
1.0/2 = 0.5
4.0/2 = 2.0

 
Kramy

EleXor



Registered
  21/01/2003
Points
  269
8th May, 2004 at 08:08:31 -

Actually, I understand decimals but tgf said that doesn't understand expression

 
n/a

EleXor



Registered
  21/01/2003
Points
  269
8th May, 2004 at 08:15:40 -

Did i forgot to mention that i use TGF??

 
n/a

ChrisB

Crazy?

Registered
  16/08/2002
Points
  5457
8th May, 2004 at 08:29:33 -

Dustin: Counters aren't doubles (they're floats - single precision) and alterable values can store floats.


EleXor: You can't use them in TGF. Multiply your numbers by 100 if you want greater accuracy.

 
n/a

EleXor



Registered
  21/01/2003
Points
  269
8th May, 2004 at 13:54:08 -

That's a good idea!

 
n/a
   

Post Reply



 



Advertisement

Worth A Click