Jump to content

Making new Bobbleheads


Judasace

Recommended Posts

The vanilla bobbleheads are very simple - they're just scripted miscellaneous items. When picked up for the first time, they use ShowMessage, and some AV functions in order to display a message and alter the player's stats. For example, here is the script attached to the Agility bobblehead, after being cleaned up slightly:

ScriptName BobbleheadAGLScript

;This is a Bobblehead script for the Collector Bobbleheads located in game
;On pickup, you recieve the motivational phrase and the appropriate buff

short DoOnce

Begin OnActivate player

if DoOnce == 0
	set DoOnce to 1
	if player.GetPermanentActorValue Agility < 10
		player.ModActorValue Agility 1 ;Mod the perm. pool so it sticks
	endif
	ShowMessage BobbleheadAGLBuffMessage ;This is the corner buff message
	Activate ;Allow item pickup

	set BH01.Carrying to 1 ;Tell the script the player has one or more Bobbleheads (for display case)
	set BH01.HaveAGL to 1 ;Set the variable for Display Case
	ModPCMiscStat "Bobbleheads Found" 1

	set BH01.Bobbles to BH01.Bobbles + 1
	if BH01.Bobbles == 10
		AddAchievement 49
	elseif BH01.Bobbles == 20
		AddAchievement 50
	endif
endif

End

When making a new bobblehead, you can ignore all of the code affecting variables in the script attached to "BH01", and possible the AddAchievement stuff too. You could use this code as a template for a new bobblehead script:

int bDoOnce

Begin OnActivate player

if bDoOnce
	Return
else ;if bDoOnce == 0
	set bDoOnce to 1

	;Apply effect here

	ShowMessage <Your Bobblehead Message>
	Activate

	ModPCMiscStat "Bobbleheads Found" 1

	set BH01.Bobbles to BH01.Bobbles + 1
	if BH01.Bobbles == 10
		AddAchievement 49
	elseif BH01.Bobbles == 20
		AddAchievement 50
	endif
endif

End

For example, you could use this code in the place of ";Apply effect here" to increment the player's Repair and Small Guns skills by 5 each:

if player.ModActorValue Repair 5
player.ModActorValue SmallGuns 5

Nice and easy - right?

 

Cipscis

Link to comment
Share on other sites

Hey, thanks I will see if that works.

 

One thing that I found confusing though was This mod: http://www.fallout3nexus.com/downloads/file.php?id=1560. It reduces the bobblehead skill growth from 10 to 4, but doesn't alter the script. Instead it changes ability functions in the Geck, which seem specially created for each bobblehead. The thing I couldn't see was how these bobblehead skill functions were tied to the bobblehead object.

Link to comment
Share on other sites

Hah, figures that the one mod I didn't even bother to test because I assumed it was so simple would fail so spectacularly. Thanks for noticing (strange that no one else did, including the person who requested the mod in the first place... :confused: ). I'll fix it eventually, but I actually have to reinstall FO3 first (had a computer meltdown resulting in a reformat of the drive that it was on). I've added a note about the mod not working to its page for now.
Link to comment
Share on other sites

  • Recently Browsing   0 members

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