Jump to content

DOWNLOAD MODS

Are you looking for something shiny for your load order? We have many exclusive mods and resources you won't find anywhere else. Start your search now...

LEARN MODDING

Ready to try your hand at making your own mod creations? Visit the Enclave, the original ES/FO modding school, and learn the tricks of the trade from veteran modders...

JOIN THE ALLIANCE

Membership is free and registering unlocks image galleries, project hosting, live chat, unlimited downloads, & more...

Really simple question


Karantalsis
 Share

Recommended Posts

I can get this to compile, I have then attached it to a spell, which has no other effects and no conditions. I set the property to candlelight, cast it in game and candlelight is not cast.

What am I missing?

ScriptName castspell extends Form


Spell property candlelight Auto


Event OnInit()

candlelight.Cast(Game.GetPlayer(), None)

EndEvent

Edited by Karantalsis
Link to comment
Share on other sites

Thankyou! Am really new to Papyrus so am making a ton of mistakes.

Would this work then?

ScriptName castspell extends activemagiceffect


Spell property candlelight Auto


Event OnEffectStart(Actor akTarget, Actor akCaster)

candlelight.Cast(akCaster, akTarget)

EndEvent

Edited by Karantalsis
Link to comment
Share on other sites

Thankyou! Am really new to Papyrus so am making a ton of mistakes.

Everyone is new to Papyrus, and mistakes are inevitable. Scripting is not something that is learned overnight (unless your one of those type of geniuses!). WillieSea and I have been working with Papyrus since the CK was released and for me, at least, I am still a beginner (I'm not going to say this for WillieSea, but I think he would agree also!)

Mistakes are the way we learn how to do stuff... correctly!

If you need any further help, just ask away and we and others will do our best to help :pints:

-------

I've used the cast once before:

TrapFireball06.Cast(SpellSource,SpellTarget)

SpellSource is what casts the spell... In my case the MoveableStatic, MAGINVFireballArtOLD

SpellTarget is the end location... In my case an, X-Marker

--------

edit,

it appears that Willie beat me too an answer once again! :lmao: both answers will work!

Edited by DsoS
Link to comment
Share on other sites

Thanks to you both, think I will have lots of questions until I get my feet under me.

Perhaps this instead as I assume the spell will be cast on the caster of the spell, not what the caster is pointing at?


candlelight.Cast(akCaster, akCaster)

I am just using candlelight as a placeholder at the moment I will be switching the spell in idfferent bits of the script so I need to leave akTarget in their (at least for now). I've got another problem now, as I ahve that working and am trying to add an IF statement. It compiles OK.

ScriptName castspell extends activemagiceffect


Spell property candlelight Auto

Keyword property BeginCasting Auto


Event OnEffectStart(Actor akTarget, Actor akCaster)


  if (Game.GetPlayer().HasMagicEffectWithKeyword(BeginCasting))

   candlelight.Cast(akCaster, akTarget)

  endIf


EndEvent

BeginCasting is a keyword I have attached to a Lesser Power. I cast the power (which has one other Keyword and nothing else) then I cast the spell with this script attached, nothing happens. Any idea what I'm doing wrong?

Edited by Karantalsis
Link to comment
Share on other sites

  • 3 weeks later...

I've used the cast once before:

TrapFireball06.Cast(SpellSource,SpellTarget)
SpellSource is what casts the spell... In my case the MoveableStatic, MAGINVFireballArtOLD SpellTarget is the end location... In my case an, X-Marker
Aimed spells can use the akTarget? I've tried it before by having an actor use the cast function where akTarget is another actor. In my case, actor 1 only ever fires in the direction he is facing. Did I do something wrong?

Scriptname CastOnHostileScript extends activemagiceffect 

SPELL Property aaMagicToCast Auto

Actor Property aaPlayer Auto


Event OnEffectStart(Actor akTarget, Actor akCaster)

aaPlayer = Game.GetPlayer() as Actor

if(akTarget.IsHostileToActor(aaPlayer))

  aaMagicToCast.Cast(akCaster, akTarget)

endif

EndEvent

This spell is attached to a cloak magic effect and its spell encompasses an entire cell (but that's all it does).

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...