Jump to content

USMC TCM Scripting...


Vindt

Recommended Posts

Ok, so I'm working on a TCM right? Well, I'm at the point now where I'm trying to make the PC start in the proper location post chargen. I've looked through the MQ and CG quests in the GECK trying to make sense of it, but frankly, it all looks like latin to me. Obviously coding is beyond my capabilities. C4 Craig gave it a try, and he couldn't understand it either. As such much :wallbash: has ensued, not to mention it's caused a delay in the current version being released. Here's the one useful bit (with some not-so-useful bits included) that I did manage to make sense out of; it's the chargen that you get when leaving the Vault 101 cave.

 

ScriptName Vault101ExitScript


short button
short reactivate		; set to 1 to trigger automatic reactivation
short saved				; set to 1 first time player activates

short updateDad		; set to 1 when using race menu in order to make sure Dad gets updated to match player

short tempVar 

Begin OnActivate
if IsActionRef player == 1
	; at the end of CG04, the player has one last change to change his character
	if GetQuestRunning CG04 == 1 && getStageDone CG04 150 == 0
		player.scaonactor 	; just in case
		if saved == 0
			set saved to 1
			; save the game here
			forceSave
			; we can't pop the message box until the next frame so the save can actually happen
		elseif saved >= 3
			showMessage CG04VaultExitMessage
		endif
	else
		Activate
	endif
else
	Activate
endif
End

begin gamemode
; update Dad's face after using race menu
if updateDad == 2
	set updateDad to 0
	; dad matches player's race and face
	MQDadREF.MatchRace player
	; match face
	MQDadREF.MatchFaceGeometry player CGMatchFace
endif

if saved == 1
	; player has just saved, wait until next frame
	set saved to 2
elseif saved == 2
	set saved to 3
	showMessage CG04VaultExitMessage
endif

if reactivate == 1
	set reactivate to 0
	activate player 1
endif
	
set button to getbuttonpressed
if button > -1
	if button == 4
		; exit vault
		setstage CG04 150
		activate player
	else
		if button == 0
			set tempVar to button
			GetPlayerName
		elseif button == 1
			set updateDad to 1
			ShowRaceMenu
		elseif button == 2
			SetSPECIALPoints 40
		elseif button == 3
			SetTagSkills 3
		endif
		set reactivate to 1
	endif
endif

end

begin menumode 1036
if updateDad == 1
	set updateDad to 2
endif
end

 

I know some of that needs to be removed, and some of it needs to be tweaked. Coding also needs to be added so that the player goes through chargen prior to loading at my playerstart marker. As stated above, this is all beyond my current team's capabilities, including my own.

 

Any and all assistance with this will be -vastly- appreciated. :D :thanks:

Link to comment
Share on other sites

I'm not really sure what you want to do here, do you want the player to appear at a different location when they leave Vault 101?

 

The script that you included in your post is fairly simple. When the door that it is attached to is activated by the player in the correct stage of the CG04 Quest, scaonactor is called on the player to stop combat, then the game is saved via ForceSave, then a messagebox is opened via ShowMessage. If the door is activated by any Actor other than the player, or the door is activated by the player while they are not in the correct stage of CG04, then it is just activated like a normal door.

 

Once the messagebox has been shown, the GameMode block runs and uses GetButtonPressed to determine which button the player has pressed. For most of the buttons, one of the CG functions, like GetPlayerName or ShowRaceMenu is called. If ShowRaceMenu is called, then MQDadRef's race and facial features are updated to match the new race and facial features of the player. Once the new menu opened via one of the CG functions has closed, the messagebox is shown again. This continues until the player elects to exit Vault 101, in which case the Quest Stage of CG04 is advanced and the door is activated normally.

 

If all you want to do is change the location which the door sends you to, then you don't need to touch this script at all. All you need to do is change the door's associated teleport marker, like you would do when changing the destination of any other teleport door.

 

Cipscis

Link to comment
Share on other sites

Actually, I was only planning on using that script to activate the chargen sequence...seemed like a better idea than rifling through all the CG quests and trying to pluck out the appropriate scripts... o.O particularly with the specials otherwise attached to a book...

 

But no, no plans on that door going elsewhere...the PC should start in cell 03USMC as an adult and not inside the Vault as a toddler...that's the end result desired, at any rate...

Link to comment
Share on other sites

The script attached to that book calls ShowSPECIALBookMenuParams, passing a value of 40 as its parameter. If you want to add a button to the menu that allows the player to distribute their SPECIAL points, there are a range of functions available to you. I would recommend using either ShowSPECIALBookMenuParams or, probably preferably, SetSPECIALPoints.

 

Is that more the sort of answer that you were looking for?

 

Cipscis

Link to comment
Share on other sites

The script attached to that book calls ShowSPECIALBookMenuParams, passing a value of 40 as its parameter. If you want to add a button to the menu that allows the player to distribute their SPECIAL points, there are a range of functions available to you. I would recommend using either ShowSPECIALBookMenuParams or, probably preferably, SetSPECIALPoints.

 

Is that more the sort of answer that you were looking for?

 

Cipscis

 

I don't think so... o.O like I said, it all looks like Latin to me...try rephrasing what I need :P

 

Step one: Player begins character generation

1a: Gender Choice

1b: Name

1c: face generation

1d: Adding the initial 5 SPECIALS points

1e: choosing tagged skills

Step two: Player loads at my player start marker labeled "playerstart" within the cell 03USMC

 

After this point, it's more quests and conversation topics, etc...only one other thing I'll need scripting help with, though that's just a simple NPC death (At least that's all I know about atm...) :P

 

Step three: Petty Officer 2nd Class Coleman speaks to the player

Step four: The first encounter with the PC's Squad NCO; Sergeant McHale

Step five: Introduced to the rest of the Squad (I'll have a lot of dialogue by this time, hopefully...which'll mean time for voice actors...)

 

And I won't go past that for now... ;) don't want to spoil anything after all :)

Link to comment
Share on other sites

Right, so you want the player to proceed through each of the CG Menus as soon as they start a new game? In that case, you'll have to change the "CG00" Quest (defined as "SCharGenQuest in FALLOUT.INI) so that it causes the player to proceed through each menu in turn, and moves them to the new cell.

 

I would recommend that, in CG00's script, you simply call StartQuest and StopQuest to effectively replace it with your own quest.

 

For your own Quest's script, I would recommend that you use something like this:

Begin GameMode

if GetStage ExampleCGQuest == 0
	SetStage ExampleCGQuest 1
	ShowNameMenu
elseif GetStage ExampleCGQuest == 1
	SetStage ExampleCGQuest 2
	ShowRaceMenu
elseif GetStage ExampleCGQuest == 2
	SetStage ExampleCGQuest 3
	SetSPECIALPoints 40
elseif GetStage ExampleCGQuest 3
	SetStage ExampleCGQuest 4
	SetTagSkills 3
endif

End

I haven't tested that script, but I assume that it would work just fine. You'll want to replace "ExampleCGQuest" with the EditorID of your own Quest.

 

Cipscis

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

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