Need Help with my Script
Started by
TheSkoomaKing
, Dec 17 2012 05:11 PM
22 replies to this topic
#11
Posted 18 December 2012 - 12:59 AM
Awesome Thanks guys! Will try it out the first thing tommorow! have to get some sleep now before work thou xd 2 am over here
#12
Posted 19 December 2012 - 12:42 PM
I've fixed up the script a bit and organized some stuff more logically. Compiles.
Use the script on the spell's magic effect of course. The akTarget variable will fill automatically with whatever creature you cast the spell on.
I'm assuming that you're using the "AlreadyTamedGlobal" global variable so that you can only have one tamed creature at any time? Otherwise the use of the global variable is not suitable that way.
Use the script on the spell's magic effect of course. The akTarget variable will fill automatically with whatever creature you cast the spell on.
I'm assuming that you're using the "AlreadyTamedGlobal" global variable so that you can only have one tamed creature at any time? Otherwise the use of the global variable is not suitable that way.
Spoiler
Edited by steve40, 19 December 2012 - 12:53 PM.
#13
Posted 19 December 2012 - 06:26 PM
I tested the script and it seems to be working, but not the whole script. What i can see is that he is changing race acording to plan. however, he is still attacking me. I there is a
stopcombat() in the script so it shouldt be the case. What do you think is causing this?
stopcombat() in the script so it shouldt be the case. What do you think is causing this?
#14
Posted 19 December 2012 - 08:55 PM
That could be caused by several things:
Aggression could be too high – reduce it.
The creature might be a member of more than 1 faction that is hostile – Use RemoveFromAllFactions instead.
The creature might be becoming hostile again before the faction change. – Use StopCombatAlarm as well.
Possibly also use EnableAI(false) to turn it’s AI off while you work on the creature and EnableAI() to turn it back on when you’re ready.
Possibly also use MakePlayerFriend()
Try combinations of these until it works. Changes like the one you’re trying can be tricky and unpredictable and the only way to be sure if it will work is to try it out.
Aggression could be too high – reduce it.
The creature might be a member of more than 1 faction that is hostile – Use RemoveFromAllFactions instead.
The creature might be becoming hostile again before the faction change. – Use StopCombatAlarm as well.
Possibly also use EnableAI(false) to turn it’s AI off while you work on the creature and EnableAI() to turn it back on when you’re ready.
Possibly also use MakePlayerFriend()
Try combinations of these until it works. Changes like the one you’re trying can be tricky and unpredictable and the only way to be sure if it will work is to try it out.
#15
Posted 19 December 2012 - 10:57 PM
What Eckss suggests. You can also try adding another StopCombat() near the end of the script after the factions are set, just before the SuccessMessage01 is shown.
#16
Posted 20 December 2012 - 12:34 AM
It would still seem like it doesnt work, however.. The Beast Stopped attacking me, and changed race, but he didt become the alias that i set him to be. Therefor i could not speak with him ( he didt get the follower dialog ). for a animal follower to work they need a special script attached to them, but since this "aktarget" can be a random beast i want the quest to pick him up as an alias, cause i´ve set up the alias with all the neccessary Scripts etc.
Anyone have a clue whats wrong?
all that comes up now is the debug.notification that says " Target´s not Valid for taming ". like if some requirement weren´t met :/
Anyone have a clue whats wrong?
all that comes up now is the debug.notification that says " Target´s not Valid for taming ". like if some requirement weren´t met :/
#17
Posted 20 December 2012 - 10:25 AM
I'm not experienced at doing quests, but you could try passing the ReferenceAlias to your script as a property:
ReferenceAlias Property myAlias auto
just rename "myAlias" to match the name of your alias so you can auto-fill the property
then try this:
myAlias.ForceRefTo(akTarget)
ReferenceAlias Property myAlias auto
just rename "myAlias" to match the name of your alias so you can auto-fill the property
then try this:
myAlias.ForceRefTo(akTarget)
Edited by steve40, 20 December 2012 - 10:25 AM.
#18
Posted 20 December 2012 - 04:04 PM
It would seem like it doesnt work, atleast the " Not valid for taming " is gone now since i put the " TamedBeastAlias.ForceRefTo(akTarget) " inside the script, but it would seem like it doesnt do something with it, no dialogue doesnt work anyway. Any more suggestions?
#19
Posted 20 December 2012 - 04:16 PM
I'm in the same boat, I always have trouble getting Aliases to work and I usually give up and try a different method. (In your case that would be to disable the creature and replace it with a new one that is already set up with everything you want.)
However, in the Alias situation, if the error has stopped, does that mean that the Alias is filled? If so, perhaps you need to look at the conditions you've put on the dialogue to see what's stopping it from coming up.
Eck.
However, in the Alias situation, if the error has stopped, does that mean that the Alias is filled? If so, perhaps you need to look at the conditions you've put on the dialogue to see what's stopping it from coming up.
Eck.
#20
Posted 20 December 2012 - 04:24 PM
here is how the script looks ATM:
Scriptname aaTameBeastScriptEffect01 extends ActiveMagicEffect
import ReferenceAlias
import Quest
ReferenceAlias Property TamedBeastAlias Auto
GlobalVariable Property AlreadyTamedGlobal Auto
Faction Property CreatureFaction Auto
Faction Property FollowerFaction Auto
Faction Property PlayerFaction Auto
Faction Property TamedBeastFaction Auto
Faction Property CurrentFollowerFaction Auto
Keyword Property Creature Auto
Keyword Property ActorTypeCreature Auto
Message Property FailMessage01 Auto
Message Property failMessage02 Auto
Message Property SuccessMessage01 Auto
Race Property BearSnow Auto
Race Property BearBlack Auto
Race Property BearBrown Auto
Race Property Goat Auto
Race Property TrollIce Auto
Race Property Deer Auto
Race Property Mammoth Auto
Race Property WolfRace Auto
Race Property CharusRace Auto
Race Property FoxRace Auto
Race Property SpiderRace01 Auto
Race Property SpiderRace02 Auto
Race Property MudcrabRace Auto
Race Property SabreCatRace Auto
Race Property SabreCatSnow Auto
Race Property SprigganRace Auto
Race Property TamedBearBlackRace Auto
Race Property TamedBearBrownRace Auto
Race Property TamedBearSnowRace Auto
Race Property TamedChaurusRace Auto
Race Property TamedElkRace Auto
Race Property TamedFoxRace Auto
Race Property TamedFrostbiteSpiderRace Auto
Race Property TamedFrostBiteSpiderGiant Auto
Race Property TamedGoatRace Auto
Race Property TamedMammothRace Auto
Race Property TamedMudcrabRace Auto
Race Property TamedSabreCatRace Auto
Race Property TamedSabreCatSnowyRace Auto
Race Property TamedSprigganRace Auto
Race Property TamedTrollFrostRace Auto
Race Property TamedTrollRace Auto
Race Property TamedWispRace Auto
Race Property TamedWolfRace Auto
Race Property TamedDeerRace Auto
Topic Property FollowMeTopic Auto
Race CureRace
Event OnEffectStart(Actor akTarget, Actor akCaster)
float AlreadyTamed = AlreadyTamedGlobal.GetValue()
If AlreadyTamed == 1
Debug.Notification("You already have a tamed creature.")
Return ; abort
EndIf
CureRace = akTarget.GetRace()
if !CureRace.HasKeyword(ActorTypeCreature)
AlreadyTamedGlobal.SetValue(0) ; Mark the spell as failed.
Debug.Notification("Target is not valid for taming")
FailMessage01.Show()
elseif CureRace.HasKeyword(ActorTypeCreature) && (CureRace == BearSnow || CureRace == BearBrown || CureRace == BearBlack || CureRace == CharusRace || CureRace == Goat \
|| CureRace == TrollIce || CureRace == Deer || CureRace == Mammoth || CureRace == WolfRace || CureRace == FoxRace || CureRace == SpiderRace01 || CureRace == SpiderRace02)
Debug.Notification("Target is valid for taming")
AkTarget.StopCombat()
TamedBeastAlias.ForceRefTo(akTarget)
if (CureRace == BearSnow)
akTarget.SetRace(TamedBearSnowRace)
elseif (CureRace == BearBrown)
akTarget.SetRace(TamedBearBrownRace)
elseif (CureRace == BearBlack)
akTarget.SetRace(TamedBearBlackRace)
elseif (CureRace == CharusRace)
akTarget.SetRace(TamedChaurusRace)
elseif (CureRace == Goat)
akTarget.SetRace(TamedGoatRace)
elseif (CureRace == TrollIce)
akTarget.SetRace(TamedTrollFrostRace)
elseif (CureRace == Deer)
akTarget.SetRace(TamedDeerRace)
elseif (CureRace == Mammoth)
akTarget.SetRace(TamedMammothRace)
elseif (CureRace == WolfRace)
akTarget.SetRace(TamedWolfRace)
elseif (CureRace == FoxRace)
akTarget.SetRace(TamedFoxRace)
elseif (CureRace == SpiderRace01)
akTarget.SetRace(TamedFrostbiteSpiderRace)
elseif (CureRace == SpiderRace02)
akTarget.SetRace(TamedFrostbiteSpiderGiant)
else
;Debug.Trace("[Dark Gift][Warning] " + akTarget + " is not a known race. Defaulting to Imperial vampire.")
AlreadyTamedGlobal.SetValue(0) ; Mark the spell as failed. The race was not in the list.
endif
Utility.Wait(2) ; wait a couple of seconds for the race to change
If AkTarget.GetRace() != CureRace ; test that the race has changed
AkTarget.RemoveFromAllFactions()
AkTarget.AddToFaction(TamedBeastFaction)
AkTarget.AddToFaction(playerFaction)
AkTarget.AddToFaction(FollowerFaction)
AkTarget.SetFactionRank(CurrentFollowerFaction, -1)
AlreadyTamedGlobal.SetValue(1)
AkTarget.Stopcombat()
(Game.GetPlayer().AddSpell(FeedSpell, true))
(Game.GetPlayer().AddSpell(AbandonSpell, true))
FollowMeTopic.Add()
SuccessMessage01.Show()
EndIf
endif
if (AlreadyTamed == 0)
FailMessage02.Show()
Debug.Notification("Target is not valid for taming")
endif
EndEvent
SPELL Property FeedSpell Auto
SPELL Property AbandonSpell Auto
I removed the Aktarget = TamedBeastAlias.Getreference() as actor" and when i did the " Not valid for taming" vanished, but it doesnt seem like the alias is being filled,
Scriptname aaTameBeastScriptEffect01 extends ActiveMagicEffect
import ReferenceAlias
import Quest
ReferenceAlias Property TamedBeastAlias Auto
GlobalVariable Property AlreadyTamedGlobal Auto
Faction Property CreatureFaction Auto
Faction Property FollowerFaction Auto
Faction Property PlayerFaction Auto
Faction Property TamedBeastFaction Auto
Faction Property CurrentFollowerFaction Auto
Keyword Property Creature Auto
Keyword Property ActorTypeCreature Auto
Message Property FailMessage01 Auto
Message Property failMessage02 Auto
Message Property SuccessMessage01 Auto
Race Property BearSnow Auto
Race Property BearBlack Auto
Race Property BearBrown Auto
Race Property Goat Auto
Race Property TrollIce Auto
Race Property Deer Auto
Race Property Mammoth Auto
Race Property WolfRace Auto
Race Property CharusRace Auto
Race Property FoxRace Auto
Race Property SpiderRace01 Auto
Race Property SpiderRace02 Auto
Race Property MudcrabRace Auto
Race Property SabreCatRace Auto
Race Property SabreCatSnow Auto
Race Property SprigganRace Auto
Race Property TamedBearBlackRace Auto
Race Property TamedBearBrownRace Auto
Race Property TamedBearSnowRace Auto
Race Property TamedChaurusRace Auto
Race Property TamedElkRace Auto
Race Property TamedFoxRace Auto
Race Property TamedFrostbiteSpiderRace Auto
Race Property TamedFrostBiteSpiderGiant Auto
Race Property TamedGoatRace Auto
Race Property TamedMammothRace Auto
Race Property TamedMudcrabRace Auto
Race Property TamedSabreCatRace Auto
Race Property TamedSabreCatSnowyRace Auto
Race Property TamedSprigganRace Auto
Race Property TamedTrollFrostRace Auto
Race Property TamedTrollRace Auto
Race Property TamedWispRace Auto
Race Property TamedWolfRace Auto
Race Property TamedDeerRace Auto
Topic Property FollowMeTopic Auto
Race CureRace
Event OnEffectStart(Actor akTarget, Actor akCaster)
float AlreadyTamed = AlreadyTamedGlobal.GetValue()
If AlreadyTamed == 1
Debug.Notification("You already have a tamed creature.")
Return ; abort
EndIf
CureRace = akTarget.GetRace()
if !CureRace.HasKeyword(ActorTypeCreature)
AlreadyTamedGlobal.SetValue(0) ; Mark the spell as failed.
Debug.Notification("Target is not valid for taming")
FailMessage01.Show()
elseif CureRace.HasKeyword(ActorTypeCreature) && (CureRace == BearSnow || CureRace == BearBrown || CureRace == BearBlack || CureRace == CharusRace || CureRace == Goat \
|| CureRace == TrollIce || CureRace == Deer || CureRace == Mammoth || CureRace == WolfRace || CureRace == FoxRace || CureRace == SpiderRace01 || CureRace == SpiderRace02)
Debug.Notification("Target is valid for taming")
AkTarget.StopCombat()
TamedBeastAlias.ForceRefTo(akTarget)
if (CureRace == BearSnow)
akTarget.SetRace(TamedBearSnowRace)
elseif (CureRace == BearBrown)
akTarget.SetRace(TamedBearBrownRace)
elseif (CureRace == BearBlack)
akTarget.SetRace(TamedBearBlackRace)
elseif (CureRace == CharusRace)
akTarget.SetRace(TamedChaurusRace)
elseif (CureRace == Goat)
akTarget.SetRace(TamedGoatRace)
elseif (CureRace == TrollIce)
akTarget.SetRace(TamedTrollFrostRace)
elseif (CureRace == Deer)
akTarget.SetRace(TamedDeerRace)
elseif (CureRace == Mammoth)
akTarget.SetRace(TamedMammothRace)
elseif (CureRace == WolfRace)
akTarget.SetRace(TamedWolfRace)
elseif (CureRace == FoxRace)
akTarget.SetRace(TamedFoxRace)
elseif (CureRace == SpiderRace01)
akTarget.SetRace(TamedFrostbiteSpiderRace)
elseif (CureRace == SpiderRace02)
akTarget.SetRace(TamedFrostbiteSpiderGiant)
else
;Debug.Trace("[Dark Gift][Warning] " + akTarget + " is not a known race. Defaulting to Imperial vampire.")
AlreadyTamedGlobal.SetValue(0) ; Mark the spell as failed. The race was not in the list.
endif
Utility.Wait(2) ; wait a couple of seconds for the race to change
If AkTarget.GetRace() != CureRace ; test that the race has changed
AkTarget.RemoveFromAllFactions()
AkTarget.AddToFaction(TamedBeastFaction)
AkTarget.AddToFaction(playerFaction)
AkTarget.AddToFaction(FollowerFaction)
AkTarget.SetFactionRank(CurrentFollowerFaction, -1)
AlreadyTamedGlobal.SetValue(1)
AkTarget.Stopcombat()
(Game.GetPlayer().AddSpell(FeedSpell, true))
(Game.GetPlayer().AddSpell(AbandonSpell, true))
FollowMeTopic.Add()
SuccessMessage01.Show()
EndIf
endif
if (AlreadyTamed == 0)
FailMessage02.Show()
Debug.Notification("Target is not valid for taming")
endif
EndEvent
SPELL Property FeedSpell Auto
SPELL Property AbandonSpell Auto
I removed the Aktarget = TamedBeastAlias.Getreference() as actor" and when i did the " Not valid for taming" vanished, but it doesnt seem like the alias is being filled,



Sign In
Create Account

Back to top









