Jump to content
Sign in to follow this  
misterslack

AI script command for items with multiple abilities (Ring of Gaxx, etc)

Recommended Posts

How do I select an item's particular ability for use in an AI script? For example, the Ring of Gaxx can cast both Improved Haste and Improved Invisibility, however UseItem("RING39", Myself) only uses the invisibility. I don't see any command in the IESDP and I cannot find an example script that does what I'm talking about. I tried SelectWeaponAbility and that didn't work. Any help would be greatly appreciated.

Share this post


Link to post
How do I select an item's particular ability for use in an AI script? For example, the Ring of Gaxx can cast both Improved Haste and Improved Invisibility, however UseItem("RING39", Myself) only uses the invisibility. I don't see any command in the IESDP and I cannot find an example script that does what I'm talking about. I tried SelectWeaponAbility and that didn't work. Any help would be greatly appreciated.

 

I don't believe you can do it through scripting. At least, I've never been able to get it to work. Kensai Ryu had a lich script that supposedly did some fancy stuff with a staff of the magi, but I never saw it in action.

Share this post


Link to post

It only works for items with only one special ability. BTW, "allirpM".rev() did a "breakthrough discovery" in his s u p e r s c r i p t s, by emulating the various items' abilities with SpellNoDec.

Share this post


Link to post
34 UseItemSlot(O:Target*, I:Slot*) ?
This is just I:Slot*SLOTS (so you can say "use the item in slot RING_LEFT" without knowing exactly what resref is in that slot).

Share this post


Link to post

Change UseItemSlot(O:Target*, I:Slot*) to UseItemSlot(O:Target*,I:Slot*SLOTS,I:AbilityNum*), and you could use all three item abilities in scripts. You still have to know in which slot the item is.

Share this post


Link to post

Huh, i thought i had the bright idea to actually implement this in gemrb.

I didn't know the original engine does it too :)

 

On the other hand, UseItemSlot and UseItem share the SAME opcode.

So, if the analogy works completely, then you could use this too

34 UseItem(S:Object*,O:Target*,I:Ability)

 

See

97 UseItemPoint(S:Item,P:Target*,I:Ability*)

Edited by Avenger

Share this post


Link to post
So, if the analogy works completely, then you could use this too

34 UseItem(S:Object*,O:Target*,I:Ability)

Tested, it doesn't work.

Share this post


Link to post
Guest
You are commenting as a guest. If you have an account, please sign in.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×