Jump to content

Script Help! What am I doing wrong?


ashjay101

Recommended Posts

Hi all,

 

I'm currently in the middle of writing a script to ensure ALL companions (not just DLC ones) lose their inventories in casinos, The Fort, Silver rush, etc.

 

So far, my script looks like this:

scn CFEEUltraLuxeTriggerSCRIPT
short ConfiscatedCompanions
ref Companion1
ref Companion2
ref Companion3
ref Potential1
ref potential2
ref potential3
ref Companion1HERE
ref Companion2HERE
ref Companion3HERE
short DoOnce
Begin OnTrigger
If (CFEEUltraLuxeQuest.ConfiscatedCompanions != 1) && (CFEEUltraLuxeQuest.ConfiscatedCompanions != 2)
If (GetActionREF != Player) && (VMS18.bPlayerFrisked == 1)
set potential1 to GetActionREF
If (Potential1.GetPlayerTeammate == 1)
set CFEEUltraLuxeQuest.companion1 to Potential1
set Companion1HERE to CFEEUltraLuxeQuest.Companion1
set CFEEUltraLuxeQuest.ConfiscatedCompanions to 1
if Player.GetActorValue Sneak >= 50
Companion1HERE.RemoveAllTypedItems CFEEComp1CONT 1 0 40 NVImprovedHoldoutWeapons
else
Companion1HERE.RemoveAllTypedItems CFEEComp1CONT 1 0 40 NVHoldoutWeapons
endif
endif
endif
endif
end
Begin OnTrigger
If (CFEEUltraLuxeQuest.ConfiscatedCompanions == 1)
If (GetActionREF != Player) && (VMS18.bPlayerFrisked == 1)
set potential2 to GetActionREF
If (Potential2.GetPlayerTeammate == 1)
set CFEEUltraLuxeQuest.companion2 to Potential2
set Companion2HERE to CFEEUltraLuxeQuest.Companion2
set CFEEUltraLuxeQuest.ConfiscatedCompanions to 2
if Player.GetActorValue Sneak >= 50
Companion2HERE.RemoveAllTypedItems CFEEComp2CONT 1 0 40 NVImprovedHoldoutWeapons
else
Companion2HERE.RemoveAllTypedItems CFEEComp2CONT 1 0 40 NVHoldoutWeapons
endif
endif
endif
endif
end
Begin OnTrigger
If (CFEEUltraLuxeQuest.ConfiscatedCompanions == 2)
If (GetActionREF != Player) && (VMS18.bPlayerFrisked == 1)
set potential3 to GetActionREF
If (Potential3.GetPlayerTeammate == 1)
set CFEEUltraLuxeQuest.companion3 to Potential3
set Companion3HERE to CFEEUltraLuxeQuest.Companion3
set CFEEUltraLuxeQuest.ConfiscatedCompanions to 3
if Player.GetActorValue Sneak >= 50
Companion3HERE.RemoveAllTypedItems CFEEComp3CONT 1 0 40 NVImprovedHoldoutWeapons
else
Companion3HERE.RemoveAllTypedItems CFEEComp3CONT 1 0 40 NVHoldoutWeapons
endif
endif
endif
endif
However the issue is that the same companion is being assigned to Companion1, Companion2 & Companion3, what can I do to stop this, it's driving me mad!!!!?
Thanks :)
Link to comment
Share on other sites

This is a script segment ePath sent me, it'll require JIP

Try doing this and then containing the commands you want to do inside it:

array_var sCompanions
array_var aEntry

let sCompanions := player.getteammates
if sCompanions
   foreach Array_Var aEntry <- sCompanions
   let rCompanion := aEntry["value"]
   do your commands here
loop
endif
Link to comment
Share on other sites

  • Recently Browsing   0 members

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