Jump to content

Quick help with a script


squidgy617

Recommended Posts

Bear with me here. Still learning scripting. I know whatever I've missed is something stupid, but I can't learn without help, I suppose.

 

Here's my script:

Scriptname abTameableAnimalScript extends activemagiceffect  

Actor property Player Auto

Event OnActivate(ObjectReference akActionRef)
 if self.IsHostileToActor(Player)
     self.SetAlert()
 else
    self.ShowGiftMenu(true, OnlyFoodList, true, false)
 endIf
EndEvent

Event OnItemAdded(Form akBaseItem, int aiItemCount, ObjectReference akItemReference, ObjectReference akSourceContainer)
 if akSourceContainer == Game.GetPlayer()
    int random = Utility.RandomInt(1, 2)
 endif

If Utility.RandomInt() = 1
    self.SetAlert()
 else
    self.kill
 endif
EndEvent

 

I get this error:

 

required (...)+ loop did not match anything at input '='

No output generated for abTameableAnimalScript, compilation failed.

 

What's wrong there? I'm not sure what's wrong with that equal sign, but eh.

 

Thanks in advance.

Edited by squidgy617
Link to comment
Share on other sites

This compiles, but I don't know if it will work.

 

Scriptname abTameableAnimalScript extends Actor  

Actor property Player Auto
FormList Property OnlyFoodList Auto

Event OnActivate(ObjectReference akActionRef)
if IsHostileToActor(Player)
	SetAlert()
else
	ShowGiftMenu(true, OnlyFoodList, true, false)
endIf
EndEvent

Event OnItemAdded(Form akBaseItem, int aiItemCount, ObjectReference akItemReference, ObjectReference akSourceContainer)
if akSourceContainer == Player
	int random = Utility.RandomInt(1, 2)
	If random == 1
		SetAlert()
	else
		kill()
	endif
endif
EndEvent

Edited by steve40
Link to comment
Share on other sites

Okay, no error compiling, but I don't know how to make the creature that the script is attached to activateable.

 

The script is attached to a magic effect.

 

The effect is attached to a spell.

 

The spell is attached to a race.

 

But I can't actually activate the creature once its spawned.

 

How do I make it activateable? Or should I try some other alternative?

Link to comment
Share on other sites

If the actor is used in a leveled list, the script section will be greyed out, so you have to put the script on the leveled list version of the actor (the object that the spawner uses).

 

EDIT: put the script on "LvlSabreCatAll".

Edited by steve40
Link to comment
Share on other sites

I'm sorry, I'm not sure I quite understand. Again, I am very noobish at this.

 

Where exactly do I go to find the leveled version of the actor, in this case EncSabreCat?

 

I'm looking right now, not seeing where the leveled list version is. If I go to the leveled list it is included in and double-click it from there, its still the same actor. I still can't place a script on it.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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