08-15-2008, 05:08 PM | #1 |
Pub Allstar!
Beta Tester
Join Date: Aug 2008
Class/Position: under en kvinna Gametype: Capture the Flag Affiliations: Eternal Order, Must be h4x, Mono's happy funtime. Posts Rated Helpful 0 Times
|
Custom Class Creation
I did a search and was unable to find anything on the forums, wiki, or a general google search in regards to this. If this has been posted before, my apologies.
I want to create a custom class for use on my server. Here's the idea, how I am thinking about going about it, and my specific questions. If I'm thinking about this the wrong way, maybe someone can point me in the right direction. Thanks. I want to create a soldier class that plays a little faster in order to introduce my zerofrags.com cpma players to the game, and also for a little fun when not training. I would like to be able to enable this class and disable all standard classes for the duration of any map. My plan was to do this with a lua suffix. Basically, I'd create a modified base ctf lua with reference to this custom class and disable all others. Then copy and rename the file to "mapname__quake__.lua". I see that under fortressForever/scripts there are scripts with class attributes. So after tinkering with them, this is what I have come up with. Contents of ff_playerclass_cpma.txt Code:
PlayerClassData { "slot" "3" "classname" "Fragger" // Text "printname" "#FF_PLAYER_SOLDIER" "description" "#FF_HELP_SOLDIER" // Model "model" "models/player/soldier/soldier.mdl" // Health & Armour "max_armour" "200" "initial_armour" "0" "armour_type" "0.8" "health" "100" "speed" "320" //boosted 5% was 252 "masscoefficient" "1.0" // Weapns to automatically equip the class with ArmamentsData { "weapon" "ff_weapon_crowbar" "weapon" "ff_weapon_quake_railgun" "weapon" "ff_weapon_supershotgun" "weapon" "ff_weapon_quake_rpg" } "primary_classname" "ff_grenade_normal" "primary_initial" "2" "primary_max" "4" "secondary_classname" "ff_grenade_nail" "secondary_initial" "1" "secondary_max" "2" "weight" "75" "item_flags" "0" // Ammo amounts for the player AmmoData { "AMMO_SHELLS" "50" "AMMO_NAILS" "0" "AMMO_CELLS" "0" "AMMO_ROCKETS" "10" "AMMO_DETPACK" "0" "AMMO_MANCANNON" "0" } MaxAmmoData { "AMMO_SHELLS" "100" "AMMO_NAILS" "100" "AMMO_CELLS" "50" "AMMO_ROCKETS" "50" "AMMO_DETPACK" "0" "AMMO_MANCANNON" "0" } } Code:
WeaponData { // Weapon characteristics: "CycleTime" "0.65" // was .8 Rate of fire "CycleDecrement" "1" // Number of bullets fired per cycle "Damage" "102" // Damage per burst "DamageRadius" "125" // Radius of damage "RecoilAmount" "1" // Amount of recoil // Projectile weapons "Speed" "1200" // 900 Speed for projectile to travel at, possibly wrong. Old FF value = 800. // Hitscan weapons "Bullets" "-1" // Bullets to shoot "BulletSpread" "-1" // Spread of projectiles "PreReloadTime" ".3" // was .4 Time taken for the weapon to move to reload state "ReloadTime" "0.9" // was 1.3 Time taken to reload a shell/rocket/etc "PostReloadTime" "1" // Time taken to move weapon back to firing state "SpinTime" "-1" // For AC "clip_size" "100" "primary_ammo" "AMMO_ROCKETS" "secondary_ammo" "None" // Weapon data is loaded by both the Game and Client DLLs. "printname" "#FF_WPNHUD_RPG" "viewmodel" "models/weapons/rpg/v_rpg.mdl" "playermodel" "models/weapons/rpg/w_rpg.mdl" "anim_prefix" "rpg" "PlayerAnimationExtension" "rpg" "bucket" "4" "bucket_position" "0" "weight" "60" "item_flags" "0" // Sounds for the weapon. There is a max of 16 sounds per category (i.e. max 16 "single_shot" sounds) SoundData { "empty" "generic.empty" "reload" "rpg.reload" "single_shot" "rpg.single_shot" } // Weapon Sprite data is loaded by the Client DLL. TextureData { "weapon" { "font" "WeaponIcons" "character" "q" } "weapon_s" { "font" "WeaponIconsSelected" "character" "q" } "ammo" { "font" "WeaponIconsSmall" "character" "8" } "crosshair" { "file" "sprites/crosshairs" "x" "0" "y" "48" "width" "24" "height" "24" } "autoaim" { "file" "sprites/crosshairs" "x" "0" "y" "48" "width" "24" "height" "24" } "deathnotice" { "font" "StatusGlyphsSmall" "character" "q" } } ModelBounds { Viewmodel { Mins "-10 -4 -13" Maxs "21 9 -1" } World { Mins "-10 -7 -6" Maxs "22 8 9" } } } Code:
WeaponData { // Weapon characteristics: "CycleTime" "1.5" // Rate of fire "CycleDecrement" "1" // Number of bullets fired per cycle "Damage" "80" // Damage per burst "DamageRadius" "1" // Radius of damage // Projectile weapons "Speed" "10000" // Speed for projectile to travel at "RecoilAmount" "2" // Amount of recoil // Hitscan weapons "Bullets" "-1" // Bullets to shoot "BulletSpread" "-1" // Spread of projectiles "PreReloadTime" "-1" // Time taken for the weapon to move to reload state "ReloadTime" "-1" // Time taken to reload a shell/rocket/etc "PostReloadTime" "-1" // Time taken to move weapon back to firing state "SpinTime" "-1" // For AC "clip_size" "-1" "clip2_size" "-1" "default_clip" "10" "default_clip2" "-1" "primary_ammo" "AMMO_NAILS" "secondary_ammo" "None" // Weapon data is loaded by both the Game and Client DLLs. "printname" "#FF_WPNHUD_RAILGUN" "viewmodel" "models/weapons/railgun/v_railgun.mdl" "playermodel" "models/weapons/railgun/w_railgun.mdl" "anim_prefix" "anim" "PlayerAnimationExtension" "railgun" "bucket" "1" "bucket_position" "2" "weight" "50" "item_flags" "0" // Sounds for the weapon. There is a max of 16 sounds per category (i.e. max 16 "single_shot" sounds) SoundData { "empty" "generic.empty" "single_shot" "railgun.single_shot" "double_shot" "railgun.charged_shot" "special1" "railgun.chargeloop" "special2" "railgun.halfcharge" // half charge notification "special3" "railgun.fullcharge" // full charge notification "burst" "railgun.overcharge" // overcharge // "special2" "ambient.electrical_zap_8" // half charge notification // "special3" "ambient.electrical_zap_9" // full charge notification // "burst" "ambient.electrical_zap_5" // overcharge } // Weapon Sprite data is loaded by the Client DLL. TextureData { "weapon" { "font" "WeaponIcons" "character" "t" } "weapon_s" { "font" "WeaponIconsSelected" "character" "t" } "ammo" { "font" "WeaponIconsSmall" "character" "6" } "crosshair" { "file" "sprites/crosshairs" "x" "0" "y" "48" "width" "24" "height" "24" } "autoaim" { "file" "sprites/crosshairs" "x" "0" "y" "48" "width" "24" "height" "24" } "deathnotice" { "font" "StatusGlyphsSmall" "character" "u" } } ModelBounds { Viewmodel { Mins "-10 -4 -13" Maxs "21 9 -1" } World { Mins "-10 -7 -6" Maxs "22 8 9" } } } |
|
08-15-2008, 06:03 PM | #2 |
[AE] 0112 Ihmhi *SJB
Wiki Team
Fortress Forever Staff |
Wow, so... you've edited like every class-related file.
Okay, well, you have a few problems here. First, while Lua can currently take away weapons, it can not yet give players weapons. (We be workin' on that, yo.) Secondly, you can indeed swap out a skin on an existing model for a player, but I don't know if you can swap out an entire model altogether. Also don't know whether or not you can bring in custom weapons. I'm sure one of the LADs can answer you. PON PON PATA PON!
__________________
Anime: The Thread: Reloaded The one and only anime thread on these here forums. Select the pistol, and then, select your horse. |
|
08-15-2008, 09:32 PM | #3 |
Pub Allstar!
Beta Tester
Join Date: Aug 2008
Class/Position: under en kvinna Gametype: Capture the Flag Affiliations: Eternal Order, Must be h4x, Mono's happy funtime. Posts Rated Helpful 0 Times
|
Update.
Ok, so just editing the class files as given me the proper results (still needs some minor tweaking). The problem is that it requires me to replace the original files whenever I would like to make a change. What I was thinking was saving them as something like the names listed above, and calling the scripts up through LUA. Lua seems to have this ability, though I have not been able to find a tutorial on how exactly to make this happen. So atm, My server has some pretty broken soldiers. About the class files. These are the same files from fortressforever\scripts, only renamed and with tweaks to the damage variables and weapon assignments. this is not an original work and all credit belongs to the original authors. And a big thank you for all the comments within the script files, some of those variables are a little misleading in cvar name without the helpful commenting. |
|
08-18-2008, 04:05 PM | #4 |
Pub Allstar!
Beta Tester
Join Date: Aug 2008
Class/Position: under en kvinna Gametype: Capture the Flag Affiliations: Eternal Order, Must be h4x, Mono's happy funtime. Posts Rated Helpful 0 Times
|
Ok, so I've got my classes finished. I had some major issues when attempting to use different models for weapons (maybe invalid syntax?)
So basically I have my soldier saved as ff_playerclass_quake_soldier How can I load this script in the place of ff_playerclass_soldier via lua? My goal is to have an alternate set of player classes that can be enabled via a special LUA. Thanks. |
|
08-19-2008, 09:27 PM | #5 |
Tealeaf
Beta Tester
Join Date: Dec 2007
Location: Scotland
Affiliations: fo! Posts Rated Helpful 1 Times
|
This could be cool, I remember using that exploit on tfc that allowed you to get all classes weapons and having mulch_dm battles with scouts and rocket launchers, concing around etc
|
|
08-19-2008, 10:26 PM | #6 |
[AE] 0112 Ihmhi *SJB
Wiki Team
Fortress Forever Staff |
That's a cheat in FF?
sv_cheats 1 give ff_weapon_NAME fpg sniperrifle knife etc. Scout with RPG = fun
__________________
Anime: The Thread: Reloaded The one and only anime thread on these here forums. Select the pistol, and then, select your horse. |
|
08-22-2008, 02:49 AM | #7 |
Retired FF Staff
Join Date: Mar 2007
Location: The Peoples Republic of Harmfull Free Radicals.
Class/Position: Soldier, O Gametype: Doubble Mode Affiliations: Cassiotone Nation Posts Rated Helpful 1 Times
|
If you bspzip a file into your map with the same name as a base file, the game will load the one in your map. Many files will only be loaded once, and won't be reloaded on round resets though (like player skins). You may be able to have your own version of ff_weapon_railgun, for example, zipped into your map but I don't know what will happen when the server switches maps.
__________________
TG: pretty much you have no idea how much i fuckin own at this game. TG: i bested no less than three flaming tornados and broke a huge wizard. |
|
08-22-2008, 10:04 AM | #8 |
Community Member
Server Owner
Beta Tester Forum Moderator Join Date: Mar 2007
Location: Hawthorne, California
Class/Position: Soldier/Spy/Scout Gametype: AvD Affiliations: :e0:Eternal Order Leader Posts Rated Helpful 12 Times
|
Well I notice in Anticitizen, the player skins stay sometimes after map change
__________________
|
|
08-24-2008, 10:00 AM | #9 |
Retired FF Staff
Join Date: Mar 2007
Location: The Peoples Republic of Harmfull Free Radicals.
Class/Position: Soldier, O Gametype: Doubble Mode Affiliations: Cassiotone Nation Posts Rated Helpful 1 Times
|
Apparently the vmf only gets loaded when you connect, not when the map changes, so the skins in Anticitizen may get scrapped unless we can change the way the game loads resources.
(It may be possible to code a lua function that does this)
__________________
TG: pretty much you have no idea how much i fuckin own at this game. TG: i bested no less than three flaming tornados and broke a huge wizard. |
|
08-24-2008, 03:30 PM | #10 |
Community Member
Server Owner
Beta Tester Forum Moderator Join Date: Mar 2007
Location: Hawthorne, California
Class/Position: Soldier/Spy/Scout Gametype: AvD Affiliations: :e0:Eternal Order Leader Posts Rated Helpful 12 Times
|
Well the skins do look better though
__________________
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
|
|