Jump to content

Sink script issue


Rattlerx5150

Recommended Posts

I am by no means a computer programmer but I have been playing around with scripts in FNV. One think im trying to do it strip down the script thats in the Biological research station in the sink, so it will go directly to the menu Process to salient green.

 

I was able to make a script that immediately processes your plants, but when I tried to make a menu the script would fail

 

 

I can post my version of the script later today as I dont have it with me,, any help would be VERY appreciated

Link to comment
Share on other sites

here is my script:

 

 

scn 5150BiomassScript

 

Short nBananaYuccaCount

Short nBarrelCactusCount

Short nBrocFlowerCount

Short nHoneyMesquiteCount

Short nJalapenoCount

Short nMaizeCount

Short nNevadaAgaveCount

Short nPintoBeanCount

Short nPricklyPearCount

Short nWhiteHorsenettleCount

Short nXanderRootCount

Short nPlantCount

Short nAppleCount

Short nPearCount

Short nJalapenoPepperCount

Short nBuffaloCount

Short nPotatoCount

Short nCarrotCount

Short nPinyonCount

Short nMuttfruit1Count

Short nMuttfruit2Count

 

Begin OnActivate

 

Set nBananaYuccaCount to Player.GetItemCount NVFreshBananaYuccaFruit;

Set nBarrelCactusCount to Player.GetItemCount NVFreshBarrelCactusFruit;

Set nBrocFlowerCount to Player.GetItemCount BrocFlower;

Set nHoneyMesquiteCount to Player.GetItemCount NVFreshHoneyMesquiteFruit;

Set nJalapenoCount to Player.GetItemCount JalapenoPepper;

Set nMaizeCount to Player.GetItemCount NVFreshMaize;

Set nNevadaAgaveCount to Player.GetItemCount NevadaAgaveFruit;

Set nPintoBeanCount to Player.GetItemCount PintoBeanPod;

Set nPricklyPearCount to Player.GetItemCount PricklyPearCactusFruit;

Set nWhiteHorsenettleCount to Player.GetItemCount WhiteHorsenettleBerry;

Set nXanderRootCount to Player.GetItemCount XanderRoot;

Set nAppleCount to Player.GetItemCount Apple;

Set nPearCount to Player.GetItemCount Pear;

Set nCarrotCount to Player.GetItemCount Carrot;

Set nPotatoCount to Player.GetItemCount Potato;

Set nBuffaloCount to Player.GetItemCount BuffaloGourdSeed;

Set nJalapenoPepperCount to Player.GetItemCount JalapenoPepper;

Set nPinyonCount to Player.GetitemCount NVPinyonNuts;

Set nMuttfruit1Count to Player.GetitemCount Mutfruit1;

Set nMuttfruit2Count to Player.GetitemCount Mutfruit2;

Set nPlantCount to ( nMuttfruit1Count+nMuttfruit2Count+nPinyonCount + nCarrotCount + nPotatoCount + nBuffaloCount + nJalapenoPepperCount + nBananaYuccaCount + nBarrelCactusCount + nBrocFlowerCount + nHoneyMesquiteCount + nJalapenoCount + nMaizeCount + nNevadaAgaveCount + nPintoBeanCount + nPricklyPearCount + nWhiteHorsenettleCount + nXanderRootCount + nAppleCount + nPearCount );

Player.RemoveItem NVFreshBananaYuccaFruit nBananaYuccaCount;

Player.RemoveItem NVFreshBarrelCactusFruit nBarrelCactusCount;

Player.RemoveItem BrocFlower nBrocFlowerCount;

Player.RemoveItem NVFreshHoneyMesquiteFruit nHoneyMesquiteCount;

Player.RemoveItem JalapenoPepper nJalapenoCount;

Player.RemoveItem NVFreshMaize nMaizeCount;

Player.RemoveItem NevadaAgaveFruit nNevadaAgaveCount;

Player.RemoveItem PintoBeanPod nPintoBeanCount;

Player.RemoveItem PricklyPearCactusFruit nPricklyPearCount;

Player.RemoveItem WhiteHorsenettleBerry nWhiteHorsenettleCount;

Player.RemoveItem XanderRoot nXanderRootCount;

Player.RemoveItem Apple nAppleCount;

Player.RemoveItem Pear nPearCount;

Player.RemoveItem Potato nPotatoCount;

Player.RemoveItem Carrot nCarrotCount;

Player.RemoveItem BuffaloGourdSeed nBuffaloCount;

Player.RemoveItem JalapenoPepper nJalapenoPepperCount;

Player.RemoveItem NVPinyonNuts nPinyonCount;

Player.RemoveItem Mutfruit1 nMuttfruit1Count;

Player.RemoveItem Mutfruit2 nMuttfruit2Count;

Player.AddItem NVDLC03SalientGreen nPlantCount;

 

 

End

Link to comment
Share on other sites

You could shorten that script greatly, and make it much easier to maintain, by employing a form list. All you'd need to do is create a form list that contains each type of plant that you'd like to remove, and this could be your entire script:

ScriptName 5150BiomassScript

int iPlantCount

Begin OnActivate player

set iPlantCount to player.GetItemCount ExamplePlantFormList
player.RemoveItem ExamplePlantFormList iPlantCount
player.AddItem NVDLC03SalientGreen iPlantCount

End

Note that you don't need to finish lines with a semicolon. In Fallout 3 and New Vegas scripts, semicolons denote the beginning of a line comment.

 

By using a form list like this, you can refer to the list in multiple places if you need to, and in order to change its contents you only need to change a single form. Also, none of your scripts will need to be recompiled after such a change.

 

Oh, and you should be very wary of using an editorID starting with a number, as you have done for this script. While naming scripts like that usually won't cause you to run into any problems, if you ever try to refer to such an editorID in a script the compiler will throw a "form not found" error, and your script will not compile.

 

 

P.S. Please use code tags when posting scripts. This forces them to use a fixed-width font and maintains their indentation.

 

Cipscis

Link to comment
Share on other sites

  • Recently Browsing   0 members

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