Do scripts work this way? Can I apply a script to a spell li

Post » Mon Jun 18, 2012 3:11 am

I just spent about an hour making two spells for a friend to see if we could get something special to work. It did not. BUT, int he process, I learned how to make spell effects, spells, and spell tomes!

So now I'm wondering.

1. Can I make a script that automatically does a console command?
2. Can I apply that script to a spell?

I would like to make a spell to force the weather to clear or to force a thunderstorm. :)
User avatar
Veronica Martinez
 
Posts: 3498
Joined: Tue Jun 20, 2006 9:43 am

Post » Mon Jun 18, 2012 12:44 am

You can make spells that execute scripts - create a script type magic effect with your script attached, and add it to the spell. The language used by your script will differ a bit from console commands though, you may or may not be able to find a Papyrus equivalent to the console commands you want. It looks like what you want to do is possible though - see http://www.creationkit.com/Weather_Script.
User avatar
Stephanie Kemp
 
Posts: 3329
Joined: Sun Jun 25, 2006 12:39 am

Post » Mon Jun 18, 2012 11:48 am

Awesome. I don't know the basics of using the scripting, though...and that information there doesnt tell me what I need to tell the script for the weather.

Function http://www.creationkit.com/SetActive_-_Weather(bool abOverride, bool abAccelerate)

But what would that script look like if all I want it to do is set the weather to sunny, or to thunderstorm? Would it just be a one line script if I made it a spell, too? Weather eventually changes back based on the worldspace, and that's fine by me, but I would just like a way to blow some magicka and make th weather pop to a different type.
User avatar
Rachel Hall
 
Posts: 3396
Joined: Thu Jun 22, 2006 3:41 pm

Post » Mon Jun 18, 2012 12:13 am

Scriptname changetosunny extends ActiveMagicEffectWeather Property sunnyweather AutoEvent OnEffectStart()    sunnyweather.SetActive(true, false)EndEvent

Attach the sunnyweather property to anything you consider sunny weather.
User avatar
carley moss
 
Posts: 3331
Joined: Tue Jun 20, 2006 5:05 pm

Post » Mon Jun 18, 2012 11:04 am

Hm. Is this something basic I could figure out with a guide or am I gonna need a step by step? I don't understand what "properties" are, or what I would attach it to (im assuming one of the weather types). At present about all I can do relating to this is create spells and locate the weather types. I know how to make the spell a script and add in the script, that much is pretty obvious just from looking at the thing. The only thing I dont think I'll be able to maneuver just by looking at the screen is the script itself :P

Edit: Oh! There actually is a Magic Weather script. I dont seem to need to do it from scratch. But I still can't quite work out what I do need to do. Here's what it looks like:

http://i.imgur.com/BFP1R.png

Edit again: I may have figured it out :P
User avatar
CArlos BArrera
 
Posts: 3470
Joined: Wed Nov 21, 2007 3:26 am

Post » Mon Jun 18, 2012 4:34 am

Hm. Is this something basic I could figure out with a guide or am I gonna need a step by step? I don't understand what "properties" are, or what I would attach it to (im assuming one of the weather types). At present about all I can do relating to this is create spells and locate the weather types.

I've had a hard time understanding properties too, but I just figured it out last night. The Wiki does a poor job explaining them in laymans terms. Basically, you "assign" a property in the editor (in this case, it would be weather as the type, then you'd choose what type of weather in the drop down box, and then name it "sunnyweather" and attach it to your script by typing

 Weather Property sunnyweather Auto

For example.

For instance, say you have a script and in the script you wanted to add a spell to the player. To do it, you'd first in the editor itself, after you've created a new script, go to the "Properties" button, type in a name for your property (like "MyCoolSpell" with a "SPELL" property type), then on the right in the drop down box, pick the actual spell you created in the editor.

Then when you want to give the spell to the player via the script, you'd type in the declairation (see above code sample) using the same name as whatever you decided to name your property in the editor, then you'd use the AddSpell command, and reference that same name.

In other words, it connects your script with other objects, NPC's, spells, quests, etc outside of your script.
User avatar
CSar L
 
Posts: 3404
Joined: Fri Nov 09, 2007 9:36 pm

Post » Mon Jun 18, 2012 8:43 am

What you want to learn is http://www.creationkit.com/Category:Papyrus. Start with http://www.creationkit.com/Bethesda_Tutorial_Papyrus_Hello_World and then work your way through the next two tutorials. If you want to know more then keep going, but you should know enough to use that script after completing the first three.
User avatar
Jessica White
 
Posts: 3419
Joined: Sun Aug 20, 2006 5:03 am

Post » Mon Jun 18, 2012 2:53 am

What you want to learn is http://www.creationkit.com/Category:Papyrus. Start with http://www.creationkit.com/Bethesda_Tutorial_Papyrus_Hello_World and then work your way through the next two tutorials. If you want to know more then keep going, but you should know enough to use that script after completing the first three.

