I made a spell that summons an animal companion near the actor to follow and fight with him.
But I encounter some problem with the follow procedure
Summoner will be the Actor (not only player) who casts the spell.
There are 4 different kinds of animals to be summoned accoring a random number.
When the actor casts the spell, according to the number an animal must set its owneship to the summoner. (This is not working)
After that it will be moved near the actor (This is working).
The pet will use follow package and run behind the actor who is his OWNER.
To specify the owner, I used the command "SetOwnership" in script.
But SetOwnership doesnt seem to work in my script....
and z% to get the nane of the summoner, turns a big array for numbers to my console (not the name).
Can anyone tell me my mistake?
(I want everytime an actor casts the spell, the animal to get him as its owner and follow him (that wll be done with package i made)
ATTENTION: The spell has Range ( SELF )
ScriptName 0BCallPetScript
;Declare useful variables
;--------------------------------------------------------------------------------------------------
ref Summoner
ref WolfCompanion
ref BearCompanion
ref BoarCompanion
ref LionCompanion
Short CreatureType
string_var name
;Set the variables with references in GENERAL
;--------------------------------------------------------------------------------------------------
Begin GameMode
set Summoner to GetSelf
set name to Summoner.GetName
set WolfCompanion to PetWolfRef
set BearCompanion to PetBearRef
set BoarCompanion to PetBoarRef
set LionCompanion to PetLionRef
;Roll a random number from 1 to 5
;--------------------------------------------------------------------------------------------------
set CreatureType to rand 1 5
;Set the owner to a specific pet (from dice) to the guys who cast
;the spell (The summoner)
;--------------------------------------------------------------------------------------------------
If CreatureType == 1
WolfCompanion.SetOwnership Summoner
else If CreatureType == 2
BearCompanion.SetOwnership Summoner
elseIf CreatureType == 3
BoarCompanion.SetOwnership Summoner
elseIf CreatureType == 4
LionCompanion.SetOwnership Summoner
EndIf
End
;Summon (move) the specific pet near the guy who casted the spell
;(The summoner) and Disappear other kind of pets who are in game
;(It moves them back to the storage secret cell)
;--------------------------------------------------------------------------------------------------
Begin ScriptEffectStart
PrintToConsole "CreatureType: %.0f" CreatureType
If CreatureType == 1
BearCompanion.MoveTo BearDismissPoint 0,0,10
BoarCompanion.MoveTo BoarDismissPoint 0,0,10
LionCompanion.MoveTo LionDismissPoint 0,0,10
WolfCompanion.MoveTo Summoner 0,0,100
PrintToConsole "z% has summoned his Wolf companion (Lupito)" name
elseIf CreatureType == 2
WolfCompanion.MoveTo WolfDismissPoint 0,0,10
BoarCompanion.MoveTo BoarDismissPoint 0,0,10
LionCompanion.MoveTo LionDismissPoint 0,0,10
BearCompanion.MoveTo Summoner 0,0,100
PrintToConsole "z% has summoned his Bear companion (Balou)" name
elseIf CreatureType == 3
BearCompanion.MoveTo BearDismissPoint 0,0,10
WolfCompanion.MoveTo WolfDismissPoint 0,0,10
LionCompanion.MoveTo LionDismissPoint 0,0,10
BoarCompanion.MoveTo Summoner 0,0,100
PrintToConsole "z% has summoned his Boar companion (Piggy)" name
ElseIf CreatureType == 4
BearCompanion.MoveTo BearDismissPoint 0,0,10
BoarCompanion.MoveTo BoarDismissPoint 0,0,10
WolfCompanion.MoveTo WolfDismissPoint 0,0,10
LionCompanion.MoveTo Summoner 0,0,100
PrintToConsole "z% has summoned his Lion companion (Miaou)" name
EndIf
End