AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugins (https://forums.alliedmods.net/forumdisplay.php?f=108)
-   -   [TF2] Model Manager 1.0.4 (08/03/2013) (https://forums.alliedmods.net/showthread.php?t=164630)

FlaminSarge 08-13-2011 22:19

[TF2] Model Manager 1.0.4 (08/03/2013)
 
13 Attachment(s)
Allows players to equip custom models. Let's not get Valve to shut this down, now, shall we?

Thanks to Damizean, this is basically his TF2 Equipment Manager plugin except with a model changer instead of a hat equipper.
Thanks to Sazpaimon for model conversion research.
Thanks to Pimpinjuice for reskin conversion research.

Small update 1.0.4 on 08/03/2013 to prevent errors (and to enforce the MAX_ITEMS limit, which is there so that you are less likely to get precache table overflows) and help determine how many models are loaded when you use tf_models_reload. Only the smx and sp files changed.

UPDATED 07/30/2013. All four files were changed. I'd suggest renaming tf/cfg/sourcemod/TF2_ModelManager.cfg to something else, finding the newly generated (lowercase) one after loading up the plugin (delete the file then restart the server else you'll just get the same old file you just renamed), then putting in whatever settings from the old one.

Cvars
  • tf_models_admin - Removed this cvar.
  • tf_models_admin_flags - Having one of these flags marks you as an administrator, for the ADMIN_DEFAULT item flag and for immunity to the lock command.
  • tf_models_admin_override - Clients with access to the "tf_models_admin_override_access" override (see the "admin overrides" link above) will see all the models in the list, rather than just the ones usable with their current class/team.
  • tf_models_announce - Announces usage and tips about equippable models.
  • tf_models_announce_plugin - Announces information of the plugin when joining.
  • tf_models_force_admins - Forces the default model for admin users (ADMIN_DEFAULT).
  • tf_models_force_users - Forces the default model for common users (USER_DEFAULT).
  • tf_models_delayonspawn - Amount of time to wait to re-equip a model after spawn. Apparently for compatibility with old melee plugins
  • tf_models_blocktriggers - Hides the chat (!mm) plugin triggers, so that when clients type them they don't show up in chat.
  • tf_models_list - Change the config file used to make the item list. Useful if you want to have a different set of models for each map. Files for this go in addons/sourcemod/configs/tf2modelmanager/.
Commands:
  • tf_models - Shows the model management menu. Set an admin override for this to control access to the model menu.
  • equip, mm, em, equipmodels - Aliases for tf_models, these obey the tf_models override.
  • tf_models_equip <target> <name> - Forces to equip a model onto a client. Don't need quotes around <name>, and it searches for a model in the list. Exact matches come first, then if more than one is found, it tells you what it found and asks for the command again.
  • tf_models_remove <target> - Forces to remove a model on the target.
  • tf_models_lock <target> <1/0> - Locks/unlocks the target's model so it can't be changed.
  • tf_models_override <target> <1/0> - Enables restriction overriding for the target (they can equip any model regardless of class/team).
  • tf_models_reload - Reparses the items file and rebuilds the model list.
Installation: (video tutorial is in the next post)
  • Unsupported for anything below SM 1.5
  • You need to have the clientprefs extension for SourceMod (it's a stock SourceMod extension, if I remember correctly)
  • Place tf2_modelmanager.smx in addons/sourcemod/plugins/
  • Place tf2_modelmanager.phrases.txt in addons/sourcemod/translations/
  • Place tf2_modellist.cfg in addons/sourcemod/configs/tf2modelmanager/. Make sure this is lowercase.
  • Once all of these are placed, either do 'sm plugins refresh' in console, change the map, or restart the server. Then, go to tf/cfg/sourcemod/tf2_modelmanager.cfg and change any cvars you want to change.
  • If you're compiling yourself, you need morecolors.inc. You'll also need the latest SM 1.5 includes.
  • Ignore the tag mismatches when compiling, I have no idea :/
Add items using the instructions in the tf2_modellist.cfg file. You NEED to populate this config with models to have models. You can create more cfg files in the same folder with different names and change the tf_models_list cvar to those names, in order to change up the model list (they're all in addons/sourcemod/configs/tf2modelmanager/). Basically, multiple item lists, but tf2_modellist.cfg is the default. The one provided comes with an example model.
READ ABOUT .dep FILES HERE. YOU NEED THESE FOR CUSTOM MODELS (models that aren't already in the game files. models/gman.mdl IS already in the game files, FYI)

Code:

CHANGELOG
08/03/2013(v1.0.4)
*Made plugin not error if you had more than 256 models, but log a message saying no more will be added. Seriously, stick to this limit, and don't complain if you don't and your server starts crashing due to precache errors.
*Added number of models to tf_models_reload output.
-Files changed: smx, sp

07/30/2013(v1.0.3)
*Admin overrides! Use them instead of the ADMIN_ONLY flag.
*Cvar and command changes, read up on it in the relevant sections above.
*Fixed the model list not updating properly on mapchanges/cvar changes.
*Fixed users not being recognized as admins if the flags were added later.
*The admin flag cvar now only applies for ADMIN_DEFAULT and whether tf_models_lock applies to a client. Use the "tf_models" override to control access to the menu.
*You can put models in tf/custom/owndirectory/, but the .dep file has to be in tf/models/... (the .dep file must also list the models as if they were in tf/models/..., but the models can be in the custom directory since that's how stuff works now).
*Protected the cookies used for the plugin.
*HIDE_WEAPONS now works.
*REMOVE_VALVE changed to HIDE_HATS (REMOVE_VALVE still works, but... eh)
*Unequipping a model now removes any particle effects that may have come with it (e.g. the Ghost models).
*Lowercase'd all the files because it was an issue for some people.
*If I missed anything in this list I'll add it later.

01/12/2012(v1.0.2)
*Fixed admin checks not working
*Allowed /mm, /em, /equip, /equipmodels, and /tf_models to be overridden in admin overrides.
*Changing class without respawning should now be accounted for in the plugin (will check on regen/locker touch)
*Accounted for Bootlegger not being a hat

08/17/2011(v1.0.1)
*Changed up the way items are found when using tf_models_equip
*Fixed IsValidClient
*If an admin forces a client to equip a model, and the client has the override flag, the model equips as opposed to rejecting based on class/team/etc.
*Brought back the /em alias because I am so used to it.

08/13/2011(v1.0.0)
*First release



Demonstration
(created by Rowedahelicon)
https://www.youtube.com/watch?v=IWuQaW18gWQ

FlaminSarge 08-13-2011 22:23

Re: [TF2] Model Manager
 
4 Attachment(s)
===TUTORIAL FOR CONVERTING MODELS/SKINS===
To "convert" a custom MODEL for this plugin, all you have to do is move it to its own folder so that it is not replacing the stock TF2 files. You do not have to follow this tutorial, but any custom animation files will require a bit of reworking.
To "convert" a custom SKIN for this plugin, you have to follow the instructions from the tutorial(s).

Video tutorial

While the tutorial says to use the stockmodels files, the TF2 update on October 8, 2012 broke this method. You will have to use the files from models/player/<class>.mdl, e.g. models/player/sniper.mdl. You may or may not have to use the MDL Hexer to change the model's path internally to your custom model path (I haven't, for the most part: I've just moved the model to a new folder and it seemed to work fine). Finally, you will have to grab the .sw.vtx, .dx90.vtx, .dx80.vtx, .vvd, and .phy files from the same place, copy them to your custom model location, and rename them to your custom model name (if you didn't just use the stock model name but in a custom folder).

For example: I want to reskin the Sniper to the Christian Brutal Sniper.
I copy the following files from tf/models/player/ to tf/models/player/saxton_hale/
sniper.mdl
sniper.phy
sniper.vvd
sniper.sw.vtx
sniper.dx90.vtx
sniper.dx80.vtx
I rename all the files to be "cbs_v9" instead of "sniper".
I use the MDL Hexer to edit the skin in sniper.mdl.
I use the MDL Hexer's second tab to edit the model that "player/sniper.mdl" is to be "player/saxton_hale/cbs_v9.mdl". This step is no longer needed.
Done.

When using custom SKINS (as in, texture-only replacements), please use the following models as a base, with this plugin to make them download to clients. With this, then even people who use custom-model skins for their stock classes will be able to see the skins. Otherwise, they'd normally be invisible.

stockmodels.zip
The paths are the same as the default models, except with _stock appended (so models/player/scout_stock.mdl).

SO, USE THESE .mdl FILES INSTEAD OF GRABBING THE STOCK TF2 ONES FROM THE GCF WHEN PORTING SKINS.
For some reason these models' mouths don't animate for vocalizations. Nothing I can do about it.
This is still a better solution for the issue with people using clientside skins than making each model have its own extra files.

stockmodels.sp last updated 06/18/2012


Model packs for use with this plugin:
Attached as 'medic_popit_taunt.7z': 'Medic: Pop It, Don't Drop It', 'Heavy: Crotch Chop', for use with this plugin. Files from the "server" directory go onto your server (there's a "tf" folder in there, so you should be able to figure out where on the server it goes). Files from the "fastdl" directory go onto your fastdownload server.
"config_add.txt" is the default model list entries for these four models/taunts.
The High Five versions don't sync up to the song and between the two classes, simply because of the way the high five animations work for them.

Some stuff about inplace animation swaps, backed up from SPUF:
Quote:

Right then:
If your animation file name is too long to fit in the place of the old animation path, you can do a twisted bit of hex editing to point it to a new spot.

First, head to the very end of the file in the hex editor, and after the 00/null byte at the end, add your new animations path (as if it were in the place of the old one), then go to the hex side of the editor and add a null byte (00) after the path.

Next, head to offset hex 154 (ctrl+g to goto). There should be four bytes at that location (using the spy model, you see 98 4A 0E 00). These bytes, reversed, tell us the location of the 'includemodel pointer', the offset at which there's a few bytes telling us where the included .mdl file (the animation file) is. In the case of the spy model, it's 000E4A98, or E4A98, so head there via ctrl+g.

Upon reaching there, you'll see a bunch of zeros. 00 00 00 00. However, that first pair of zeros is an important part. In xvi32, highlight that byte, then go to the menu bar > Address > Remember Address. After the four pairs of zeroes (inconsistent spelling of the plural of 'zero'...), you'll see some nonzero bytes. Those next four should be something like EC 3E 00 00 (for the spy.mdl). This means 00003EEC. Don't head there just yet, though. That offset is relative to that remembered address we just saved, at that null byte. Go up to the menu bar > Address > Jump Width, set the jump width to 3EEC, then highlight that remembered null byte we had, then menu bar > Address > Jump Down (F5 for short). Where do we end up? Right at the start of the old animation file.

So now we can see what we need to do.
Head to the end of the file, and at the new animations file path that you added down at the bottom (models/whatever_anims_incredibly_long_filepath/pants.mdl), highlight the first byte of it. Go to menu bar > Address > Display Difference, and look at the 'Difference hex'. In the case of the spy.mdl, it should be 40C9. Reverse this so that it's C9 40 00 00, and replace the EC 3E 00 00 with the new four bytes (quickly get there via menu > Address > Goto remembered, then move over to the right by 4 bytes).

One more thing, the size of the file has changed so we need to tell the file that its new end is at the new end byte, not the old one. First, go to the very end of the file, on the hex side, and look at the very very last byte's "Adr. hex". Add 1 to that number (I've swapped out the spy model to use Heavy animations, so adr. hex shows E8B82, so I'm remembering E8B83. For those unfamiliar with hex, if your thing ends in 9, you make it A. If your thing ends in a letter, go to the next letter (A to B, B to C, etc). If it's F, make it a 0 and add 1 to the next letter up (so E8B8F would go to E8B90).

Ctrl+G, goto offset 4C, convert your number to the reversed format (so mine would be 83 8B 0E 00), and replace whatever's at 4C with that.
SAVE.

You should be done.
Yikes.
I'll try to get pics up of a spy model example soon.


eraserhead 08-13-2011 22:25

Re: [TF2] Model Manager 1.0.0 (08/13/2011)
 
Excellent work Flamin Sarge.

jameless 08-13-2011 22:25

Re: [TF2] Model Manager 1.0.0 (08/13/2011)
 
Glad to see this. Can't wait to have some fun with it.

SmackDaddy 08-13-2011 23:50

Re: [TF2] Model Manager 1.0.0 (08/13/2011)
 
Where would be a good place to find/download models to use with this? A list of places could be helpful in promoting this plugin as well Sarge. Thanks for the time you take for these plugins!

Snaggle 08-13-2011 23:55

Re: [TF2] Model Manager 1.0.0 (08/13/2011)
 
Gonna check this out tonight and have some fun, thanks very much.

loranger 08-14-2011 03:15

Re: [TF2] Model Manager 1.0.0 (08/13/2011)
 
is latest sm 1.4 files (tf2.inc & tf2 stock.inc) compatible with saxtonhale 1.35?

FlaminSarge 08-14-2011 03:28

Re: [TF2] Model Manager 1.0.0 (08/13/2011)
 
Loranger: yes. But this isn't the saxton hale thread.

Smackdaddy: I'll put up info on how to make custom models. Hopefully we can get it so that we don't have a million unique filepaths for what really is the same model. Mecha the Slag's model hexing plugin is a nice shortcut of the method I use to convert skins to custom models for use with this plugin.

Drixevel 08-14-2011 03:57

Re: [TF2] Model Manager 1.0.0 (08/13/2011)
 
This plugin looks very interesting, i will be testing it out soon as well. :]

scopesp 08-14-2011 04:07

Re: [TF2] Model Manager 1.0.0 (08/13/2011)
 
wow great :)
thank you will try later


All times are GMT -4. The time now is 13:20.

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