Jump to content

Fallout 3 scripting help.


Deleted226294User

Recommended Posts

Hello everyone, I'm new to the Fallout 3 modding, and especially the scripting part. I've scripted in the past for games like Doom 3 or Quake, but this is really different and I need some help from the experts in this forum.

 

I'm trying to a script that start from the beginning and checks for certain notes in the player inventory. Once the player have all the notes, a message should pop-up and a perk will be added.

 

I've already created the required notes, and the message window, but the script doesn't work, and I don't know where I'm doing wrong.

 

This is the script I did:

 

scn aEXPExplorerHolosSCRIPT


short HasItems
short DoOnce

BEGIN GameMode

	if GetHasNote aEXPExplorerDiary1 == 1  || GetHasNote aEXPExplorerDiary2 == 1  || GetHasNote aEXPExplorerDiary3 == 1 || GetHasNote aEXPExplorerDiary4 == 1 || GetHasNote aEXPExplorerDiary5 == 1  || GetHasNote aEXPExplorerDiary6 == 1
	  set HasItems to 1
	endif

	if HasItems == 1
		ShowMessage aEXPExplorerHolosMessage
		   player.addperk Explorer	


endif
End

 

I don't know if this is the right method, maybe is better to make it with quest stages?

 

Thanks in advance.

Link to comment
Share on other sites

This might work:

 

scn aEXPExplorerHolosSCRIPT


short HasItems
short DoOnce

BEGIN GameMode

 if player.GetHasNote aEXPExplorerDiary1 && player.GetHasNote aEXPExplorerDiary2 && player.GetHasNote aEXPExplorerDiary3 && player.GetHasNote aEXPExplorerDiary4 && player.GetHasNote aEXPExplorerDiary5 && player.GetHasNote aEXPExplorerDiary6
	  set HasItems to 1
		   if HasItems && DoOnce == 0
				Set DoOnce to 1
				ShowMessage aEXPExplorerHolosMessage
				player.addperk Explorer
		   endif
 endif
End

 

The condition that is symbolized by || is "OR" so your original script would trigger the message and perk if any of the notes are present in the player's inventory, rather than needing all of them; so I changed that to && for "AND". You did not specify the subject who needs to have the notes, so I added player.GetHasNote. It is not a problem to add == 1, but I don't think it is necessary in this case since it is only checking for either 0 or 1, so I omitted them. I also nested the "if HasItems" condition so that the game will only poll for that condition when all of the items are in the player's inventory. I also added the DoOnce to script function to prevent the message and perk from looping.

Link to comment
Share on other sites

This may also need to be a quest script rather than an object script to work properly, though it might work if you used it as an object script on each of the notes and used "begin OnAdd Player" instead of "Begin Gamemode". That would leave the script dormant until a note is picked up and make it unnecessary for the game to continually wonder if the player has all of the notes yet.
Link to comment
Share on other sites

So with gamemode it check constantly if the player have the notes? It sounds like it eat some performance, I may take the AddOn route.

 

But there is another problem, on the notes there isn't a script field, just a quest owner field and the other stuff for audio and text. But the notes are holodisk using a quest for the audio logs, I have to put the script on the quest?

Link to comment
Share on other sites

If there is no way to add an object script to the notes then using a quest script may work. Though I have been able to associate Note meshes that have object script options with the type of notes that show up on the player's PipBoy; it may be simpler to make a quest script. There is a spot on the first tab of each quest to plug in a quest script. In that case you would probably want to stick with Begin GameMode.

 

The note script doesn't have to be the entire quest script, but could be added to a quest script that you may already be using. Just make sure to add the "shorts" and then copy and paste the portion from Begin to End. If it still doesn't work try adding back the =1 bits that I removed, just in case I was too ruthless with trimming.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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