Jump to content

Experience System 5.0 (V2 is on the way)


Medusa
 Share

Recommended Posts

This was tested on most recent altis life framework. This was my first major projects on arma so sorry if there are bugs but after a lot of testing I believe that it is working!

This requires modifications to the life server file please make a copy of it before you make any changes to it.  I have tried to make the installation to this as simple as possible to prevent mistakes. please tell me if you are having any issues!

Description: This is a full blown experience system for altis life with experience, perks, levels etc... this connects to the database a to save all variables. 

1. download the files below!

2. drag custom into core in the main mission file

3. in Functions.hpp after  class Vehicle or line 382 paste this in 

Spoiler
    class experincesystem { 
        file = "core\custom\experincesystem"
        class dataexperince {}; 
        class experinceinit {};
        class firstjoin {};
        class giveexperince {};
        class saveexperince {};
        class experinceReceived {};
        class Experince_menu {};
        class upgrade_experince {};
        class experince_menu_change {};
    }; 
};

4. now in description.ext in the main mission file after #include "dialog\progress.hpp" paste in 

Spoiler

#include "dialog\Experince_bar.hpp"

5. in CfgRemoteExec.hpp after   jip = 0;  paste in 

Spoiler

#include "core\custom\Medusa_Handler.hpp"

6. go to your dialog folder in your main mission file and place the files from the  experinceMenu folder that you just downloaded into the dialog folder

7. go into MasterHandler.hpp and paste this at the bottom 

Spoiler

#include "experinceMenu.hpp"
#include "Experince_bar.hpp"

8. go into your init file in your main mission and look for [] call life_fnc_hudSetup; and paste under it 

Spoiler

call life_fnc_experinceinit;

9. you are now done inside the main mission folder now go into your life server file and go into functions and paste experience from what you just downloaded 

10. now go into your config.cpp and go to line 114 or after class PlayTime add this 

Spoiler

        class Experince { 
            file = "\life_server\Functions\Experince"; 
            class fetchexperince {}; 
            class firstexperince {}; 
            class saveexperinceserver {};   
        };

11. now for the database your gonna wanna add this code into your tables on your database 

Spoiler

