|
Post by shadex on May 25, 2017 20:33:04 GMT
Ok, so i have created a new Enum called Magic, Configured a new equippoint that only takes Magic, I've created an attribute called MagicID, and have the code setup, and added it to the Attribute Event Triggers. When i change it from Magic to Consumable, and i use the item it runs the code, which changes an animator parameter, and works like a potion, as it's using OnApplyAttribute.
All i want to do is simply have it change the animator parameter when it is "equiped" rather then used. Eventually i will want to be able to equip up to 4 at the same time which will be tied into a custom input. Any help would be appreciated.
|
|
|
Post by Invector on May 25, 2017 21:51:03 GMT
I'm not sure if I understand your question.... you're trying to add one more column into the inventory, a new category for magic consumable itens right? but you also wanna equip them?... not following
|
|
|
Post by shadex on May 26, 2017 0:18:04 GMT
I'm not sure if I understand your question.... you're trying to add one more column into the inventory, a new category for magic consumable itens right? but you also wanna equip them?... not following I am trying to make a new item type. That item type contains a simple Int. When i equip that item in the UI, i want to set an int in the animator called "MagicID" to the value of the equiped item. I am basically trying to add my magic system to the inventory system. The idea is to select from a list of magic spells and set a magic spell for each of the 4 inputs. The spell's are basically state machine behaviors, so i simply need a way to set the spells to the inputs. I figured the easiest way was to write a simple input script that when the button is pressed, it would use a trigger + ID to pick the proper spell. What i think i need now is for the inventory system to have 4 slots (one for each input) and to assign the proper ID. The ultimate goal is to simply select a spell and for it to trigger on the proper input. Hopefully this clarifies it slightly. Thanks for the response, i really want to get this working.
|
|
|
Post by shadex on May 26, 2017 0:24:59 GMT
Basically I am trying to create a UI like this from Dragon Quest Heroes 2 in functionality. It doesn't have to look like exactly like it, just be able to select a button, fill it with the proper spell.
|
|
|
Post by tharindu on May 26, 2017 1:05:02 GMT
I'm not sure if I understand your question.... you're trying to add one more column into the inventory, a new category for magic consumable itens right? but you also wanna equip them?... not following I am trying to make a new item type. That item type contains a simple Int. When i equip that item in the UI, i want to set an int in the animator called "MagicID" to the value of the equiped item. I am basically trying to add my magic system to the inventory system. The idea is to select from a list of magic spells and set a magic spell for each of the 4 inputs. The spell's are basically state machine behaviors, so i simply need a way to set the spells to the inputs. I figured the easiest way was to write a simple input script that when the button is pressed, it would use a trigger + ID to pick the proper spell. What i think i need now is for the inventory system to have 4 slots (one for each input) and to assign the proper ID. The ultimate goal is to simply select a spell and for it to trigger on the proper input. Hopefully this clarifies it slightly. Thanks for the response, i really want to get this working. I think you will need some kind of fake equipping code. To set a global int with your magic id. You can use vmeleecombatinput or create your own and upon key press you can see the animator parameter magic id. The idea is to bind a new key by creating a new generic input variable in the same class. Sorry if this is vague. May be we can Skype and I can show you sometime. I'm on GMT+0530. What time zone are you on?
|
|
|
Post by tharindu on May 26, 2017 1:07:07 GMT
Ok, so i have created a new Enum called Magic, Configured a new equippoint that only takes Magic, I've created an attribute called MagicID, and have the code setup, and added it to the Attribute Event Triggers. When i change it from Magic to Consumable, and i use the item it runs the code, which changes an animator parameter, and works like a potion, as it's using OnApplyAttribute. All i want to do is simply have it change the animator parameter when it is "equiped" rather then used. Eventually i will want to be able to equip up to 4 at the same time which will be tied into a custom input. Any help would be appreciated. Shadex, you might also want to take a look at the new system to add an animation. Might solve your woes :D
|
|
|
Post by shadex on May 26, 2017 2:15:16 GMT
I am trying to make a new item type. That item type contains a simple Int. When i equip that item in the UI, i want to set an int in the animator called "MagicID" to the value of the equiped item. I am basically trying to add my magic system to the inventory system. The idea is to select from a list of magic spells and set a magic spell for each of the 4 inputs. The spell's are basically state machine behaviors, so i simply need a way to set the spells to the inputs. I figured the easiest way was to write a simple input script that when the button is pressed, it would use a trigger + ID to pick the proper spell. What i think i need now is for the inventory system to have 4 slots (one for each input) and to assign the proper ID. The ultimate goal is to simply select a spell and for it to trigger on the proper input. Hopefully this clarifies it slightly. Thanks for the response, i really want to get this working. I think you will need some kind of fake equipping code. To set a global int with your magic id. You can use vmeleecombatinput or create your own and upon key press you can see the animator parameter magic id. The idea is to bind a new key by creating a new generic input variable in the same class. Sorry if this is vague. May be we can Skype and I can show you sometime. I'm on GMT+0530. What time zone are you on? I already have all of that setup. It works, if i change the item type to a consumable and use the event "On Apply Attribute" What i most likely need is essentially an "On Equip" Event if it exists, or to make a new event. There may be another way i'm not thinking about, but i did follow the tutorial on making a new item in the inventory system, this is a bit past the tutorial though lol
|
|
|
Post by shadex on May 26, 2017 18:57:43 GMT
I'm not sure if I understand your question.... you're trying to add one more column into the inventory, a new category for magic consumable itens right? but you also wanna equip them?... not following Did i clarify it enough?
|
|
|
Post by Invector on May 26, 2017 21:10:58 GMT
Hmmmmmmmmmmmmmmmmm kind of.... we do have several events on the ItemManager though, this helps?
|
|
|
Post by shadex on May 27, 2017 1:15:40 GMT
Hmmmmmmmmmmmmmmmmm kind of.... we do have several events on the ItemManager though, this helps? That is where i was looking. The problem is that unlike OnApplyAttribute ( aka Attribute Events right above those) it doesn't accept a variable like health maxstamina etc. I created my own MagicID variable via the Enum, and set this code: public virtual void ChangeMagicID(int value) { MagicID += value; anime.SetInteger("animeMagicID", MagicID); Debug.Log (MagicID); if (MagicID < 0) MagicID = 0; } and it works if i use the OnApplyAttribute event when i set the variable to MagicID and set the item type to consumable, but that only works on consume instead of equip. So the code is working, at least there. I also tried On Equip Event in which i called this function, however there is no place to set the variable in the event. What am i missing here?
|
|