AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Tech Support (https://forums.alliedmods.net/forumdisplay.php?f=36)
-   -   Beginner's Guide to Setting More Levels (https://forums.alliedmods.net/showthread.php?t=32623)

vittu 03-03-2005 00:51

Beginner's Guide to Setting More Levels
 
Beginner's Guide to Setting More Levels

*If you have any problems, check you server console during startup or mapchange for errors (you will get one if your levels are not done right). Or check your server logs. Use the forum search tool to find an answer your problem before making a post about it. If you do make a post, post in Tech Support and read the Rules of that forum before posting anything.

If you set the NUMLEVELS setting correctly it is IMPOSSIBLE for the levels to not work without an error printing out

Difficulty: Easy/Moderate

First things first: Know what version of SuperHero Mod you have before you go on reading this. (use the command 'amx plugins' or 'amxx plugins' in your server console if you don't know, it will show the version number of all plugins.)

Ask yourself: How many Levels do I want?
First thing you want to know is how many Levels you want your server to have, this will affect the amount of heroes a player is able to choose. Once you have that in mind continue with this Guide. And make sure you read everything until it tells you that you are done.

Files that require modification: superhero.ini, *shconfig.cfg, *superheromod.inc, **superheromod.sma

*By default prior to version 1.18, the superhero mod core (the amx/x file) is only compiled for max of 20 Levels. In order to have more then 20 Levels you must edit the .inc file and recompile the core. Versions 1.18 and after are compiled for a max of 100 Levels, if you need more then that you must edit the .inc file and recompile the core. Although I would consider you a freak if you do... Also, shconfig.cfg only needs to be edited for more then 20 levels...
**You only need to edit the superheromod.sma if you are using MySQL saving, by default the vault is used for saving. If you don't know what either of these saving methods are, you are using vault saving. So you do not need to change this file.



---OK Let's Begin---

Step 1:

Find your superhero.ini file, this is the file that determines the amount of XP needed for a player to obtain a new Level. It also determines the amount of XP a player receives for killing a player with a specific Level.
  • File Location:
    • amx 0.9.8a ...\amx\
      amx 0.9.9 ...\amx\config\shero\
      amxmodx 1.0 ...\amxmodx\configs\shero\
  • Open this file with a simple text editor (i.e. notepad), you will notice 5 sets of numbers. The function of these numbers is explained at the top of that file, make sure you understand what these numbers are.
  • First, set the variable NUMLEVELS to the amount of Levels you want to have. (i.e. NUMLEVELS 20 for 20 levels)
  • Next comes the part that confuses most people, SO PAY ATTENTION. For each of the 4 remaining variables (XPLEVELS, XPGIVEN, LTXPLEVELS, and LTXPGIVEN) the numbers in the row for each variable represent XP of a Level. The row of numbers start with Level 0, because of this you need NUMLEVELS+1 different numbers for each row of those variables. So for example if you want 20 levels you must have 21 numbers in each row because 0 to 20 = 21 different numbers.

    Here is an example of LTXGIVEN for 20 levels. Each number represents a Level, first number in the row is 6 XP for killing a Level 0 player. Notice 21 numbers in the row represent levels 0 to 20. You must include level 0.
    Code:

    LTXPGIVEN 6 8 10 12 14 16 20 24 28 32 40 50 60 70 80 90 100 110 120 130 140
    *WARNING: The highest possible xp amount you can set is 2147483647, anything above that amount is invalid. Also, make sure the numbers in a row are in an increasing order. If a number is not greater then the one before it you will get an error in server console on start up and not all your levels will load.
    *On a side note: Do not set the GIVEN and LEVELS numbers the same, unless you want people leveling really fast. See the first point of step 1 about understanding the variables.
  • Save the file and make sure it's being saved as an ini not a txt file.
---If you set 20 Levels or less STOP you are Done restart your server, if more then 20 continue---


Step 2:

Find the shconfig.cfg file, this is where all cvars for SuperHero Mod are located.
  • File Location:
    • amx 0.9.8a ...\amx\
      amx 0.9.9 ...\amx\config\shero\
      amxmodx 1.0 ...\amxmodx\configs\shero\
  • Open this file with a simple text editor (i.e. notepad).
  • Go to line 21-22. Should look like this:
    Code:

    //Max number of powers players can pick from, this is also limited by the number of levels you have.
    sh_maxpowers 20

  • Change this cvar, sh_maxpowers, to the amount of heroes you want to be able to choose. This amount is limited to the number of levels you set in Step 1. You can not choose more heroes then the amount of levels set.
  • Save the file and make sure it's being saved as a cfg not a txt file.
---If you have version 1.18 or higher of SuperHero Mod and are NOT setting more then 100 levels STOP you are Done restart your server---


---if you have version 1.17.6 or below, or setting more then 100 levels CONTINUE---



  • **If you are NOT using MySQL saving Skip Step 3 and go onto Step 4**
    Step 3:

    This Step is for MySQL Saving only, skip this step for vault saving. Find the superheromod.sma file, you need to edit the core file in order to compile it for mysql saving, for later in this Guide. This file is the core of SuperHero Mod.
    • File Location:
      • amx 0.9.8a ...\amx\examples\
        amx 0.9.9 ...\amx\examples\source\
        amxmodx 1.0 ...\amxmodx\scripting\
    • Open this file with a simple text editor (i.e. notepad).
    • At the top of this file you must comment out (disable) the define Vault saving and uncomment (enable) the define for MySQL saving. Go to lines 7-10. Should look like this:

      change this:
    • Code:

      // XP Saving Method
      // Make sure only ONE is uncommented
      #define SAVE_VAULT                //Saves XP to vault.ini (default)
      //#define SAVE_MYSQL                //Saves XP to a MySQL database

      to look like this:
      Code:

      // XP Saving Method
      // Make sure only ONE is uncommented
      //#define SAVE_VAULT                //Saves XP to vault.ini (default)
      #define SAVE_MYSQL                //Saves XP to a MySQL database

    • Save the file and make sure it's being saved as a sma not a txt file. Then go on to the next Step.

Step 4:

Find the superheromod.inc file, .inc's are called includes. This file is used to compile all SuperHero Mod plugins (.sma files). In this step you are editing it to compile the superheromod.sma, if you do not understand how to compile please read this post before going further.
  • File Location:
    • amx 0.9.8a ...\amx\examples\include\
      amx 0.9.9 ...\amx\examples\include\
      amxmodx 1.0 ...\amxmodx\scripting\include\
  • Open this file with a simple text editor (i.e. notepad).
  • Only edit the top of this file for any changes, notice where it says "DO NOT EDIT BELOW HERE". You can look at what the other settings are but for this guide we are only concerned about the one for levels.
  • Go to lines 13-14. Should look like this:
    Code:

    //Max levels that can be loaded from the superhero.ini
    #define SH_MAXLEVELS 20

  • Change the define number for SH_MAXLEVELS to the number of Levels you want. You can set it higher then the level you are currently setting if you think in the future you may add more levels, but for the love of god do not get crazy and set this at something ridiculous like 1000. Changing this makes the core a larger file size, along with other things you should not be concerned with.
  • Save the file and make sure it's being saved as an inc not a txt file.

Step 5:

Now here is where you compile you core file to accept more then 20 Levels. (You can not compile using ftp, compile the files on your computer first.) *Important: I need to stress that this step is about "compiling the core sma, then before you move the newly compiled file to the plugins folder rename it to match what you are loading in your plugins.ini"
  • Compile the file superheromod.sma, if you do not know how to compile you should have read the directions I told you to before in this post
  • After the file is compiled you should rename it to superheromodvault.amx or superheromodvault.amxx depending on which version of amx you have. Or if you are using MySQL you should rename the file to superheromodmysql.amx or superheromodmysql.amxx.
  • Then move the newly named file to your plugins folder and overwrite the old file. The process of this step is to make sure the core plugin you are running in plugins.ini matches the name of the newly compiled core plugin. (Only have one core file running, shmod will not work with more then one running).
---That's it you are Done. Restart your server for the new settings to take effect.---


*If you have any problems, check you server console during startup or mapchange for errors (you will get one if your levels are not done right). Or check your server logs. Use the forum search tool to find an answer your problem before making a post about it. If you do make a post, post in Tech Support and read the Rules of that forum before posting anything.

If you set the NUMLEVELS setting correctly it is IMPOSSIBLE for the levels to not work without an error printing out

vittu 04-05-2006 22:05

Examples of errors server console or logs you will get if set up incorrectly:
  • Not enough numbers
    Code:

    L 02/12/2006 - 22:32:42: [superheromodvault.amxx] DEBUG: Ran out of levels to load, check your superhero.ini for errors. Adjusting NUMLEVELS to 20
    One or more of your superhero.ini varibles, XPLEVELS, XPGIVEN, LTXPLEVELS, or LTXPGIVEN, does not have enough numbers to match the amount you set in NUMLEVELS. Remember you must include level 0 (level 0 to level n is n+1 different numbers, ex. 0 to 20 is 21 numbers).



All times are GMT -4. The time now is 03:54.

Powered by vBulletin®
Copyright ©2000 - 2015, vBulletin Solutions, Inc.