03-27-2023, 02:26 AM
(This post was last modified: 03-27-2023, 02:26 AM by DerVVulfman.)
(03-22-2023, 08:37 PM)DerVVulfman Wrote: I'm back at it... and still having fun with the paperdoll system I just worked on weeks ago. However, I am now adding two advancements, the first one ... outstanding!
The second feature is nearly done! I just now need to clean up the code and the temporary/test graphics. The feature... changing/substituted graphics based on what is worn.
Wait. What does that even mean?
Well... it means that an item being rendered on the sprite may change if the actor is wearing ANOTHER item with it. For example, if the player is wearing a normal outfit and dons a cloak, the cloak appears fairly slim and form fitting over the actor. BUT... if the player is wearing a very bulky suit of armor, the cloak worn is gonna be stretched wide over the pouldrons and so on.
So yeah, what your hero wears may change the graphics altogether, and based on the gear it wears.
So... how do you set that up??? Well, each item that can visually change is assigned an array containing the IDs of gear that triggers its change... and you got OPTIONS!!!
SUBSTITUTE[41] = [ 42, [13,14,15,16,17,18,19,20] ]
SUBSTITUTE[41] = [ [42, [13,14,15,16,17,18,19,20]] ]
SUBSTITUTE[41] = [ [42, [13,14,15,16]] , [43, [17,18,19,20]] ]
Like I said... each item (assuming item ID 41) is assigned an array. And here, I have three examples that show it doesn't take much at all to set up an item to get replaced. And the above examples assumes a few things. First, is that you have the generic RTP armors, armor IDs 13-16 being Aluxes's basic armor while IDs 17-20 being Basil's plate armor. And it assumes that ID 41 is the ID of a cloak.
The first example that tests this cloak will replace the ID of the cloak with #42... but only if the actor is wearing any of the 8 armors in the array...
The second and third examples show that you can have one or more defined replacements for an item. And yes, the second array performs the same function as the first... just that it is a list of ONE replacements.
The third example has two sets of defined replacements... If the actor is wearing any of the Aluxes armor (13-16), then the ID of the cloak will be replaced with 42. But if the armor worn is Basil's (17-20), then the ID is instead replaced with the value of 43.
The FUN thing to note is that the replacement ID does not affect the actual items worn by the player and need not be in the database. I could set the replacement IDs to 1042 and 1043 and it doesn't care. Only that I have the replacement graphics set up with a properly defined EQUIP entry matters.