CREATE TABLE IF NOT EXISTS `experience` (
    `uid`          INT NOT NULL AUTO_INCREMENT,
    `pid`          VARCHAR(17) NOT NULL,
    `name`             VARCHAR(32) NOT NULL,
    `exp_experince`  INT NOT NULL DEFAULT 0,
    `exp_level`      INT NOT NULL DEFAULT 0,
    `exp_points`      INT NOT NULL DEFAULT 0,
    `exp_perks`      VARCHAR(32) NOT NULL DEFAULT '"[0,0,0,0,0]"',
    
    PRIMARY KEY (`pid`),
    UNIQUE KEY `unique_uid` (`uid`),
    INDEX `index_name` (`pid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;    

12. you are finished! 

Please let me know about any bugs that you may find and I will try to workout a fix for them. 

any recommendation please put them downlow and if you have any question please contact me! here is my steam if you would like to https://steamcommunity.com/id/meanpark/

Helpful comments / commands 

bring up experience menu 

[] spawn {sleep 2; createDialog "Experince_Menu";}

add experience  

[10, "test"] spawn life_fnc_giveexperince

1 part is how much experience second part is a message that you want to go with it

check the level for what ever it may be 

experince_check = false; if (life_exp_perks select 1 == 0) then { experince_check = false; hint "its not true";} else { experince_check = true; hint "its true";}

To add more perk choices 

go into fn_experinceinit and in life_exp_perks and another ,0 

then in life_exp_perks_choice at the end add ["Name",1,2,3,4] you can add as many levels as you want just add an extra number at the end to max it out. 

then go into fn_experince_menu_change and add another case. the case name needs to be the exact same as the name you set for it. just write the description out and make sure to format it. 

here is a link on how to do that https://community.bistudio.com/wiki/formatText 

 

 

Experince.zip experinceMenu.zip

custom.zip

Edited by Medusa
bugfix
  • Like 2
  • Thanks 1
Link to comment
Share on other sites

  • Medusa changed the title to Experience System 5.0
  • 5 weeks later...
  • 2 months later...
  • 1 month later...
1 hour ago, RanGo said:

I'm not sure if I'm doing anything wrong, but the level and exp or all of the data is not saved to the database at all.😊

it should save to the database every time you get exp. do you have a errors in the database or in the rpt logs? 

  • Like 1
Link to comment
Share on other sites

Posted (edited)
9 hours ago, RanGo said:

arma3server_2021-06-17_20-53-46.rpt

Scripting function 'ton_fnc_firstexperince' is not allowed to be remotely executed

I think that I found the bug but I haven't been able to test it. add this line of code into medusa_handler.hpp. please let me know if you're still having issues. sorry for the problem. 

 

F(TON_fnc_firstexperince,SERVER)
Edited by Medusa
  • Like 1
Link to comment
Share on other sites

3 minutes ago, Medusa said:

I think that I found the bug but I haven't been able to test it. add this line of code into medusa_handler.hpp. please let me know if you're still having issues 

 

F(TON_fnc_firstexperince,SERVER)

Oh, Thank you 🥰

Link to comment
Share on other sites

  • Medusa changed the title to Experience System 5.0 (V2 is on the way)
  • 1 month later...
  • 1 month later...

I have made some minor changes to the GUI.

While Arma Dialog creator is a great tool, I personally like the feel of the normal altis life GUIs. Therefor, here is a screenshot of how it looks now.

ab252caca15daf0c1a60630064d40ee3.png

If OP or anyone else wants to change it, the code is below.

class Experince_Menu
{
	idd = 1458;
	name= "Experince_Menu";
    movingEnable = 0;
    enableSimulation = 1;
	onLoad = "[] spawn life_fnc_Experince_menu;";

	class ControlsBackground
	{
		class Background: Life_RscText{
		idc = -1;

		x = 0.29375 * safezoneW + safezoneX;
		y = 0.224913 * safezoneH + safezoneY;
		w = 0.4125 * safezoneW;
		h = 0.550174 * safezoneH;
		colorText[] = {0.6706,0.3608,0.3804,1};
		colorBackground[] = {0,0,0,0.7};
	};
		
	};
	class Controls
	{
		class Experince_list: Life_RscListBox
	{
		idc = 1456;
		onLBSelChanged = "_this call life_fnc_experince_menu_change";

		x = 0.319222 * safezoneW + safezoneX;
		y = 0.299076 * safezoneH + safezoneY;
		w = 0.1125 * safezoneW;
		h = 0.400001 * safezoneH;
		colorText[] = {0.6,0.6,0.6,1};
		colorBackground[] = {0,0,0,0.7};
	};
		class Description: Life_RscText
	{
		type = 13;
		idc = 1457;
		size = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)";

		x = 0.443797 * safezoneW + safezoneX;
		y = 0.299957 * safezoneH + safezoneY;
		w = 0.2375 * safezoneW;
		h = 0.400001 * safezoneH;
		colorBackground[] = {0,0,0,0.7};
	};
		class Welcome_message: Life_RscText
	{
		idc = 0;
		font = "PuristaMedium";

		text = "Experince Menu"; //--- ToDo: Localize;
		x = 0.319531 * safezoneW + safezoneX;
		y = 0.268927 * safezoneH + safezoneY;
		w = 0.1125 * safezoneW;
		h = 0.0249999 * safezoneH;
		colorBackground[] = {0,0,0,0.7};
	};
		class buy_experince: Life_RscButtonMenu
	{
		onButtonClick = "[] call life_fnc_upgrade_experince;";

		idc = 1004;
		text = "Purchase XP"; //--- ToDo: Localize;
		x = 0.583428 * safezoneW + safezoneX;
		y = 0.709066 * safezoneH + safezoneY;
		w = 0.0979687 * safezoneW;
		h = 0.022007 * safezoneH;
		colorText[] = {1,1,1,1};
		colorBackground[] = {0,0,0,0.7};
	};
		class Close: Life_RscButtonMenu
	{
		onButtonClick = "closeDialog 0;";

		idc = 1005;
		text = "Close"; //--- ToDo: Localize;
		x = 0.319531 * safezoneW + safezoneX;
		y = 0.709066 * safezoneH + safezoneY;
		w = 0.0928125 * safezoneW;
		h = 0.022007 * safezoneH;
		colorText[] = {1,1,1,1};
		colorBackground[] = {0,0,0,0.7};
	};
		class Experince_points: Life_RscText
	{
		type = 13;
		idc = 1455;
		size = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)";

		x = 0.577344 * safezoneW + safezoneX;
		y = 0.268927 * safezoneH + safezoneY;
		w = 0.102604 * safezoneW;
		h = 0.0249999 * safezoneH;
		colorBackground[] = {0,0,0,0.7};
	};
		class Experince: Life_RscProgress
	{
		idc = 1454;
		colorBar[] = {1,1,1,1};
		texture = "#(argb,8,8,3)color(1,1,1,1)";

		x = 0.324687 * safezoneW + safezoneX;
		y = 0.742077 * safezoneH + safezoneY;
		w = 0.350625 * safezoneW;
		h = 0.022007 * safezoneH;
	};
	class Current_experince: Life_RscText
	{
		type = 13;
		idc = 1453;
		size = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)";

		x = 0.444313 * safezoneW + safezoneX;
		y = 0.709066 * safezoneH + safezoneY;
		w = 0.0721875 * safezoneW;
		h = 0.022007 * safezoneH;
		colorBackground[] = {0,0,0,0.2};
	};
		
	};
	
};

 

Link to comment
Share on other sites

Française 

 

Bonjour a tous , 

 

j ai essayer de faire la manipe mes j ai rien qui s affiche je recherche une personne qui pourrait m aide svp 

 

je comprend pas ou il faut mettre set commande 

======================================================================

Helpful comments / commands 

bring up experience menu 

[] spawn {sleep 2; createDialog "Experince_Menu";}

add experience  

[10, "test"] spawn life_fnc_giveexperince

1 part is how much experience second part is a message that you want to go with it

check the level for what ever it may be 

experince_check = false; if (life_exp_perks select 1 == 0) then { experince_check = false; hint "its not true";} else { experince_check = true; hint "its true";}

To add more perk choices 

go into fn_experinceinit and in life_exp_perks and another ,0 

then in life_exp_perks_choice at the end add ["Name",1,2,3,4] you can add as many levels as you want just add an extra number at the end to max it out. 

then go into fn_experince_menu_change and add another case. the case name needs to be the exact same as the name you set for it. just write the description out and make sure to format it. 

=====================================================================

 

Merci d avance 

Link to comment
Share on other sites

I am trying to find config.cpp  I cant find this file.  Iam using Altis life V5. Where i can find or another way to do this ?

 

 

10. now go into your config.cpp and go to line 114 or after class PlayTime add this 

  Hide contents

        class Experince { 
            file = "\life_server\Functions\Experince"; 
            class fetchexperince {}; 
            class firstexperince {}; 
            class saveexperinceserver {};   
        };

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.