Windows Setting Level Help

J

Jamie_Lobley

Guest
Hi I've currently got a working level system on a player. I want to use this system on other Objects(NPCs) though i'm just wondering what the best way to do this is. also is there a way to set the level but it also sets the stats aswell to that level. Thanks for any help or feedback.

This is my script EXP_Controller
Code:
//EXP Progression
if (EXP >= MaxEXP)
        {     
        Level += 1;
        EXP = EXP - MaxEXP
        HP_Max            += 5
        Phy_Attack_Max    += 2
        Phy_Attack_Min    += 1
        Chi_Attack_Max    += 2
        Chi_Attack_Min    += 1
        Phy_Defence_Max += 2
        Phy_Defence_Min    += 1
        MaxEXP            += 10
          }


Create Event in my Character Object
Code:
HP_Max = 300;
Phy_Attack_Max        = 20;   
Phy_Attack_Min        = 15;
Chi_Attack_Max        = 10;
Chi_Attack_Min        = 5;
Phy_Defence_Max        = 30;
Phy_Defence_Min        = 20;
Speed = 5;
EXP = 0;
MaxEXP = 50;
Level = 1;

Step Event in Character Object
Code:
script_execute(EXP_Controller);
 

Simon Gust

Member
change the if statement to a while statement, so if you over - over shoot EXP that it doesn't only increase level by one (if you have set it up to only be executed once EXP has been collected.
If you want to have npcs start on higher levels you can have their EXP start at a higher value and call the script in the create event.
 

TheouAegis

Member
He doesn't need a while loop, as his code executes the script every step. So if he has too much experience, it will level up once on the first step and then level up again on the next step. The player would never notice the difference.

As for levels affecting stats, what the other guy said is viable, but consider also maybe certain classes have different growth rates.
 
Top