Jump to content

Is this possible?


SirIdiot

Recommended Posts

Now, I know I ask a lot of questions on the forum and I could get annoying to some. But I need to know if this is possible or not and if it is, how?

I want to make it so that when an NPC says something, after he says it he will punch the player. The player will then fade into blackness and wake up in a room. (I know how to move the player) Then, in the room, I want him to wake up, using the animation that plays in doc mitchells house when you start the game?

Link to comment
Share on other sites

Honestly I'm not sure how to best do dialogue animations.

 

Next: I'm not saying this is the best way to do it, but this is how I would do it. I would call DisablePlayerControls concurrently with the punch. I would use the Dialogue Result Script (End) to add a token to the player. I would have that token run a staged timer, first calling ApplyImageSpaceModifier for a fadeToBlack IMAD. After the FTB is done, use player.moveTo to transport the player to your location, second part of the Staged Timer.

 

Find the IMAD used by the 'wake up' scene, and apply it in the third step of the Staged Timer, along with ditching the token.

 

You'll probably have to do a lot of tuning to get the timings right.

Link to comment
Share on other sites

A token is a weightless, unplayable armour form that can be added to an actor's inventory (Usually the player) to run a variety of scripts. A staged Timer works like this:

 

float fTick
short sStage

begin gameMode

	set fTick to fTick + GetSecondsPassed
	
	if (fTick <= CONSTANT_1) ;first stage.
		if (sStage != 1)
			set sStage to 1
			DoStage1Tasks
		endIf
	elseIf ((fTick > CONSTANT_1) && (fTick <= CONSTANT_2))
		if (sStage != 2)
			Set sStage to 2
			DoStage2Tasks
		endIf
	elseIf ((fTick > CONSTANT_2) && (fTick <= CONSTANT_3))
		if (sStage != 3)
			set sStage to 3
			DoStage3Tasks
		endIf
	elseIf ...
	elseIf ((fTick > CONSTANT_n-1) && (fTick <= CONSTANT_n))
		if (sStage != n)
			set sStage to n
			DoStagenTasks
		endIf
	endIf

end

Here's an example I use to control the BulletTime ImageSpaceModifier in my DARC:PH mod:

 

scn DARC08scptTokenBLTM

short sAP
float fTick
float fTick2

begin onAdd player

	player.modActorValue Turbo 1
	player.addPerk DARC08perkImplantAccelAPKill
	imod DARC08imodBLTMFadeIn
	Set fTick to 0
	Set fTick2 to 0

end

begin GameMode

	if IsImageSpaceActive DARC08imodBLTMFadeIn
		if (fTick2 >= 0.65) && (fTick2 <= 1)
			imod DARC08imodBLTM
			rimod DARC08imodBLTMFadeIn
		else
			Set fTick2 to fTick2 + GetSecondsPassed
		endIf
	endIf
	if fTick >= 0.25
		set fTick to 0
		player.damageActorValue ActionPoints 5
		Set sAP to player.getActorValue ActionPoints
		if sAP <= 0
			player.modActorValue Turbo -1
			player.removePerk DARC08perkImplantAccelAPKill
			Set DARC08qstImplant.bBulletTime to 0
			imod DARC08imodBLTMFadeOut
			rimod DARC08imodBLTM
			RemoveMe
		endIF
	else
		Set fTick to fTick + GetSecondsPassed
	endIF

end

It's a bit clumsier than a proper staged timer. The constant values are taken from the IMAD, which has, I believe, a 1.25 Second duration.

 

IMAD is the four-letter designation for ImageSpaceModifier.

Link to comment
Share on other sites

You make a token. DoStage1Tasks would basically be ApplyImageSpaceModifier IMAD - I'm not sure what the FTB IMAD editorID's are.

 

DoStage2Tasks would be player.moveTo. Your third stage would be RemoveImageSpaceModifier FTB, which might be Skippable, and applying the 'Wake Up' IMAD. Finally, you need to restore player control; this might be best done as a fourth stage.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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