[Reqz}Little Script Help

Post » Sat Jun 05, 2010 11:29 am

Ok, I am making a spell that does the following:
Adds a potion to target npc's inventory
adds a scriptpackage that forces them to drink it
then another scriptpackage that forces them to find more potions of the same type

The problem I am having is once they find more I cannot seem to make them drink the ones in their inventory.
Any help would be appreciated even a better way to make them do this.

thank you.
User avatar
Charlotte Buckley
 
Posts: 3532
Joined: Fri Oct 27, 2006 11:29 am

Post » Sat Jun 05, 2010 11:47 am

Ok, I am making a spell that does the following:
Adds a potion to target npc's inventory
adds a scriptpackage that forces them to drink it
then another scriptpackage that forces them to find more potions of the same type

The problem I am having is once they find more I cannot seem to make them drink the ones in their inventory.
Any help would be appreciated even a better way to make them do this.

thank you.

Try using the spell to add a token to their inventory that will make them drink the potion once it's in their inventory. I'm not sure exactly what the scripting for the token would look like, but using a Begin GameMode block for it should work. In theory.
User avatar
meghan lock
 
Posts: 3451
Joined: Thu Jan 11, 2007 10:26 pm

Post » Sat Jun 05, 2010 11:46 am

Ok It's driving me crazy..lol
What I am trying to do is I have a spell that the player will cast upon an npc.
this will add a potion and a ring to the target
the ring has a script upon it that i am trying to add packages to the npc so that it will force the npc to go find more of the potions,
and when the potions are found they will drink them
here is my script that is on the unplayable ring (token?)
Please help me figure this out, thanks :) (I am basically wanting to make the targeted npc become skooma addicts or similate that by making them always go find and drink skooma. This way you can pick and choose who is an addict.
scn Wmaddict2token
short WMBravilSkoomaAddictSeek
short WMTestDrinkSkooma
Begin GameMode

if GetItemCount PotionSkooma1 == 0
addScriptPackage WMBravilSkoomaAddictSeek
set WMBravilSkoomaAddictSeek to 1
endif
end
Begin GameMode
if GetItemCount PotionSkooma1 >= 1
set WMBravilSkoomaAddictSeek to 0
removeScriptPackage WMBravilSkoomaAddictSeek
addscriptpackage WMTestDrinkSkooma
evp
endif
end
User avatar
Krystal Wilson
 
Posts: 3450
Joined: Wed Jan 17, 2007 9:40 am

Post » Sat Jun 05, 2010 3:06 pm

I think the problem is that you have two separate Begin GameMode blocks in the same script. The first one is the only one being processed. Try this:

scn Wmaddict2tokenshort WMBravilSkoomaAddictSeekshort WMTestDrinkSkoomaBegin GameModeif GetItemCount PotionSkooma1 == 0  addScriptPackage WMBravilSkoomaAddictSeek  set WMBravilSkoomaAddictSeek to 1elseif GetItemCount PotionSkooma1 >= 1  set WMBravilSkoomaAddictSeek to 0  removeScriptPackage WMBravilSkoomaAddictSeek  addscriptpackage WMTestDrinkSkooma  evpendifend

User avatar
Romy Welsch
 
Posts: 3329
Joined: Wed Apr 25, 2007 10:36 pm

Post » Sat Jun 05, 2010 5:05 pm

bleh not working
Is there a way to make a quest that has variables for this?
So basically if the npc has the potion(s) in inventory they will drink it(using the useitem ai package)
and a second variable that says if they have no potions of that type in inventory they will go find some(using find ai package)

then would need the script to put in spell to force the npc once hit with the spell to have that quest running?
There has got to be a way to do this, I am just at a loss. The furthest I've gotten is making them drink it and then go find more but after they find more they just stand around until their normal ai takes over. I need it to loop so that once this is initiated they will always look for skooma and then drink the skooma if they have some.
Really want this to happen, any help is appreciated.
User avatar
^~LIL B0NE5~^
 
Posts: 3449
Joined: Wed Oct 31, 2007 12:38 pm

Post » Sat Jun 05, 2010 9:22 pm

Ok I got it working.
For reference for others here is the script it works great:
Place on Token Item (mine is on ring)
scn Wm3337ref actorshort aiprocedureshort aipackagefloat packageevaluatetimershort evaluateonceBegin GameModeif (actor == 0)		set actor to GetContainer		return	endif	if (actor != 0 && actor.GetDisabled == 1)		set actor to 0		return	endif	if (actor.IsActor == 0)		return	endifif (actor.GetItemCount Potionskooma1 >= 1 && actor.GetisCurrentPackage WMTestDrinkSkooma == 0)		actor.RemoveScriptPackage		actor.AddScriptPackage WMTestDrinkSkooma		set evaluateonce to 0		set packageevaluatetimer to 0		endif	endifif (actor.GetItemCount Potionskooma1 == 0 && actor.GetisCurrentPackage WMBravilSkoomaAddictSeek == 0)		actor.RemoveScriptPackage		actor.AddScriptPackage WMBravilSkoomaAddictSeek		set evaluateonce to 0		set packageevaluatetimer to 0		endif	endifend


So with the spell that places 1 skooma in targets inventory, and places the token in their inventory they drink the one in their inv and then run around like skooma addicted crazies
:)
User avatar
[Bounty][Ben]
 
Posts: 3352
Joined: Mon Jul 30, 2007 2:11 pm

Post » Sat Jun 05, 2010 11:17 pm

there are redundant endif in the script posted
User avatar
Sxc-Mary
 
Posts: 3536
Joined: Wed Aug 23, 2006 12:53 pm


Return to IV - Oblivion