Jump to content

Is it possible to create a Spell that...


Eldramhor

Recommended Posts

... has a script attached to it which is basically a console command?

 

I mean, I want to make sure that when I cast spell " X " my quest is set to stage 100.

 

In the console you basically make player.setstage questid 100, I don't think that would work as a script though, so how would you translate that into a script?

Link to comment
Share on other sites

... has a script attached to it which is basically a console command?

 

I mean, I want to make sure that when I cast spell " X " my quest is set to stage 100.

 

In the console you basically make player.setstage questid 100, I don't think that would work as a script though, so how would you translate that into a script?

 

You can't use console commands directly in scripts. My papyrus is a little rusty but if you were to create a new quest, create a alias that points to the player and then attached a script to it... something like this?

ScriptName Spellcast extends ReferenceAlias

Spell Property StageSpell Auto ;The spell you wish to detect to advance the stage
Quest Property StageQuest Auto ; The Quest that has the stage you wish to advance to.
Int Property Stage Auto ;The Stage Number you wish to advance to

Event OnSpellCast(Form akSpell)
	Spell spellCast = akSpell as Spell ;Recast the Form to a Spell (If it is not a valid spell this will be none.)
	If SpellCast && spellcast == StageSpell ;Check if Spellcast is Valid and if so is it the spell we want?
		StageQuest.SetStage(Stage) ;If the above is valid then set the quests stage to this stage.
	EndIf
EndEvent

You should be able to do what your looking for....this of course is probably not the best way but it's the first that springs to mind. Someone more experienced might have a better answer.

 

EDIT: Wait are you trying to do it for any quest you pick during runtime?

Edited by BotOwned
Link to comment
Share on other sites

It's an equivalent to PlayerWerewolfQuest (I'm very new to modding, so I don't know what you mean by "you pick during runtime" :biggrin: ), I want my spell (which is set as a second word for the howls, as for now) to send the quest stage to 100 in order to revert back to human form.

 

Basically, like the vanilla WerewolfQuest, just it has a different ID (hope this answers your question)

Link to comment
Share on other sites

It's an equivalent to PlayerWerewolfQuest (I'm very new to modding, so I don't know what you mean by "you pick during runtime" :biggrin: ), I want my spell (which is set as a second word for the howls, as for now) to send the quest stage to 100 in order to revert back to human form.

 

Basically, like the vanilla WerewolfQuest, just it has a different ID (hope this answers your question)

 

By RunTime I mean while you are playing skyrim if it's just one quest and always the same stage you want to change to you can use that script to do so but uhh if you wanted to Change that while playing skyrim ( ;) ) that would have to be answered by someone else scripting isn't my strong point.

Link to comment
Share on other sites

Should I attach the script to the Alias? Because then the spell effect is useless, it has no effect whatsoever. It's all pretty confusing I must say :confused:

 

True, True the effect would be useless and it would only depend on the spell being cast....but hey you could make the spell have a snazzy effect if you wanted that had nothing to do with setting the stage. I am sure you could use this with a self MagicEffect Script and use the OnEffectStart (I think that's the right event) instead and then plonk it there but I am unsure on that one.

Link to comment
Share on other sites

Oh I don't care about the visual for the moment, there's time to set those things up later ^^

 

Btw, I've compiled that script, but it failed, here's the result:

 

E:\Giochi\The Elder Scrolls V Skyrim\Data\Scripts\Source\temp\Spellcast1.psc(5,13): no viable alternative at input '100'
E:\Giochi\The Elder Scrolls V Skyrim\Data\Scripts\Source\temp\Spellcast1.psc(5,63): mismatched input '\\n' expecting STATE
No output generated for Spellcast, compilation failed.

Batch compile of 1 files finished. 0 succeeded, 1 failed.
Failed on Spellcast

 

(Yep, I changed StageQuest, Stage and StageSpell with the correct IDs)

 

What am I doing wrong?

 


Link to comment
Share on other sites

Oh I don't care about the visual for the moment, there's time to set those things up later ^^

 

Btw, I've compiled that script, but it failed, here's the result:

 

E:\Giochi\The Elder Scrolls V Skyrim\Data\Scripts\Source\temp\Spellcast1.psc(5,13): no viable alternative at input '100'

E:\Giochi\The Elder Scrolls V Skyrim\Data\Scripts\Source\temp\Spellcast1.psc(5,63): mismatched input '\\n' expecting STATE

No output generated for Spellcast, compilation failed.

 

Batch compile of 1 files finished. 0 succeeded, 1 failed.

Failed on Spellcast

 

(Yep, I changed StageQuest, Stage and StageSpell with the correct IDs)

 

What am I doing wrong?

 

 

 

 

Well that's your issue you shouldn't change them in that script they are fine the way they are compile it exactly as it was and then right click on the script then do edit properties and then select each property and add what is required to them there.

Link to comment
Share on other sites

I did exactly as you told me, however this is the first issue:

 

Starting 1 compile threads for 1 files...
Compiling "SpellCast"...
E:\Giochi\The Elder Scrolls V Skyrim\Data\Scripts\Source\temp\SpellCast.psc(8,7): cannot name a variable or property the same as a known type or script
E:\Giochi\The Elder Scrolls V Skyrim\Data\Scripts\Source\temp\SpellCast.psc(9,4): SpellCast is not a variable
E:\Giochi\The Elder Scrolls V Skyrim\Data\Scripts\Source\temp\SpellCast.psc(9,17): spellcast is not a variable
E:\Giochi\The Elder Scrolls V Skyrim\Data\Scripts\Source\temp\SpellCast.psc(9,27): cannot compare a spellcast to a spell (cast missing or types unrelated)
No output generated for SpellCast, compilation failed.

Batch compile of 1 files finished. 0 succeeded, 1 failed.
Failed on SpellCast

 

Then, when I go changing the properties:

 

Starting 1 compile threads for 1 files...
Compiling "SpellCast"...
E:\Giochi\The Elder Scrolls V Skyrim\Data\Scripts\Source\SpellCast.psc(8,7): cannot name a variable or property the same as a known type or script
E:\Giochi\The Elder Scrolls V Skyrim\Data\Scripts\Source\SpellCast.psc(9,4): SpellCast is not a variable
E:\Giochi\The Elder Scrolls V Skyrim\Data\Scripts\Source\SpellCast.psc(9,17): spellcast is not a variable
E:\Giochi\The Elder Scrolls V Skyrim\Data\Scripts\Source\SpellCast.psc(9,27): cannot compare a spellcast to a spell (cast missing or types unrelated)
No output generated for SpellCast, compilation failed.

Batch compile of 1 files finished. 0 succeeded, 1 failed.
Failed on SpellCast

And it won't let me add properties at all.

 

I perfectly understand if you're getting tired of assisting a noob like me, It's just that I'm missing this last bit before finishing, but it's fine if you don't want to help anymore :pinch:

Edited by Nattens_Madrigal
Link to comment
Share on other sites

  • Recently Browsing   0 members

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