Raised This Month: $51 Target: $400
 12% 

Beginner's Guide to Installing Heroes


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
imported_FireWalker877
Member
Join Date: Jun 2004
Location: Memphis, TN
Old 02-11-2005 , 23:56   Beginner's Guide to Installing Heroes
#1

Installing Superheroes

So you've successfully installed the Superhero Mod? Well congratulations! The next step is to add custom heroes.

Before you begin, you are going to need to know a few things.

First, you will need to know how to unzip the hero files. I recommend using WinZip because it is a fairly straight forward program. You can download it from www.winzip.com.

Open the .zip file with WinZip. Inside you should see a list of files, if you don't, try saving the .zip to your hard drive. Now, when a scripter creates a hero, he always uploads two types of files.

The first type of file you find is the SMA. It will be named sh_heroname.sma. Think of this file as the hero's source code. It is the raw code that is actually written by the scripter. When the scripter is happy with the way the code looks, he compiles it, bringing us to the second type of file. The AMX file is the file that is actually read by the AMX system. It has been translated into a code that the server understands. If you were to look at the AMX file with WordPad, you would be completely confused.

There can be as many as three AMX files in the ZIP file, each with the same or a similar name (sh_heroname.amx); however, these files are very different. If there is only one AMX file in your ZIP file, you can skip this paragraph. As you may know, there are three supported versions of AMX; AMX 9.8, AMX 9.9, and AMXX. You need to choose the hero file that corresponds to your version of AMX. If you run AMXX, you need the file that ends with AMXX (sh_heroname.amxx). To see which version each AMX file goes with, scroll to the far right of the WinZip window until you see the PATH column. Under this column is listed either €œ\amx98€ or €œ\amx.€ \amx98 corresponds to AMX 9.8 and \amx corresponds to AMX 9.9. Select the AMX file that will be used on your server.

If you installed AMX 9.8, take the hero's AMX file and place it in ROOTFOLDER\cstrike\addons\amx\plugins\. Then, in this folder, find the file plugins.ini. Open it with WordPad and scroll down until you see the superhero section. Find the new hero's alphabetic position in the list of sh_hero.amx entries and insert sh_heroname.amx.
e.g.
sh_agent.amx
sh_anubis.amx
sh_aquaman.amx
sh_batgirl.amx
Save the plugins.ini file and exit WordPad.

If you installed AMX 9.9, take the hero's AMX file and place it in ROOTFOLDER\cstrike\addons\amx\plugins\. Then, move to the folder ROOTFOLDER\cstrike\addons\amx\config\. Find the plugins.ini file, open it with WordPad, and scroll down until you see the superhero section. Find the new hero's alphabetic position in the list of sh_hero.amx entries and insert sh_heroname.amx.
e.g.
sh_agent.amx
sh_anubis.amx
sh_aquaman.amx
sh_batgirl.amx
Save the plugins.ini file and exit WordPad.

If you installed AMXX, take the hero's AMXX file and place it in ROOTFOLDER\cstrike\addons\amxmodx\plugins\. Then, move to the folder ROOTFOLDER\cstrike\addons\amxmodx\configs\. Find the plugins.ini file, open it with WordPad, and scroll down until you see the superhero section. Find the new hero's alphabetic position in the list of sh_hero.amxx entries and insert sh_heroname.amxx.
e.g.
sh_agent.amxx
sh_anubis.amxx
sh_aquaman.amxx
sh_batgirl.amxx
Save the plugins.ini file and exit WordPad.

Congratulations, the base hero is now installed. If there were no custom models or sound files included with your hero, you can stop reading.

If the hero you just installed has a custom model or sound file, you will need to place it in the correct folder. Look at the install path in the WinZip window as described under the AMX file section. If there is no path listed, but a model is included, you are going to have to do a little detective work, jump to the next paragraph. Pretend you are installing Morpheus, a popular custom hero. Morpheus requires the file morpheus_mp5.mdl to be installed. If you look at the install path in the WinZip window, you will see that the model must be placed in ROOTFOLDER\cstrike\models\shmod\. Place morpheus_mp5.mdl in that directory, and your hero is ready to go. You can stop reading now.

So there was no Path listed, huh? Ok well go find some Excedrin, €˜cause this might get confusing. At the beginning of this tutorial, I told you that the SMA file is the scripter's code. You are going to have to find out where the scripter wanted the custom model or sound file to be placed. Open the SMA file using WordPad. You will see the SmallC code which dictates how the hero is to operate. The model's path might be included at the top of the SMA in a commented section, but that is probably not the case. You are going to have to find the precache function. The precache function tells your client to load the file in their memory. If the client doesn't have the required file, the precache function tells his computer to download it from your server. To locate the precache function, go to Edit > Find. In the Find dialog, type precache and click Find Next. Your computer should jump to the line that reads:

public plugin_precache()

This is the precache function's declaration. Below it you should see something like:

precache_model("models/shmod/custom_model.mdl")
or
precache_sound("shmod/custom_sound.wav")

These lines tell you what directory the files need to go in. For this hero, custom_model.mdl goes in ROOTFOLDER/cstrike/models/shmod/, and custom_sound.wav goes in ROOTFOLDER/cstrike/sound/shmod/.
Go try it out!

Now, if you would like to customize your new hero's configuration variables (change its level setting, damage, etc.), open up its SMA. You will find a function near the top called plugin_init(); if you don't see it, do a search for init. This is the code that initializes the hero and defaults its settings. In this function you will find lines beginning with the register_cvar command.
e.g.
register_cvar("heroname_level", "8" )
register_cvar("heroname_damagemult", "0.75" )
In this example heroname_level and heroname_damagemult are two of the hero's cvars. 8 and .75 are their respective default values.

To modify the hero's level, copy the level cvar heroname_level, and paste it in the superhero config file, shconfig.cfg. The location of shconfig.cfg depends on your version of AMX. For AMX9.8, it is located in ROOTFOLDER\cstrike\addons\amx\. If you installed AMX9.9, try ROOTFOLDER\cstrike\addons\amx\config\shero\. AMXMODX people should find it in ROOTFOLDER\cstrike\addons\amxmodx\configs\. The cvars should be set to your custom value. This is what a set of cvars should look like:
//Heroname
heroname_level 7
heroname_damagemult 1.25
The // before Heroname keep AMX from trying to read that line, this is what people mean when they tell you to comment out a line. With the new cvars in your shconfig.cfg file, the hero will be available at level 7 and their weapons will do 25 percent more damage.
Save shconfig.cfg and restart your server. Good luck!

Last edited by vittu; 03-17-2007 at 12:12.
imported_FireWalker877 is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 02:05.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode