Jump to content

freeing npcs from crucifix


templeofninpo

Recommended Posts

Alright.

I have a couple guys hanging up there properly, but when it comes to getting them down I'm at a loss.

 

I've taken the script from the NPC 'hostages' in Nelson...

 

scn VNelsonHostageRestrain2

float timer
Short Freed
Short DoOnce
Short Button
Short iCount ; Counter to enable Legion enemies if hostages are rescued
Short bBooneReacted;
Short Home

BEGIN GameMode
;forces to check restrain
;getfurnituremarkerid == 26

if DoOnce == 0
if GetSitting == 3
IgnoreCrime 1
setRestrained 1
set DoOnce to 1
endif
endif

; Too many NPCs in the area
;If VNelson.bLegionSpawned != 1
; If Freed == 1
; If iCount < 1
; NelsonLegion01REF.Enable 1
; Set iCount to 1
; Return
; Elseif iCount == 1
; NelsonLegion02REF.Enable 1
; Set iCount to 2
; Return
; Elseif iCount == 2
; NelsonLegion03REF.Enable 1
; Set iCount to 3
; Set VNelson.bLegionSpawned to 1
; Endif
; Endif
;Endif


END

BEGIN OnLoad
IgnoreCrime 1
;Cripples both legs for all three
NelsonNCRHostage01REF.DamageActorValue LeftMobilityCondition 5
NelsonNCRHostage01REF.DamageActorValue RightMobilityCondition 5

NelsonNCRHostage02REF.DamageActorValue LeftMobilityCondition 5
NelsonNCRHostage02REF.DamageActorValue RightMobilityCondition 5

NelsonNCRHostage03REF.DamageActorValue LeftMobilityCondition 5
NelsonNCRHostage03REF.DamageActorValue RightMobilityCondition 5
END

Begin onhit player
setenemy caesarslegionnelsonfaction playerfaction
End

BEGIN OnActivate

If IsActionRef Player == 1
if ( GetDead == 0 )
if ( freed == 0 )
if ( IsActionRef player == 1 )
;if ( Player.IsInCombat == 0 ) **
ShowMessage TecMineHostageMSG
;endif
endif
endif
elseIf ( GetDead == 1 ) || ( Freed == 1 )
Activate
endif
Endif
END


BEGIN Menumode 1001

if ( freed == 0 )
set button to GetButtonPressed
if ( button == 1 )
SetRestrained 0
ignoreCrime 0
;Addtofaction NCRFactionNV 1
;setenemy caesarslegionnelsonfaction playerfaction
setpcenemyoffaction caesarslegionnelsonfaction 1
set VNelson.NumHostages to VNelson.NumHostages + 1
set VNelson.HostagesFreedTotal to VNelson.HostagesFreedTotal + 1;
if VNelson.NumHostages == 3
set VNelson.HostagesFreed to 1
if GetObjectiveDisplayed VNelson 10 == 1 && GetQuestCompleted VNelson == 0 ; <<< (Added 7_27_10) Added conditions to address issue where during VMS30: Restoring Hope...
SetObjectiveDisplayed VNelson 15 1 ; <<< ...this objective would be set even though the Player had not started VNelson quest yet.
endif ; <<< (7_29_10) Changed first condition from "GetQuestRunning" to "GetObjectiveDisplayed" -ETB
endif
if (VNPCFollowers.bBooneHired == 1 && bBooneReacted == 0 && VNelson.HostagesFreedTotal + VNelson.HostagesKilled >= 3)

set VDialogueCraigBoone.nOpenness to VDialogueCraigboone.nOpenness + 1;
if (VNelson.HostagesFreedTotal>= 3) ; bonus for saving all three
set VDialogueCraigBoone.nOpenness to VDialogueCraigboone.nOpenness + 1;
endif
set bBooneReacted to 1;
CraigBooneREF.SayTo player VDialogueCraigBooneNelsonReactSave
endif
set Freed to 1
evp
endif
endif
END

BEGIN OnDeath

set VNelson.NumHostages to VNelson.NumHostages - 1
set VNelson.HostagesKilled to VNelson.HostagesKilled + 1

; there was previously a check inserted here to see that the Nelson quest was running and incomplete. I don't think that's necessary for Boone to react to the mercy killings,
; and have removed it. -EPF 7/29/10
if (VNPCFollowers.bBooneHired == 1 && bBooneReacted == 0 && VNelson.HostagesKilled + VNelson.HostagesFreedTotal>= 3)
CraigBooneREF.SayTo player VDialogueCraigBooneNelsonReactMercyKill
set VDialogueCraigBoone.nOpenness to VDialogueCraigboone.nOpenness + 1;
set bBooneReacted to 1;
endif

if VNelson.HostagesKilled == 3 && NVNelsonRangerMiloREF.getdead == 0
if GetObjectiveDisplayed VNelson 10 == 1 && GetQuestCompleted VNelson == 0
setStage VNelson 15
endif
endif

END

 

... and widdled (sp?) it down to this...

 

