Jump to content

Scripting Help like Lucky 8ball


secksegai

Recommended Posts

Hi. I'm just looking to use some items like the lucky 8ball script - as in holding it in inventory gave the +1luck, I'd like to have something that gave the bonuses from boone's beret without having to actually wear it since I want to see the hair for aesthetic reasons and find most clothing enchantments silly anyway. I'd also like to turn picking up snowglobes into granting permanent stat bonuses (like FONV bobbleheads of sorts), but I'm not familiar with scripting (or coding in general) and was ecstatic in just managing to change the weapon sunny gives out in the opening tutorial (to give you an idea).

 

On a side note, if anyone could explain to me how to get a a custom trait to remove properly during reconstruction, that be very helpful as well =)

Link to comment
Share on other sites

Create a Perk. Give it an ID Magical8BallPERK

 

  • Add a Perk Entry that increases Crit Chance by 5
  • Add a Perk Entry that increases Perception by 1

Make a new Quest and give it a name and unique ID. In the Quest Data tab check the boxes:

 

  • Start Game Enabled
  • Script Processing Delay

Click OK to save the quest. Reopen it, and on the Quest Data tab click the " ... " button next to script.

 

Type out something like this:

 

scn Magical8BallSCRIPT

begin GameMode

    if Player.GetItemCount HatNCRBoonesBeret != 0
         if Player.GetHasPerk Magical8BallPERK == 0
              Player.AddPerk Magical8BallPERK
         endif
    else
         if Player.GetHasPerk Magical8BallPerk != 0
              Player.RemovePerk Magical8BallPERK
         endif
    endif

end

 

And, as far as the question about removing a trait during recreation: I'm not sure, sorry.

Edited by UnknownZombie
Link to comment
Share on other sites

Wow simple and effective, thank you!

 

I can't remember if the 8ball in FO3 relied on a perk or not, but as this does exactly what I want for the beret, I'm content =)

 

Now if anyone could give me an example of doing something similar with turning the snowglobes into bobbleheads....

Or could I just follow the same scripting idea just remove that little else section?

Link to comment
Share on other sites

You could add the snow globes to the same script even.

 

Make a perk for each snow globe depending on which globe you want to raise which stats.

 

Then you can just rework the script to something like this:

 

(Note the new condition to specifically check if # of berets in your inventory is actually zero now, since we had to change the ELSE into a ELSEIF)

 

scn Magical8BallSCRIPT

begin GameMode

    if Player.GetItemCount HatNCRBoonesBeret != 0
         if Player.GetHasPerk Magical8BallPERK == 0
              Player.AddPerk Magical8BallPERK
         endif
    elseif Player.GetItemCount HatNCRBoonesBeret == 0
         if Player.GetHasPerk Magical8BallPerk != 0
              Player.RemovePerk Magical8BallPERK
         endif
    elseif Player.ItemCount SnowGlobeNameOne != 0
         if Player.GetHasPerk SnowGlobeNameOnePerk == 0
              Player.AddPerk SnowGlobeNameOnePerk
         endif
    elseif Player.ItemCount SnowGlobeNameTwo != 0
         if Player.GetHasPerk SnowGlobeNameTwoPerk == 0
              Player.AddPerk SnowGlobeNameTwoPerk
         endif
            .
            .
            .
    elseif Player.ItemCount SnowGlobeNameLastOne != 0
         if Player.GetHasPerk SnowGlobeNameLastOnePerk == 0
              Player.AddPerk SnowGlobeNameLastOnePerk
         endif
    endif

end

You don't have to worry about removing the perk the item is taken from your inventory, since the bobblehead perks from FO3 were permanent.

 

Unless you want to, that is..

 

If you want to have the perk removed if you lose them from your inventory (either by just dropping it or either by turning in for quest to get caps), then just work the IF/THEN blocks similar to how they are in the beret section (if getitemcount == 0, remove perk).

 

Another route maybe is not having the perk removed unless you turn the globes in for caps (that way you can sit them in your house and still keep perks, but lose perk if you turn them in for money). For this just make an IF/THEN block that checks to see if the quest for turning in that particular snow globe in has been completed.

 

P.S.: If you were wondering what the nested IF/THEN blocks inside the ELSEIF statements are for, they check to see if the player has the perk yet. If not, it adds the perk; if so, it ignores the instructions. This prevents the script from munching on CPU time by constantly giving the player a perk they already have.

Edited by UnknownZombie
Link to comment
Share on other sites

I totally forgot that the bobblehead scripts were still left in NV, so assuming the do once still works I'll be able to get that working when combined with the existing snowglobe script.

 

I tried saving an edited version of your script (replacing perk names and the first recon beret) but it wouldn't save, so I'm not sure what other variable I needed to change. Either way thank you for taking the time to help me.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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