Aller au contenu

Photo

GetMainControlled - better alternative? (DAII); Also, re-usable items


  • Veuillez vous connecter pour répondre
2 réponses à ce sujet

#1
mesmerizedish

mesmerizedish
  • Members
  • 7 776 messages
So, GetMainControlled only seems to be whichever character is selected in regular game mode. Which is to say, it doesn't account for selecting a new character while in a menu.

So, if Hawke is my currently controlled character, I open the inventory, switch to Isabela, and use my item (which activates my ability, which runs my script that uses GetMainControlled as its target), it acts as though Hawke had used the item, not Isabela.

Is there a way around this?




Second question - Is there a way to make a useable item re-usable? That is... an on-use item that is not consumable? What's happening currently is that if I use the item, it remains in the inventory, but it can't be used again. Any new instances of the item I acquire while it's still in my inventory are also unusable.

With items I want to be consumable, we (read: hoorayforicecream) added a line to remove the item into the ability script. With this new item that I'd like to be re-usable, I'm doing the same, with an added line to add a new copy of it after removing the old one. The is works well enough, but is hacky, and causes a "new item" alert every time the item is used.

Tangential question: is there any way to get an item to activate while still in the inventory, as opposed to forcing the player to exit the menu and unpause for the ability to run?

Modifié par ishmaeltheforsaken, 19 août 2011 - 11:36 .


#2
Sylvius the Mad

Sylvius the Mad
  • Members
  • 24 090 messages
Is that related to the problem in DA2 where abilities selected for use by one character get applied to the target that was selected last, regardless of which character selected that target?

#3
Sunjammer

Sunjammer
  • Members
  • 925 messages
In Origins item abilities scripts handle the EVENT_TYPE_SPELLSCRIPT_* events all of which have the caster as event object 0 and most have the target as event object 1. Therefore depending on your item's ability using GetEventObject on one or both of these should give you what you the user.

Similarly in Origins, Kolgrim's Horn (the urn210im_dragon_horn.uti item and the ITEM_KOLGRIMS_HORN ability in ABI_Base) would seem to be a good example of what you are trying to do. It is multi-use up until the point it successfully summons the dragon.

Incidentally in case it is a quicker fix, assuming it works you should be able to suppress the "item acquired" message using the CreateItemOnObject function's bSuppressNotification parameter or the UT_AddItemToInventory wrapper's bSuppressNote parameter.

I'll have a play about and see if I can't get some more definitive answers for you.

Modifié par Sunjammer, 20 août 2011 - 10:24 .