Author Topic: Customizing weapons with colors higher than 4, is this on the right track?  (Read 877 times)

Legacy_OldTimeRadio

  • Hero Member
  • *****
  • Posts: 2307
  • Karma: +0/-0
Customizing weapons with colors higher than 4, is this on the right track?
« Reply #15 on: November 18, 2012, 12:30:41 am »


               

henesua wrote...
OTR, I believe you are over thinking this.

Maybe.  '<img'>

What you have is a function...

Understood.  I'm just wondering out loud where that "4" comes from.  It might simply be a hex value someplace.  The reason why I entertain the possibility of some more complex reason is purely because the toolset uses a convoluted test to determine how to show 3-part models and their shapes and colors.  That's all.  Just the hypothesis that the max value in CopyItemAndModify for 3-part weapons might be derived from something else.
               
               

               


                     Modifié par OldTimeRadio, 18 novembre 2012 - 12:31 .
                     
                  


            

Legacy_henesua

  • Hero Member
  • *****
  • Posts: 6519
  • Karma: +0/-0
Customizing weapons with colors higher than 4, is this on the right track?
« Reply #16 on: November 18, 2012, 12:36:17 am »


               

OldTimeRadio wrote...

I'm just wondering out loud where that "4" comes from.  It might simply be a hex value someplace.  The reason why I entertain the possibility of some more complex reason is purely because the toolset uses a convoluted test to determine how to show 3-part models and their shapes and colors.  That's all.  Just the hypothesis that the max value in CopyItemAndModify for 3-part weapons might be derived from something else.


The solution I think really comes down to gaining access to that function. Once you have it you can make the changes you want. Otherwise, I don't see what we can do.
               
               

               
            

Legacy_henesua

  • Hero Member
  • *****
  • Posts: 6519
  • Karma: +0/-0
Customizing weapons with colors higher than 4, is this on the right track?
« Reply #17 on: November 18, 2012, 01:53:00 pm »


               Went sleuthing and found the declaration for CopyItemAndModify in nwscript.  But no function body. I suspect this means that the function is hardcoded. I'll await the experts to weigh in there. Is this true? Any function declaration found in the script "nwscript" which lacks an implementation is therefore hardcoded in the engine.
               
               

               
            

Legacy_Lightfoot8

  • Hero Member
  • *****
  • Posts: 4797
  • Karma: +0/-0
Customizing weapons with colors higher than 4, is this on the right track?
« Reply #18 on: November 20, 2012, 12:51:49 am »


               I found a little bit of time to look at this today.   

So far it looks like the 4 is hard coded.   It looked like if a value greater then 4 was passed the new modification was just concidered invalid and a straight copy of the old item was then created(  A guess I got a head ach trying to trace it out.)    

There is no dout though that the first check against the Arg is a hardcoded 4.      I guess you could try to simply hak the server and change that 4 to your 9.   I am not really sure what the results would be if an invalid number was passed though.   

If you wanted to try that on the windows version of the server,  I could pass you the location to edit.    I am not really sure what im looking at on the Mac version to find the location. 


 
               
               

               
            

Legacy_Pearls

  • Full Member
  • ***
  • Posts: 194
  • Karma: +0/-0
Customizing weapons with colors higher than 4, is this on the right track?
« Reply #19 on: November 20, 2012, 01:12:30 am »


               if you post or pm about the win version i can do the same for linux if needed, dont know anything about macs though '=]'
               
               

               
            

Legacy_henesua

  • Hero Member
  • *****
  • Posts: 6519
  • Karma: +0/-0
Customizing weapons with colors higher than 4, is this on the right track?
« Reply #20 on: November 20, 2012, 01:18:09 am »


               I've got the mac version.

Would I have to decompile it and look at binary?

Those are things that I don't know how to do.
               
               

               
            

Legacy_OldTimeRadio

  • Hero Member
  • *****
  • Posts: 2307
  • Karma: +0/-0
Customizing weapons with colors higher than 4, is this on the right track?
« Reply #21 on: November 20, 2012, 01:27:34 am »


               

Lightfoot8 wrote...
There is no dout though that the first check against the Arg is a hardcoded 4.

If you're seeing it in the code, it's hard coded.  What's the location?  I have IDA Pro and I'd be interested to poke (or is it peek?) around there.

I believe Acaos already released a Linux plugin that does this, but I don't know if one was ever done for Windows. (?)

And thanks!
               
               

               
            

Legacy_Lightfoot8

  • Hero Member
  • *****
  • Posts: 4797
  • Karma: +0/-0
Customizing weapons with colors higher than 4, is this on the right track?
« Reply #22 on: November 20, 2012, 02:20:03 am »


               

OldTimeRadio wrote...

...If you're seeing it in the code, it's hard coded.  What's the location?  I have IDA Pro and I'd be interested to poke (or is it peek?) around there.


 I wish it was that simple.   I do agree that I am 99% on it being hard coded.   the 1% is because of how little I have traced past it checking against 4.   If the code simply replaced the value over with a default value I would be 100%.  For All I know it may try to derive new Max values if the value is over 4.   My 1% uncertenty still remains. 




Back on track...

If you are changing the value in memory after the server is running the location is:   0x0058A872

If you are hacking the .exe the location is at :  0x0018A872 in the file.

and just incase I have done something to my copy of the exe that has offset the location in the file here is a hexstring with the needed value highlighted.

14 02 00 00 E9 6B 02 00 00 8B 45 0C 83 F8 31 BA 04 00 00 00 74 21 83 F8 65 74 1C 83 F8 68 74 17 83 F8 1A 75 0B 85 C9 75 22 BA 03 00 00 00 EB 24
               
               

               
            

Legacy_OldTimeRadio

  • Hero Member
  • *****
  • Posts: 2307
  • Karma: +0/-0
Customizing weapons with colors higher than 4, is this on the right track?
« Reply #23 on: November 20, 2012, 03:35:35 am »


               Thanks for taking the time, I appreciate it....a lot
               
               

               
            

Legacy_henesua

  • Hero Member
  • *****
  • Posts: 6519
  • Karma: +0/-0
Customizing weapons with colors higher than 4, is this on the right track?
« Reply #24 on: November 21, 2012, 02:02:11 pm »


               I know we've moved on but I found an issue with CopyItemAndModify that I had not anticipated before.

Lets say you have a dagger, and want to change the top part. Currently the top part is Model_7 with Color_6, and you want to change this to Model_1 Color _4. If you lack Model_1 Color_6, and lack colors 1-4 for Model_7, you will likely be unable to change the object's appearance as desired. Changing the model part to 1 returns an error, and changing the color to anything at all returns an error.

Just FYI.

So, I'm definitely going with my method... along with a custom 2da or some other list to sort through all the potential forms.
               
               

               


                     Modifié par henesua, 21 novembre 2012 - 02:03 .