Jump to content

Recommended Posts

Posted (edited)

I'm having a devil of a time figuring out how to write a script to do what I want. It's simple in concept, but everything I try has failed. I admit I'm very new to scripting.

 

Basicaly, I have a spell with negative effects that I want to add an item, a faction and another spell, then be dispelled - all when the player sleeps. I'm attaching the script to the magic effect itself.

 

Here's what I've got so far:

 

  Quote

 

Scriptname HivePlayerFactionScript extends ActiveMagicEffect
Faction Property AAHiveFaction Auto
Spell Property hivespell Auto
Book Property hivebook Auto
Actor Property hivePlayer Auto
ActiveMagicEffect Property paracytespell Auto
Event OnEffectStart(Actor akTarget, Actor akCaster)
hivePlayer.RegisterForSleep()
EndEvent
Event OnSleepStart(float afSleepStartTime, float afDesiredSleepEndTime)
hivePlayer.AddToFaction(AAHiveFaction)
hivePlayer.addspell(hivespell)
hivePlayer.additem(hivebook)
EndEvent
Event OnSleepStop(bool abInterrupted)
paracytespell.dispel()
EndEvent

 

I admit, I'm a newb at scripting. Anyone have any idea what it is I'm doing wrong?

 

Edit: I got it to compile, but it still doesn't work. Nothing happens when I sleep. I updated the script with the one that compiled.

Edited by khulse
  • 1 month later...
Posted

I'm sorry, I wish I could help you. I'm having a very similar problem. It's like the addtofaction doesn't do anything in the scripts. I saw one somewhere that instead of addtofaction, it said setteammate or something like that. So, I'm going to look around for that, maybe it could help you. BTW, have you tried adding a debug notification to your script just to test if it is firing?

  • Recently Browsing   0 members

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