Spoiler
Scriptname phiTameBeastTriggerS extends ActiveMagicEffect
Spell Property phiTaming auto
Event OnEffectStart(Actor akTarget, Actor akCaster)
if akTarget.HasSpell(phiTaming) != 1
akTarget.AddSpell(phiTaming)
endif
EndEvent
Spell Property phiTaming auto
Event OnEffectStart(Actor akTarget, Actor akCaster)
if akTarget.HasSpell(phiTaming) != 1
akTarget.AddSpell(phiTaming)
endif
EndEvent
This seems to compile fine. At least it gives no errors; the compile dialogue simply goes away with no notification whatsoever. Is this normal? How can I tell if something has actually compiled or not?
OK, so now the target has my phiTaming spell on them, which like I said is an Ability with another scripted spell effect. This is where I am having serious difficulty.
Spoiler
Scriptname phiTameBeastTimerS extends ActiveMagicEffect MagicEffect Property phiTameBeastSet autoSpell Property phiTaming autoActor phiSpellTargetfloat timer1float timer2Event OnEffectStart(Actor akTarget, Actor akCaster) ; this should only run once when I add the spell phiSpellTarget = akTarget RegisterForUpdate(0.1)EndEventEvent OnUpdate() timer1 += GetSecondsPassed ; this doesn't work at all if phiSpellTarget.HasMagicEffect(phiTameBeastSet) timer1=0 timer2 += GetSecondsPassed if timer2 >= 10 phiTameBeastTracker1.phiTameBeastRef1 = phiSpellTarget phiTameBeastTracker1.phitargeted = 1 phiSpellTarget.RemoveSpell(phiTaming) endif else if timer1 >= 3 phiSpellTarget.RemoveSpell(phiTaming) endif endifEndEvent
Basically as you can see, if you are at all familiar with Oblivion scripting and logic which I would sell my first born to have back over this Papyrus language (ahem), I am trying to track a couple timers and take appropriate actions.
The first timer1 is supposed to increment every update, unless the player is casting the original ability spell at this actor, in which case I reset it to 0. Basically this is so that if the actor goes for 3 seconds without being hit by my original concentration spell, I want this timer effect spell to be removed.
Next, timer2 is supposed to increment whenever the actor IS being hit with my original concentration spell, and if that count gets to 10, it sets a couple variables (phiTameBeastRef1 and phitargeted) in my placeholder quest phiTameBeastTracker1, then removes itself.
Like I said this seems logical according to Oblivion standards, but refuses to compile with the following:
Spoiler
Starting 1 compile threads for 1 files...
Starting 1 compile threads for 1 files...
Compiling "phiTameBeastTimerS"...
\Source\phiTameBeastTimerS.psc(19,11): variable GetSecondsPassed is undefined
\Source\phiTameBeastTimerS.psc(19,8): cannot add a float to a none (cast missing or types unrelated)
\Source\phiTameBeastTimerS.psc(22,12): variable GetSecondsPassed is undefined
\Source\phiTameBeastTimerS.psc(22,9): cannot add a float to a none (cast missing or types unrelated)
\Source\phiTameBeastTimerS.psc(24,3): variable phiTameBeastTracker1 is undefined
\Source\phiTameBeastTimerS.psc(24,24): none is not a known user-defined type
\Source\phiTameBeastTimerS.psc(24,23): type mismatch while assigning to a none (cast missing or types unrelated)
\Source\phiTameBeastTimerS.psc(25,3): variable phiTameBeastTracker1 is undefined
\Source\phiTameBeastTimerS.psc(25,24): none is not a known user-defined type
\Source\phiTameBeastTimerS.psc(25,23): type mismatch while assigning to a none (cast missing or types unrelated)
No output generated for phiTameBeastTimerS.psc, compilation failed.
Batch compile of 1 files finished. 0 succeeded, 1 failed.
Failed on phiTameBeastTimerS.psc
Starting 1 compile threads for 1 files...
Compiling "phiTameBeastTimerS"...
\Source\phiTameBeastTimerS.psc(19,11): variable GetSecondsPassed is undefined
\Source\phiTameBeastTimerS.psc(19,8): cannot add a float to a none (cast missing or types unrelated)
\Source\phiTameBeastTimerS.psc(22,12): variable GetSecondsPassed is undefined
\Source\phiTameBeastTimerS.psc(22,9): cannot add a float to a none (cast missing or types unrelated)
\Source\phiTameBeastTimerS.psc(24,3): variable phiTameBeastTracker1 is undefined
\Source\phiTameBeastTimerS.psc(24,24): none is not a known user-defined type
\Source\phiTameBeastTimerS.psc(24,23): type mismatch while assigning to a none (cast missing or types unrelated)
\Source\phiTameBeastTimerS.psc(25,3): variable phiTameBeastTracker1 is undefined
\Source\phiTameBeastTimerS.psc(25,24): none is not a known user-defined type
\Source\phiTameBeastTimerS.psc(25,23): type mismatch while assigning to a none (cast missing or types unrelated)
No output generated for phiTameBeastTimerS.psc, compilation failed.
Batch compile of 1 files finished. 0 succeeded, 1 failed.
Failed on phiTameBeastTimerS.psc
I am guessing this is because GetSecondsPassed is not valid in Papyrus, which frags the brains of the rest of the logic loops. However, I see no effective way to handle timers in Papyrus.
So, I guess that would be my question. How is one supposed to accomplish something like this timer function, which seems relatively simple and straightforward, in this new Rube-Goldbergian language format? =P

