And that's all I'd want the program to do... cough that figure up... for those that do play FFXIII and are wondering about upgrading when a item comes in at level 9 for example... no worries, you simply use the next level as the base level and remove 10 levels from your rank input...
Anyway, does anyone understand ok? so is anyone up to the task? If you feel generous you could release the code so I might be able to tweak it later.
Thanks for any considerations...
ps... just for final notes... I don't think you'll need more than 99 ranks... most I've seen so far is 91... and I wouldn't think we'd need over 9,999,999. final output... possibly even 999,999 but I don't want to take the chance lol
~Yes I am a Kiwi, No, I did not appear as an extra in 'Lord of the Rings'~ 1x AmigaOne X5000 2.0GHz 2gM RadeonR9280X AOS4.x 3x AmigaOne X1000 1.8GHz 2gM RadeonHD7970 AOS4.x
Newbase = Base + Amount TotalExp = TotalExp + Newbase Base = Newbase Print TotalExp
next i
I dont have an OS4 machine, so it was hard to find a programming language that would work. Windows sdlBasic Version 20051016, Jul 12 2007 23:44:09, based upon SciTE Version 1.64, December 1998-June 2005.
Here is a quick SDL Basic Program I made : Base = 0 Newbase =0 TotalExp = 0
fPrintS("Please Enter Base exp :") BaseInput$ = zoneInputS( 23, 0, 10, "" )
fPrintS("Please Enter Random Amount :") RAmountInput$ = zoneInputS( 28, 1, 10, "" )
Thats great but I think I'd need to edit the c code then recompile it then execute it for the answer?
I was thinking more of the program prompts you for a base rate then prompts you for a random value then prompts you for a rank...
THEN it calculates this and spits out the total exp value
The 800 120 and 12 were off the top of my head to illustrate the logic
I do like the look of the code though!
Thanks!
~Yes I am a Kiwi, No, I did not appear as an extra in 'Lord of the Rings'~ 1x AmigaOne X5000 2.0GHz 2gM RadeonR9280X AOS4.x 3x AmigaOne X1000 1.8GHz 2gM RadeonHD7970 AOS4.x
I must say that that looks very complete trouble is I'm not sure I can compile SDL language?
I thought of another way to calculate it too... since it increases the same amount each time... you could do this...
12 x 800 = 9600
then... to get from level 2 to level 12 it would be
1 + 2 +3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 =
66 x 180 = 11880
9600 + 11880 = 21480
Maybe this example would be easier to code?
Thanks for any interest
~Yes I am a Kiwi, No, I did not appear as an extra in 'Lord of the Rings'~ 1x AmigaOne X5000 2.0GHz 2gM RadeonR9280X AOS4.x 3x AmigaOne X1000 1.8GHz 2gM RadeonHD7970 AOS4.x
If that dont work I can quickly make an Amos version - I dont know if you want a classic/OS3 program.
I only have Windows / AmigaOS 3 here.
edit: the c code edit 2 few changes from abalaban - thanks :)
#include <stdio.h>
void main() { int base, amount, rank, total=0;
printf("Input base : "); scanf("%d", &base); printf("\nInput Random amount: "); scanf("%d", &amount); printf("\nInput rank: "); scanf("%d", &rank);
total = (rank * (rank+1))/2;
printf("\nExperience is :%d\n", total*amount + rank*base); }
Edited by angelheart on 2010/4/13 10:03:12 Edited by angelheart on 2010/4/13 10:04:35 Edited by angelheart on 2010/4/13 16:21:33 Edited by angelheart on 2010/4/13 16:26:46
I'm impressed by the effort I will certainly check it out when I get home from work!
Thanks very much!
~Yes I am a Kiwi, No, I did not appear as an extra in 'Lord of the Rings'~ 1x AmigaOne X5000 2.0GHz 2gM RadeonR9280X AOS4.x 3x AmigaOne X1000 1.8GHz 2gM RadeonHD7970 AOS4.x
I will look at your work Angelheart, thank you for all your hard work and consideration!
~Yes I am a Kiwi, No, I did not appear as an extra in 'Lord of the Rings'~ 1x AmigaOne X5000 2.0GHz 2gM RadeonR9280X AOS4.x 3x AmigaOne X1000 1.8GHz 2gM RadeonHD7970 AOS4.x
should equal 21480 like in my above post... in yours it's 20680
please check the code?
sorry but it looks awesome! heh
edit:
oh I see what's happened... you just haven't added in the base amount (lvl 1 800 amount... the calculator adds lvl2 to lvl12 though)... I can live with that...
THANKS!!!!!
The picture etc is just the crowning cosmetics
~Yes I am a Kiwi, No, I did not appear as an extra in 'Lord of the Rings'~ 1x AmigaOne X5000 2.0GHz 2gM RadeonR9280X AOS4.x 3x AmigaOne X1000 1.8GHz 2gM RadeonHD7970 AOS4.x
I'll see what I can do when I get home later today, again thanks for your time!
and ZeroG for sharing his knowledge!
~Yes I am a Kiwi, No, I did not appear as an extra in 'Lord of the Rings'~ 1x AmigaOne X5000 2.0GHz 2gM RadeonR9280X AOS4.x 3x AmigaOne X1000 1.8GHz 2gM RadeonHD7970 AOS4.x
It's quite simple to use a structure for this and, more from this, we can remove virtually the 800 base amount
Sample using C:
struct WeaponSTRUCT{
int BaseAMOUNT; // Used for virtual amount for level 1
int LevelUPAmount; // 1 level contain this amount of XP.
int TrueXP; // Real Experience point
}
typedef WeaponSTRUCT MyWeaponTYPE;
MyWeaponType MyTestWeapon;
// Used to define base and random number for level up
void Setup_Weapon( int Base, int RandomLEVEL ){
MyTestWeapon.BaseAmount = Base;
MyTestWeapon.LevelUPAmount = RandomLEVEL;
MyTestWeapon.TrueXP = 0;
}
// Used to add XP amount to weapon
void AddXPToWeapon( int XPAmount ){
MyTestWeapon.TrueXP = MyTestWeapon.TrueXP + XPAmount;
}
// Get final XP to display
int GetDisplayXP( void ){
int FinalXP = MyTestWeapon.TrueXP + MyTestWeapon.BaseAmount;
return FinalXP;
}
// Get actual weapon level
int GetDisplayLevel( void ){
int FinalLevel = 0;
if (MyTestWeapon.LevelUPAmound != 0 ){
FinalLevel = ( MyTestWeapon.TrueXP / MyTestWeapon.LevelUPAmount ) + 1;
}
return FinalLevel;
}
// return the amount of XP within the actual level.
inf GetDisplayLevelXP( void ){
int XPToShow = 0;
if (MyTestWeapon.LevelUPAmound != 0 ){
// Round to int needed for next calculation
Int FinalLevel = MyTestWeapon.TrueXP / MyTestWeapon.LevelUPAmount;
XPToShow = MyTestWeapon.TrueXP - ( FinalLevel * MyTestWeapon.LevelUPAmount );
}
return XPToShow;
}
I hope it'll help ;)
I've made this code in 10 minutes directly on the web browser so, some errors can exist ...
EDIT : Ami603 : Nice piece of code :p Useful to show how to initialize/clean some OS4 components :)
Kindest Regards, AmiDARK.
Edited by freddix on 2010/4/14 22:40:34
All we have to decide is what to do with the time that is given to us.
I think I understand what you mean but the base amount of 800 was just an example...
regardless of how you code it you still need a starting figure whether that is 800 and called base amount or 1220 and called the total exp need to go from level 0 to level 1 or whatnot whoknows etc etc
The base amount could be 0 for example and the random amount is 5 to go to level 6 you'd need 75 exp...
The base amount in regards to this game is basically the exp you need to raise from 0 level to level 1... I think perhaps I should have explained it that way in my opening post
Thanks for your interest
I can't code, I can only compile :-p so your structure is probably no good to me
~Yes I am a Kiwi, No, I did not appear as an extra in 'Lord of the Rings'~ 1x AmigaOne X5000 2.0GHz 2gM RadeonR9280X AOS4.x 3x AmigaOne X1000 1.8GHz 2gM RadeonHD7970 AOS4.x
@Slayer In my sample the base amount can be changed. But if you need it in your program for tests (level 0 or >), it can be easily included in the system :
This is just a "sample of use". It is probably not suited for your exacts needs ;)
struct WeaponSTRUCT{
int BaseAMOUNT; // Used for virtual amount for level 1
int LevelUPAmount; // 1 level contain this amount of XP.
int TrueXP; // Real Experience point
}
typedef WeaponSTRUCT MyWeaponTYPE;
MyWeaponType MyTestWeapon;
// Used to define base and random number for level up
void Setup_Weapon( int Base, int RandomLEVEL ){
MyTestWeapon.BaseAmount = Base;
MyTestWeapon.LevelUPAmount = RandomLEVEL;
MyTestWeapon.TrueXP = 0;
}
// Used to add XP amount to weapon
void AddXPToWeapon( int XPAmount ){
MyTestWeapon.TrueXP = MyTestWeapon.TrueXP + XPAmount;
}
// Get final XP to display
int GetDisplayXP( void ){
int FinalXP = MyTestWeapon.TrueXP;
return FinalXP;
}
// Get actual weapon level
int GetDisplayLevel( void ){
int FinalLevel = 0;
if (MyTestWeapon.LevelUPAmount != 0 ){
FinalLevel = ( ( MyTestWeapon.TrueXP - MyTestWeapon.BaseAMOUNT ) / MyTestWeapon.LevelUPAmount ) + 1;
}
return FinalLevel;
}
// return the amount of XP within the actual level.
inf GetDisplayLevelXP( void ){
int XPToShow = 0;
if (MyTestWeapon.LevelUPAmount != 0 ){
// Round to int needed for next calculation
Int FinalLevel = ( MyTestWeapon.TrueXP - MyTestWeapon.BaseAMOUNT ) / MyTestWeapon.LevelUPAmount;
XPToShow = ( MyTestWeapon.TrueXP - MyTestWeapon.BaseAMOUNT )- ( FinalLevel * MyTestWeapon.LevelUPAmount );
}
return XPToShow;
}
All we have to decide is what to do with the time that is given to us.