scn AAAGGShebibCrucifixScript

Short DoOnce
short freed

BEGIN GameMode

if (DoOnce == 0) && (freed == 0)
if (getstage AAAGGRescueQuest >= 10) && (getstage AAAGGRescueQuest <= 80)
setRestrained 1
set DoOnce to 1
endif
endif
END

BEGIN OnActivate

If (IsActionRef Player == 1) && (getstage AAAGGRescueQuest == 80)
ShowMessage AAAGGCrucifixReleaseMsg
Activate
SetRestrained 0
set freed to 1
evp
Endif
END

 

 

I have them set (the npcs) with 'linked references' to the crucifix furniture.

I have a travel package set to 'near linked ref'. and conditioned with a script variable that will only run when they are freed != 1.

The message displays when the NPC is activated but nothing else happens.

Any ideas out there? this is the second last quest in my new 'quaint' multiquest mod and I would like my friends to be rescued.

 

PS: is it a faction thing? ... I'll check.

 

 

Edited by templeofninpo
Link to comment
Share on other sites

I have an NPC that starts out crucified in Nipton, can be freed, and then acts as a follower. When I get home tonight I'll post the details of how I made it.

 

From what I recall, I just created a package for the NPC while crucified, then I just clear the NPC script variable and set the NPC follow variable when freeing them (set through dialog). There's no factions involved.

Link to comment
Share on other sites

Crucifix if a simple idle marker which these NPC use (and they are restrained also).

You already unrestrained them.

Try Adding any travel package (to player). They should exit idle marker and do what you want.

Link to comment
Share on other sites

This is my NPC's script:

 

scn zzCrucifiedScript

short HasBeenHired
short L38
short Relax
short CrossState
short DoOnce

int ConvoState

int CombatStyleRanged
int CombatStyleMelee
int IsFollowingDefault
int IsFollowingLong
int FollowerSwitchAggressive
int Waiting

Begin GameMode
If(DoOnce != 1)
Set HasBeenHired to 0
Set L38 to 0
Set CombatStyleRanged to 1
Set CombatStyleMelee to 0
Set IsFollowingDefault to 0
Set IsFollowingLong to 0
Set FollowerSwitchAggressive to 0
Set Waiting to 0
Set Relax to 0
Set CrossState to 1
Set ConvoState to 0
Set DoOnce to 1
Endif
End

It's your basic Joe Average NPC script, nothing fancy. The only addition relative to getting them crucified is the addition of the variable short CrossState which is initialized to 1 (they start out on the cross).

 

The NPC is placed in front of the cross where they will be crucified. The cross is just the standard cross static model (NVCrucifix). In front of that is the crucifixion furniture (NVCrucifixFurniture), which I gave a reference of zzCrucFurn1REF. It's fairly easy to line up the furniture with the cross if you line it up where the hands attach to the crossbar. You don't need to give the static cross a ref, only the furniture part.

 

My NPC has a ref of zzCrucified1REF.

 

The crucifixion AI package (which I happened to name zzCrucified1Cross) has a type of travel, with the destination being the crucifixion furniture (zzCrucFurn1REF in my case). Under misc flags, only EnableFalloutBehavior is checked. Under conditions, I have it check GetScriptVariable reference: zzCrucified1REF, CrossState == 1. You don't need to do anything else to the package. You don't need to pick the crucifixion idle in the package. It will automatically pick that idle based on the furniture type.

 

My NPC also has your other typical NPC packages like follow, wait, etc.

 

The script in the dialog quest to free the crucified victim and add them as a follower looks like this:
Set zzCrucified1REF.CrossState to 0
Set zzCrucified1REF.Waiting to 0
Set zzCrucified1REF.IsFollowingDefault to 1
Set zzCrucified1REF.HasBeenHired to 1
zzCrucified1REF.SetPlayerTeammate 1
zzCrucified1REF.SetIgnoreFriendlyHits 1

As you can see, most of that is adding them as a follower. There's only the one line setting the CrossState variable which actually frees them.

 

And that's all you need to do.

 

My NPC is actually a bit fancier than that. I have two copies of the NPC, each with a custom race. The race for the crucified version has a skin texture that has them all bloodied and bruised (they really look like they've had the snot beat out of them), and the script to free them also hobbles both of their legs so that once they do get freed, they limp until they get healed. The healing script swaps out the bloodied NPC for the non-bloodied NPC, which is stored in a temporary inaccessible interior holding cell.

 

The conversation options for when they are hanging on the cross (checked by making a conditional off of the CrossState variable) have a greeting where they just weakly say "help me" and the only options while they are on the cross is to either free them or leave them hanging.

Edited by madmongo
Link to comment
Share on other sites

works now with variable- 'freed'. problem now is the npcs I crucify at the end of the quest are missing (I'm presuming they are being put in the cell at quest start and its entrance isn't enabled yet so I can't even check to see if they are there....

anyhoo, continuing to plug away...

Link to comment
Share on other sites

  • Recently Browsing   0 members

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