Question regarding "Cast Spell on Condition" and Familiars
Corsymyr
Member Posts: 146
I am trying to find a way to use the "Spell Effect: Cast Spell on Condition [232]" OPCODE with Familiars. The idea is to set "Target" to 0, and the Condition to 4 (HP<10%) and the resource to be "get into my backpack before you get squished". Obviously the piece missing is how to recall your familiar without the dialog file. I have found the IDS from the DLG file
GiveItemCreate("FAMFER",PLAYER1,0,0,0)
DestroySelf()
How would I get this to be a spell? I wrote it as a script but 232 wants it to be a spl file not a bcs. Any help would be very much appreciated!
TIA
GiveItemCreate("FAMFER",PLAYER1,0,0,0)
DestroySelf()
How would I get this to be a spell? I wrote it as a script but 232 wants it to be a spl file not a bcs. Any help would be very much appreciated!
TIA
0
Comments
IF
HPLT(Myself,10)
THEN
RESPONSE #100
GiveItemCreate("FAMFER",PLAYER1,0,0,0)
DestroySelf()
END
?
With some WeiDU magic and variable switching (that I suck at) you could do this for all familiars in a single command.
I can't remember if familiars heal themselves when they go to your pack--if they don't, you'll never be able to get them out again with that script. Every time they emerged they'd still be under 10 HP and go right back in. With a few more refinements:
IF HPLT(Myself,10) ActuallyInCombat() THEN RESPONSE #100 MoveToObject(Player1) GiveItemCreate("FAMFER",PLAYER1,0,0,0) DestroySelf() END
This adds a trigger so that the familiar only flees if combat is active and will move to Player1 before going into the pack for a little more realism.
Feel free to use it to enhance all your familiars. Also open to all criticism.
AUTHOR ~lansounet~
BEGIN ~Familiar automatic move to inventory~
ACTION_FOR_EACH familiar IN famcat famdust famfair famfer famimp fampsd famquas famrab BEGIN
<<<<<<<< %familiar%.baf
IF
HPPercentLT(Myself,10)
ActuallyInCombat()
THEN
RESPONSE #100
MoveToObject(Player1)
GiveItemCreate("%familiar%",Player1,0,0,0)
DestroySelf()
END
>>>>>>>>
COMPILE EVALUATE_BUFFER ~%familiar%.baf~
COPY_EXISTING ~%familiar%.cre~ ~override~
PATCH_IF SOURCE_SIZE > 0x2d3 BEGIN
WRITE_ASCIIE 0x248 ~%familiar%~
END
BUT_ONLY
END
The funny thing is that the rabbit can do some serious butt kicking. I had to kill about 4 gaurds in Candlekeep before he dies.
Here is the BAF file I compiled to BCS.
IF
HPLT(Myself,10)
ActuallyInCombat()
THEN
RESPONSE #100
MoveToObject(Player1)
GiveItemCreate("FAMRAB",PLAYER1,0,0,0) //Familiar
DestroySelf()
END
I then changed it to:
IF
HPPercentLT(Myself,90) //Went with 90 to get a one hit run back to me.
ActuallyInCombat()
THEN
RESPONSE #100
MoveToObject(Player1)
GiveItemCreate("FAMRAB",PLAYER1,0,0,0) //Familiar
DestroySelf()
END
Neither one made any difference in his actions. Weird. Perhaps I will try to create an item and equip him with it and see if that changes anything. Either way, thanks for all the information, as I am sure it will come in handy.
As for familiar HP, I think they only recover health when you rest so they will come for the backpack as long as they're hurt (whatever the hp trigger you use) if you remove the combat trigger, which makes some sense anyway.
You cannot safely call inlined files "%familiar%.baf". They should have names guaranteed to be unique to your mod.
However I would like to know how to compile 1 -inlined or not- baf into several others with a variable that changes on every occurence, I couldn't find an easy solution so I went with what worked.
cbission's Familiars pack gave all the familiars a hidden ring of regeneration to avoid this problem.
L.
Thanks!
L.
I actually figured out the Hide Button, I have to set it's class to one that uses said feature. If I set his class to Bard I would get Bard Song, I assume. Still unable to get Innate button to light up though. Perhaps I could just give him items with spell effects and go that route ... not as clean, but doable.
If this isn't what you're asking, are you aware of the Hide() action? I don't think you need the actual button to be able to do this; you can just stick it in the script. Of course, unless the actor (the familiar) is a thief, they will have a Hide in shadow skill of zero, so it will automatically fail. So make sure you give the actor profile some skill points.
If you're not willing to make the actor a thief class, you can create a custom innate ability (which we'll call HideCheating for this post), simply containing the action Hide(). Then you can either add the innate ability to the actor in the usual way. That seems a lot of work though, given you can just do what I explained above?
You might find http://www.pocketplane.net/tutorials/simscript.html very useful as it has several different methods of actually using scripts and new abilities/spells you've created.
L.
L.