Hopefully simple scripting question involving a Quest Result

Post » Sun May 05, 2013 9:24 am

Ok, I'm planning a mod that changes the Kvatch Cuirass you get from Savilan Matius upon completing the Battle for Castle Kvatch. Changing the armor itself and its enchantments are easy, I can do that in my sleep at this point.

However, I want to make it so that the type of armor it is depends on whether the character's Light or Heavy armor skill is higher.

My question is, will this scripting work in the Result Script box for the appropriate topic, or do I have to make an actual script and call it separately?

Here is what it is now:

player.removeitem coloviansignetring 1additem coloviansignetring 1removeitem townguardcuirasskv 1player.additem MS49RewardCuirassList 1SetStage MS49 100

I want to change it to something like this:

player.removeitem coloviansignetring 1additem coloviansignetring 1if player.getav lightarmor &--#62; player.getav heavyarmor	   	 player.additem MS49RewardCuirassList 1else		   player.additem MS49RewardCuirassListHeavy 1endifSetStage MS49 100

Is this corret? Or is there another/better way of doing this?
User avatar
Bad News Rogers
 
Posts: 3356
Joined: Fri Sep 08, 2006 8:37 am

Post » Sun May 05, 2013 10:22 am

I don't think you can run script syntax from the result box. At least I've never been able to. The simplest solution I can think of is to create a non-journal quest and quest script. Then you can replace the additem line with a StartQuest line in the result box, and have the quest script run something like your if/else block. Sorry I can't check the syntax for you right now but at first glance it looks like it should work.
User avatar
Mrs shelly Sugarplum
 
Posts: 3440
Joined: Thu Jun 15, 2006 2:16 am

Post » Sun May 05, 2013 3:11 pm

Oh, yeah, reading the CS Wiki makes it look like thats the case. I guess I'll be making my first script~

Getting a character to that point in the game will be irritating. Especially since my gameplay testing install suddenly decided to crash whenever an exterior loads. Eargh.

Edit: Oh wait if I do it as a separate quest I can just fire the quest whenever to test it.
User avatar
Justin Bywater
 
Posts: 3264
Joined: Tue Sep 11, 2007 10:44 pm

Post » Sun May 05, 2013 12:36 pm

You can run script syntax from the result box, you merely may not indent with the tab key. Use spaces instead if you wish.

Your initial result script is correct, Nephenee.
User avatar
Rachel Cafferty
 
Posts: 3442
Joined: Thu Jun 22, 2006 1:48 am

Post » Sun May 05, 2013 2:10 pm

COOOOOOOL

Thanks!
User avatar
Davorah Katz
 
Posts: 3468
Joined: Fri Dec 22, 2006 12:57 pm


Return to IV - Oblivion