Truth be told the Papyrus tutorials are awful unless you already have real-world coding knowledge or happen to be wanting to do the EXACT same thing that the tutorial wants you to do (how to activate a button).

It helps by learning about Python itself, which is what Papyrus is based off of. Then read the forums here about scripts posted, then read the Primer on the Wiki and the tutorials, and then try to make your own script and fail at it a few times. Took me a few days but I finally understand how Papyrus "works" now after doing the above. Jumping straight into the wiki to learn it is a great way to get angry because it is only helpful as a reference manual, and to experienced coders or those already familiar with Python/LUA code language.
User avatar
Josephine Gowing
 
Posts: 3545
Joined: Fri Jun 30, 2006 12:41 pm

Post » Mon Jun 18, 2012 11:44 am

Well, actually, considering there's already apparently a script for this, I was hoping I could just modify it.

http://i.imgur.com/BFP1R.png

What I did was I changed WeatherAfterForm to one of the various weather types, assuming "after form" meant "what it would be after I used the spell" <_____<

Regardless of what it means, trial and error does nothing, as I can't get the spell to even show up in my inventory for some reason. Would it be safe to simply apply the script to, say, fireball until I can figure out how it works? If I dont have to learn papyrus right now I'll gladly use this :P
User avatar
Ladymorphine
 
Posts: 3441
Joined: Wed Nov 08, 2006 2:22 pm

Post » Mon Jun 18, 2012 12:59 am

The default script properties should work. It will change the weather to something pleasant, if there's a pleasant weather defined for the current region. The weather will be changed for the duration of the spell.

You have to attach the script to a magic effect (make a new one). Then make a spell with that effect and add it to your character.
User avatar
Maddy Paul
 
Posts: 3430
Joined: Wed Feb 14, 2007 4:20 pm

Post » Mon Jun 18, 2012 3:50 am

I know that much. I've already created an effect, spell, and tome. The default script properties don't seem to be set to do anything in particular, though. As far as I can tell they'll create the "default" weather, but I dont want that, I want thunderstorms at will. Which value would I change for that?

Also wold something like this be "Self"? I can't see why it would need to be "contact" or "aimed" or anything, but I dont know if it'll outright refuse tow ork if I choose the wrong one.
User avatar
Sabrina Schwarz
 
Posts: 3538
Joined: Fri Jul 14, 2006 10:02 am

Post » Mon Jun 18, 2012 5:01 am

Alright, I'm on the right track. I got the spell to show up in-game (turns out I forgot to set a magic school to it). I used it...and the sky got clear! Then I used it again and it got cloudy, and now when I use it nothing happens.

So I definitely can probably do what I want with this existing script, I just am...doing it wrong.
User avatar
Sabrina Steige
 
Posts: 3396
Joined: Mon Aug 20, 2007 9:51 pm

Post » Mon Jun 18, 2012 6:00 am

It uses http://www.creationkit.com/FindWeather_-_Weather internally, and unfortunately that doesn't have an option for thunderstorms.

The script first tries to match weather type (see the FindWeather page) from LocalWeatherA and if that fails it tries LocalWeatherB. Change those values for a different weather, but only those that FindWeather supports.

If you want it to change to a thunderstorm you'll need to find another script.

Self should be fine for this. It doesn't really matter, as long as the script runs on something.
User avatar
Victoria Bartel
 
Posts: 3325
Joined: Tue Apr 10, 2007 10:20 am

Post » Mon Jun 18, 2012 6:43 am

Well, I made thunderstorm the "WeatherForm" and it works! It causes a thunderstorm to start! But unfortunately it faded after only about 20 seconds :\
User avatar
kasia
 
Posts: 3427
Joined: Sun Jun 18, 2006 10:46 pm

Post » Mon Jun 18, 2012 5:21 am

And as obvious as it was, changing hte duration of the spell effectively changed the duration of the storm effect. I seem to have it completely functioning, no custom scripting required. :) Hooray!
User avatar
louise tagg
 
Posts: 3394
Joined: Sun Aug 06, 2006 8:32 am

Post » Mon Jun 18, 2012 3:45 am

Oops, I seem to have misread the script. LocalWeatherA and LocalWeatherB are the weathers it changes to when the spell is finished.

Glad you got it working!
User avatar
Lexy Corpsey
 
Posts: 3448
Joined: Tue Jun 27, 2006 12:39 am

Post » Mon Jun 18, 2012 7:05 am

http://steamcommunity.com/sharedfiles/filedetails/?id=9491

So awesome. :D This place is so helpful, even if the end result was basically just me messing around and trying as hard as possible to not have to script anything haha. :D
User avatar
Manny(BAKE)
 
Posts: 3407
Joined: Thu Oct 25, 2007 9:14 am


Return to V - Skyrim