How to Change Model in UCC on Equip Item in UIS

jkaczmar

Member
I'm trying to Change the UCC character model when I equip an Item in UIS. I'm using the models to change outfits as I'm using Synty characters and for clothing changes you swap the entire model. I'm also using PlayMaker. I've figured out how to fire an event to PlayMaker when the Inventory Bridge registers an equip action, and I know how to change the Character Model using PlayMaker.

The specific problem I can't yet solve is how to pass a parameter along to PlayMaker so it can know which model to switch to. Is there any way to interrogate equipped Inventory items from within PlayMaker to get Item attributes? I know how to generically get Inventory Item attributes using PlayMaker, but I don't know how to get them for a specific equipped item.

Also, I'm not wed to using PlayMaker to solve this issue if there are other approaches that are better/easier. Thanks in advance for any ideas people have.
 
Hum... that's a good question. I don't think you can do this in playmaker without wrinting any code.

If you want to continue with Playmaker I would recommend you write the code for a custom play maker action to achieve what you need.

The code is getting the currently equipped item. Then getting a prefab from an attribute on that item right?

You'll find some code examples here for getting the equipped item when using character items:

In your case though I won't recommend character item for clothes. For clothes (or items that cannot be used like weapons or tools) I recommend using pur UIS equipping. You can find more here:

You can find what item is equipped that way like so:

And you can get an attribute from them like so:

With that you should be able to get the currently equipped item. Then get an attribute on it (the prefab) and then tell play maker to spawn that prefab and replace the current one. I hope that helps :)
 
I'm actually not trying to get a prefab, but likely an Integer that ties back to the number of the model (0-3 in my case, since I have 4 different models defined in UCC for 4 different outfits.) I'll then use the Change Model functionality in UCC to make the actual switch. I didn't even realize there were custom code examples for the Bridge, so this is huge helpful. Thanks for the help.
 
Hum... that's a good question. I don't think you can do this in playmaker without wrinting any code.

If you want to continue with Playmaker I would recommend you write the code for a custom play maker action to achieve what you need.

The code is getting the currently equipped item. Then getting a prefab from an attribute on that item right?

You'll find some code examples here for getting the equipped item when using character items:

In your case though I won't recommend character item for clothes. For clothes (or items that cannot be used like weapons or tools) I recommend using pur UIS equipping. You can find more here:

You can find what item is equipped that way like so:

And you can get an attribute from them like so:

With that you should be able to get the currently equipped item. Then get an attribute on it (the prefab) and then tell play maker to spawn that prefab and replace the current one. I hope that helps :)
I was able to (almost) figure out how to do this. You can call the PlayMaker FSM using an attribute in the Inventory item that can be changed for each outfit/UCC model. They can therefore call different PlayMaker FSMs that change to the appropriate model. However, I have one last challenge that I'm facing. I posted separately in UIS about whether Multi Item Action is working as intended. If I can use it to call an FSM and Equip the item with a chain of individual Item Actions, everything should work. The other posting has the details of what I think might be off with Multi Item Action.
 
This solution isn't as flexible as MultiItemAction could be, but it combines a call to Equip with an FSM call to PlayMaker. It does the job for me, but I'm posting for others to use as it is a good way for those using PlayMaker to equip an item in inventory then use PlayMaker FSMs to update any player Attributes, etc. due to equipped Outfits, Weapons, Armor, etc.
 

Attachments

Back
Top