Jump to content

Spell Condition problem


Vykroft

Recommended Posts

Hi, I'm back to modding and relative new with Papyrus syntax, and I'm having a little problem with a custom teleport spell, the fact is that I do not want the spell to affect childrens, but some reason is doesn't work and everyone could be teleported, even dead bodies.
There is something I'm missing because the effect condition is showing in purple (attached image), so clearly I'm missing something there, I read the info in the Creation Kit Wiki but it only shows all the variable data with no clear example in some cases.

 

Also I tried to block the spell with the script, with something like this:

if
Target.isChildren == 0
endif

but "isChildren" is not a valid variable or Object reference, so I cannot use it inside a function.

 

So, any ideas?

post-193318-0-96759000-1461786989_thumb.png

Link to comment

Also I tried to block the spell with the script, with something like this:

if
Target.isChildren == 0
endif

but "isChildren" is not a valid variable or Object reference, so I cannot use it inside a function.

 

So, any ideas?

 

isChildren is not a valid variable for Actors either, IsChild() is the function you want. Anyway, when you have an ObjectReference that you know is an Actor, you can cast it into Actor to access its Actor functions:

targetActor = Target as Actor
if (targetActor.IsChild() == false
   ;do whatever
endif
Link to comment

Thank is working now with this

if (targetActor.IsChild() == false)
   ;my teleport
endif

I was missing the double () after the function..... so silly of me, sorry I started with Papyrus scripting yesterday...

Time to add other restriction to the spell to avoid problem.

Link to comment

Thank is working now with this

if (targetActor.IsChild() == false)
   ;my teleport
endif

I was missing the double () after the function..... so silly of me, sorry I started with Papyrus scripting yesterday...

Time to add other restriction to the spell to avoid problem.

 

I am glad it is working now.

In case you need it, there is a Papyrus Scripting Guide in my signature.

Link to comment

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

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