Pocket Plane Group

Miscellany, Inc. => Infinity Engine Modding Q&A => Topic started by: Diana on July 01, 2005, 05:57:34 PM

Title: Another 'dumb' question re backpack items
Post by: Diana on July 01, 2005, 05:57:34 PM
Guys and gals, can you all give me a hint as to how I would envoke something like Daystar's light ability which destroys wraiths and such?  I know how to code wizard spells, innate spells, but I'm not sure how you code stuff associated with items in your inventory so it goes off via scripting when one encounters enemies.

Thanks all and have a happy holdiay!  Don't work too hard!
Title: Re: Another 'dumb' question re backpack items
Post by: jcompton on July 01, 2005, 06:38:06 PM
I can't help you craft the spell (although certainly, looking at Daystar's usable effects would be a great start!) but do you mean you just want the bad guys to go poof even if the item isn't equipped or activated?

In that case, you might consider putting some sort of code like this in the _creature's_ script:

IF
PartyHasItem("TheKillingMeItem")
THEN
RESPONSE #100
DestroySelfInAnInterestingMannerMaybeWithTheFlashyDeathYeahSpellOrSomething()
END
Title: Re: Another 'dumb' question re backpack items
Post by: Diana on July 02, 2005, 05:36:10 AM
That's pretty much it.  I want to activate DayStar's ability via script in certain situations rather than having to cllick on the backpack icon and manully do it.

Thanks
Title: Re: Another 'dumb' question re backpack items
Post by: jcompton on July 02, 2005, 02:13:22 PM
My simplistic method wouldn't actually decrement Daystar's times-per-day counter, and of course you'd probably want to work in something so that the bad guys were in range of the Daystar wielder, etc. etc. But, yeah, in lieu of better advice from somebody who knows what they're talking about, I would suggest putting the relevant "kill-me" scripting bit into the enemy AI in question, presuming that the baddies you want to destroy have an AI specific to their creature type. If not, you may need to patch or assign a new override script.
Title: Re: Another 'dumb' question re backpack items
Post by: Idobek on July 02, 2005, 02:48:23 PM
You might want to experiment with SelectWeaponAbility(I:WeaponNum*Slots,I:AbilityNum*).
Title: Re: Another 'dumb' question re backpack items
Post by: Diana on July 03, 2005, 07:08:19 AM
I decompiled GMAGE.BS from the gSeries to see how they invoked the ability of the Girdle of Fortitude and it appears that they do a simple check to see if you have the spell and then proceed from there.  So I guess I can do a check for baddies within range and a check for the spell 'Sunray' and if I haven't drained the item just simply cast it.