Jump to content

Script issue


ApocNizmith

Recommended Posts

scn aaSE09SkeletalHound01
short button
short dismiss
short Owned
float alpha
begin OnDeath
set aaSE09SkeletalHound01.Summoned to 0
set Owned to 0
end
begin OnActivate
if ( IsActionRef Player == 1 ) && ( Dismiss < 1 )
if ( GetDead == 0 )
Messagebox "What is your command?","Follow","Wait","Dismiss"
elseif ( GetDead == 1 )
Activate
endif
endif
end
begin gamemode
if ( aaSE09SkeletalHound01.Summoned == 1 ) && ( Owned == 0 ) && ( Dismiss < 1 )
SetOwnership PlayerFaction
Set Owned to 1
endif
if Dismiss == 1
playsound SPLPoisonCast
removespell ABGhostNPCEffect
set alpha to alpha - .01
setactoralpha alpha
if alpha < 0
Disable
set Dismiss to 0
endif
endif
set button to getbuttonpressed
if button > -1
if button == 0
Set aaSE09SkeletalHound01.Follow to 1
Evp
Message "Your Abyssal Skinned Hound is now following"
elseif button == 1
Set aaSE09SkeletalHound01.Follow to 0
Evp
Message "Your Abyssal Skinned Hound is now waiting"
elseif button == 2
Message "You have dismissed your Abyssal Skinned Hound"
set alpha to 1
set dismiss to 1
set aaSE09SkeletalHound01Ref.Summoned to 0
set Owned to 0
endif
endif
Yet this script works:

scn AAACitadelAltarScript

short button
short summoned

begin OnActivate

if ( IsActionRef Player == 1 )
if ( Summoned < 1 )
Messagebox "What type of Abyssal Gaurdian do you wish to bind?","Hound","Skeletal","Flesh","Done"
else
Message "You may only have one Abyssal Gaurdian bound to you at a time."
endif
endif

end

begin gamemode

set button to getbuttonpressed
if button > -1
if button == 0
if ( Player.GetItemCount Nightshade >= 3 )
Playsound SPLPoisonCast
aaSE09SkeletalHound01BirthMarker.Placeatme aaSE09SkeletalHound01
Player.RemoveItem Nightshade 3
set Summoned to 1
else
Message "This requires 3 Nightshade."
endif
elseif button == 1
if ( Player.GetItemCount Nightshade >= 5 )
Playsound SPLPoisonCast
aaCreatureSkeleton4ChampionBirthMarker.Placeatme aaCreatureSkeleton4Champion
Player.RemoveItem Nightshade 5
set Summoned to 1
else
Message "This requires 5 Nightshade."
endif
elseif button == 2
if ( Player.GetItemCount Nightshade >= 10 )
Playsound SPLPoisonCast
aaSE09BattleAtronachFlesh02BirthMarker.Placeatme aaSE09BattleAtronachFlesh02
Player.RemoveItem Nightshade 10
set Summoned to 1
else
Message "This requires 10 Nightshade."
endif
elseif button == 3
endif
endif
endif

end

Doesn't recognize function Summoned, but will summon creature? How do I fix this?
Edited by ApocNizmith
Link to comment
Share on other sites

In Oblivion creatures don't have attributes named "Summoned" or "Follow". These lines will produce compiler errors.
In fact nothing has any attributes like that at all. The only thing you can "."-connect to objects like this is function calls, like "PlaceAtMe" as done above with the markers.

You cannot store arbitrary attributes on objects like this. You can have a script running on the creatures which stores some attributes for them, but these attributes can also only be used from inside the same script.

Your "aaSE09SkeletalHound01" script is running on the creatures I guess, from using OnDeath and OnActivate blocks. And scripts like this won't "share" their variables' values with others. So why not just declare the "Follow" and "Summoned" variables as local variables of this script and set or check them the same way as done in the below script? As long as the creature instance exists these variables will keep their values, other instances of the same creature will keep their own values separate from these, so you can use them to store certain states of the creature and the like just as well as if they 'were' attributes of the creature.

What you cannot do by this is checking their values from another script, like from outside the creature though. But I'm not seeing you doing this here, so you should be lucky and it should work that way instead just fine.

I'm not sure how you'd go about making the creature follow, but setting an attribute "Follow", which doesn't exist and cannot be assigned, and executing "Evp" will certainly not work. Nor will you be able to use the local variable "Follow", if declared inside the script as told, for checking it from inside a package condition or something. But there are different ways to tell an actor to use its follow AI package now, I just don't know anything about this myself yet.

Link to comment
Share on other sites

Awesome I will try that instead. If I use a local variable to interact with them it may work I will give it a try. I was attempting to make it call a reference but I will attempt a AI package or another script to interact with them XD TY Drake

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...