Jump to content

Implementing custom weapon models


Fuji

Recommended Posts

First and foremost, backup the file "zombie/core/skinnedmodel/ModelManager.class". Put it somewhere safe.

Next you'll need a model with texture in their appropriate "media" folders. I won't explain how to model for PZ here, but Jab's blender converter should help http://theindiestone.com/forums/index.php/topic/12864-blender-3d-model-import-export-scripts-274-wip/

Now find and download a utility which can view and edit Java bytecode. I use http://set.ee/jbe/ but there are definately others.

Open JBE, and find the file we made a backup of earlier and open it.

In the sidebar, open the "Methods" folder, "create", and click on "Code"

You should see a long list of commands in the main window. Choose "Code Editor" and scroll to the part of the code mentioning model names.

The method call to load a model looks like this:

aload_0

ldc "weapons_model"

ldc "Objects_texture"

invokespecial zombie/core...etc

pop

Just find one of the existing blocks, and copy it, then replace the model/texture name. Note that the model MUST begin with "weapons_".

Save the method.

Your model is now available for use in item scripts. "WeaponSprite" tags will be the model name without "weapons_".

Link to comment
Share on other sites

The only issue I can already see with this, is that it is a direct violation of the PZLicense (included in your gamefiles), and may result in some sort of responsive action from the Devs (unlikely, but not impossible).

According to the Modding rules posted on the forum, I can edit whatever I want as long as it doesn't harm the users computer.

Link to comment
Share on other sites

 

The only issue I can already see with this, is that it is a direct violation of the PZLicense (included in your gamefiles), and may result in some sort of responsive action from the Devs (unlikely, but not impossible).

According to the Modding rules posted on the forum, I can edit whatever I want as long as it doesn't harm the users computer.

 

True, I never read the modding exceptions (until now!)

 

Although, legally, the license would overrule the modding conditions, because it is distributed with the game itself, whereas the modding rules are only found here on the Forums (and not required to be viewed and accepted before playing, or 'using' the software [in a similar manner to the IWBUMS steam branch]).

 

The part(s) of the license being breached would be (a) and (b)

 

 

Restrictions. Licensee may not without expressed permission from The Indie Stone, and may not permit others to:
 

(a) reverse engineer, decompile, decode, decrypt, disassemble, or in any way derive source code from, the Software;

 
(b) modify, translate, adapt, alter, or create derivative works from the Software using decompiled source code;

 

TIS might want to make a change, or a clearer stance on these terms - because as it stands (I believe) you could modify the source code to give yourself any kind of advantage over others in multiplayer, and be fair use by the 'modding rules and guidelines' even though you're directly contradicting the PZLicense itself. Conversely, someone (like yourself) could make changes and be confronted with a breach of the PZLicense, thinking you were safely covered by the (undistributed) modding rules.

Link to comment
Share on other sites

The only issue I can already see with this, is that it is a direct violation of the PZLicense (included in your gamefiles), and may result in some sort of responsive action from the Devs (unlikely, but not impossible).

According to the Modding rules posted on the forum, I can edit whatever I want as long as it doesn't harm the users computer.

True, I never read the modding exceptions (until now!)

Although, legally, the license would overrule the modding conditions, because it is distributed with the game itself, whereas the modding rules are only found here on the Forums (and not required to be viewed and accepted before playing, or 'using' the software [in a similar manner to the IWBUMS steam branch]).

The part(s) of the license being breached would be (a) and (b)

Restrictions. Licensee may not without expressed permission from The Indie Stone, and may not permit others to:

(a) reverse engineer, decompile, decode, decrypt, disassemble, or in any way derive source code from, the Software;

(b) modify, translate, adapt, alter, or create derivative works from the Software using decompiled source code;

TIS might want to make a change, or a clearer stance on these terms - because as it stands (I believe) you could modify the source code to give yourself any kind of advantage over others in multiplayer, and be fair use by the 'modding rules and guidelines' even though you're directly contradicting the PZLicense itself. Conversely, someone (like yourself) could make changes and be confronted with a breach of the PZLicense, thinking you were safely covered by the (undistributed) modding rules.

Truthfully, though, cheating in a multiplayer game isn't strictly illegal. (Otherwise Hasbro would have free reign to sue me for every Monopoly game I've ever played.)

But regardless, by the way the terms are worded, they're more geared toward stopping people from stealing parts of their game for their own projects.

Technically, I'm not breaching anything anyway, as I'm editing existing, already compiled code which stays where it is, and therefore is simply a modification, and not derivative software.

Link to comment
Share on other sites

So, is this working for a mod? Or we have to modified the actual game?

I haven't been able to make it work as a mod yet.

>stuff<

Have you been able to make it work as a mod Fuji?

Yep, but only if you replace the original file. I've been working with ORMtnMan and a few others on replacing all of the models in his mod.

The only downside is two mods will be incompatable unless you open up the class and paste in the model definitions from the other mod(s)

If someone wants to do it, a public model resource collection and the requisite ModelManager could solve that. Models are small enough (a few MBs at most) that people could just download every model from every mod and there wouldn't be any need for regular players to mess around with files.

Link to comment
Share on other sites

Question, is this only possible with weapons or could you make new clothing a possibility also?

Weapons only, unfortunately. Clothing models reference the Characters texturepack, which is full of .dds files that, unless I missed something, no one's managed to crack to any degree at which they can be reassembled.

I tried just changing how models are loaded in the code, but everything dealing with character sprites tends toward spaghetti.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...