Jump to content

Need help with creating torture prisoners (SetRestrained help)


realXavori

Recommended Posts

I'm trying to create a room with unkillable torture prisoners shackled to a wall ala the Dark Brother Sanctuary.

 

So far, I've created the NPC's, put the shackles in, did the basic AI package that makes the prisoners get in the shackles so they're chained up with the player first sees them. Setting them to essential makes them unkillable, and checking the ignore combat box gets them to not punch the player in the face.

 

However, I cannot keep them shackled. I know I need to use the SetRestrained function to do this, but I have zero experience with scripting and trying to figure out how to trigger it.

 

My first thought was to create a trigger box that ran a script when the player entered, but I can't even get the trigger box example from the CK wiki to work. I created the trigger box. Assigned it the exact script from the example, but no dice. So I need help with the trigger part.

 

Beyond that, I also need help coming up with the script itself.

 

My NPC's in the cell are LVTortureVictim1Ref and LVTortureVictim2Ref which refer to actors named LVTortureVictim1 and LVTortureVictim2 (pretty much the same thing you'll find done in the Dawnstar Sanctuary). The shackles are ShackleWallMarker each set with one of the victims as owner.

 

I looked at TIF_00098B5C.psc which I think is the script that creates the Dawnstar Sanctuary torture room, but I could not figure out how they were creating aliases named Captive1 when nothing in the cell itself has that name.

 

And again, even just copying that bit of script in did me no good as I couldn't get my trigger box to fire off.

 

Anyone have any suggestions on 1) What's wrong with my trigger box, and 2) What my script needs to be so my victims stay shackled.

 

Thanks in advance.

Edited by realXavori
Link to comment
Share on other sites

I haven't looked into this a lot, so I won't be a lot of help, but I can help with one bit. You said you don't know how they could create aliases with those names when there's nothing named that, and that's a simple answer. Aliases (and properties, as well) don't have to have the same name as what they're referencing. The name of what they're referencing plays no role at all in what they are named. Naming them the same as their reference is just a convenience so we mere humans can see at a glance what is going on.

Link to comment
Share on other sites

I haven't looked into this a lot, so I won't be a lot of help, but I can help with one bit. You said you don't know how they could create aliases with those names when there's nothing named that, and that's a simple answer. Aliases (and properties, as well) don't have to have the same name as what they're referencing. The name of what they're referencing plays no role at all in what they are named. Naming them the same as their reference is just a convenience so we mere humans can see at a glance what is going on.

 

Thank you for the reply.

 

So a quick follow up if you don't mind.

 

How then does the engine know which specific actor the script is referring to with the line:

Actor Captive1 = Alias_Captive1.GetReference() as Actor

which gets repeated for each captive?

 

Is it just grabbing a random actor from the cell?

 

Or, another way of asking

How does the game get from DawnstarSanctuaryTortureChamberEnableMarker which is the static in the cell listed in the Creation Kit to TortureCaptivesMarker which is the script that enables that static and turns that part of the sanctuary on?

Link to comment
Share on other sites

I couldn't find a script called TortureCaptivesMarker. In fact, I couldn't find that marker at all. I did find the other marker, though. After a bit of backtracking, I found that the DawnstarSanctuaryTortureChamberEnableMarker is enabled through dialogue. It's in the quest DarkBrotherhoodSanctuaryRepair; Branch -> DBSancMalloryRefitChoicesBranch; Topic -> DBSancMalloryRefitChoice3; top response. The marker is enabled. That marker doesn't use aliases for the captives. It's setup so the captives have that marker set as their enable parent. That means when the marker is enabled, they're enabled; when the marker is disabled, they're disabled.

 

Those same captives are used in that same script fragment via aliases, so I'll assume this is where you're talking about. Those are referencing aliases made by the quest that this dialogue is attached to. The quest is, again, DarkBrotherhoodSanctuaryRepair. The aliases are filled (meaning the captives themselves are chosen for those aliases) in the aliases tab on the quest window.

 

You can see what something is used by if you select it in the render window. It'll also be selected in the cell view. When you right click that object in the Cell View (not the render window), you get the option to see its use info. That's a list of everything that directly references the object. That doesn't include linked references or enable parents/children. Those are denoted by lines drawn on the screen when you click on them instead.

 

So, Actor Captive1 = Alias_Captive1.GetReference() as Actor does this...

Actor tells the engine it's going to receive a variable of type actor. Captive1 is of course the name of that variable. Alias_Captive1 is a property which refers to an alias set in the quest. GetReference() tells the script to get the actor that's inside that reference (the captive in the cell). 'as Actor' makes the script treat the reference it just got as an actor (which works because it actually is an actor).

 

Does that answer you question? It's a bit long winded, but the answer is in there :) If I need to rephrase it because I'm overly complicating it (yes, I am over complicating it a bit), I can do that.

Link to comment
Share on other sites

I couldn't find a script called TortureCaptivesMarker. In fact, I couldn't find that marker at all. I did find the other marker, though. After a bit of backtracking, I found that the DawnstarSanctuaryTortureChamberEnableMarker is enabled through dialogue. It's in the quest DarkBrotherhoodSanctuaryRepair; Branch -> DBSancMalloryRefitChoicesBranch; Topic -> DBSancMalloryRefitChoice3; top response. The marker is enabled. That marker doesn't use aliases for the captives. It's setup so the captives have that marker set as their enable parent. That means when the marker is enabled, they're enabled; when the marker is disabled, they're disabled.

 

Those same captives are used in that same script fragment via aliases, so I'll assume this is where you're talking about. Those are referencing aliases made by the quest that this dialogue is attached to. The quest is, again, DarkBrotherhoodSanctuaryRepair. The aliases are filled (meaning the captives themselves are chosen for those aliases) in the aliases tab on the quest window.

 

You can see what something is used by if you select it in the render window. It'll also be selected in the cell view. When you right click that object in the Cell View (not the render window), you get the option to see its use info. That's a list of everything that directly references the object. That doesn't include linked references or enable parents/children. Those are denoted by lines drawn on the screen when you click on them instead.

 

So, Actor Captive1 = Alias_Captive1.GetReference() as Actor does this...

Actor tells the engine it's going to receive a variable of type actor. Captive1 is of course the name of that variable. Alias_Captive1 is a property which refers to an alias set in the quest. GetReference() tells the script to get the actor that's inside that reference (the captive in the cell). 'as Actor' makes the script treat the reference it just got as an actor (which works because it actually is an actor).

 

Does that answer you question? It's a bit long winded, but the answer is in there :smile: If I need to rephrase it because I'm overly complicating it (yes, I am over complicating it a bit), I can do thaI

 

I was able to follow you. And I'd even found that bit of dialogue in Mallory previously. Just don't know how to pull up the quest information in the CK to see what is going on there.

Anyway, back to my original problem. I still have no idea how to SetRestrained on NPC's when I don't want to use any dialogue boxes or the like. I just want it to happen when the player enter the area where the prisoners are so it all happens behind the scenes. Any suggestions on how to pull that off?

Edited by realXavori
Link to comment
Share on other sites

Another quick question as this has been a good learning experience digging through stuff as people bring it up.

 

How do you open the quest scripts so that I can see the link between the script that enables the torture room and the dialogue choice Mallory gives? I'm thinking this is the missing bit that will show me how Bethesda made the link between actors in a cell and actor aliases in a script that don't ever share a name that would allow the script engine to identify the proper actor.

 

Thanks.

Link to comment
Share on other sites

Quests are opened like other forms such as weapons or spells. In the left pane of the object viewer, expand character, then choose the quest tab.

 

Thank you.

 

Now does someone have an address where I can take a raw salman and go slap the Bethesda coders who thought ti was a good idea to change the name of the object reference in each layer of their scripting :)

Link to comment
Share on other sites

 

However, I cannot keep them shackled. I know I need to use the SetRestrained function to do this, but I have zero experience with scripting and trying to figure out how to trigger it.

 

My first thought was to create a trigger box that ran a script when the player entered, but I can't even get the trigger box example from the CK wiki to work. I created the trigger box. Assigned it the exact script from the example, but no dice. So I need help with the trigger part.

Scriptname MyCoolTriggerScriptThatBetterDoWhatISay extends objectreference

Actor property tortureactor auto
 
Event OnTriggerEnter(Objectreference akActionRef)
     if akActionRef == Game.GetPlayer()
         tortureactor.SetRestrained()
     endif
EndEvent

?

 

And alternative is putting an OnLoad script on the actor.

 

 

Scriptname RestrainedScript extends Actor
 
Event OnLoad()
   self.SetRestrained()
EndEvent

 

I haven't tested the trigger code, but the OnLoad works as intended. For what you want to do you may need different events, but the above how to keep them shackled. You can hit them forever and they wont unshackle.

Edited by Terra Nova
Link to comment
Share on other sites

  • 11 months later...
I have been playing around for about an hour after finding some stuff on google wich helped me a lot. NPC's now stay shackled whatever I throw at them but they won't die.


The only way to make this happen (tested multiple times):

four


1. Copy the ShackleWallMarker from DawnstarSanctuary to your cell.

2. Go to the object window, search and duplicate one of the four NPC's "DBTortureVictim", give it a name and place it.

3. Double click on the NPC, go to the script tab and add the following script to the NPC:

defaultignorefriendlyhits (so the npc wont die)

4. Add a new script to the NPC (right click- new script) and call it "RestrainedScript" - click ok. Right click on the script and select "edit source". Type the following:


Scriptname RestrainedScript extends Actor


Event OnLoad()

self.SetRestrained()

EndEvent


(this will keep the NPC restrained in the shackles)

Click ok.


5. Go to the object window and find "DBTortureVictimPackage" (type "torture" in the filter textbox), duplicate it and rename it. Double click on it and select the package tab. Click once on the reference under "Public Package Data", a button will show up wich says "ShaccleWallMarker is DawnstarSanctuary". Click on that button wich will bring up a window. Click on "Select Reference in Render Window" and select the wallshacklesmarker. You'll see the cell is now named to your cell.


6. Double click your NPC, click on Edit base and go to the "relationships" tab, right click - new - and assign it as follows: Parent NPC - Player, Child NPC (Your NPC), Ally. (The NPC will now be friendly to you and greet you, but this will keep the NPC unhostile)


7. Select the "IA Packages" tab and delete DBTortureVictimPackage. Right click and select Add. Find your duplicated TortureVictimPackage and select it. Ok all.


Once you made the retrestraind script, you can re-use it. The torturevictimpackage has to be made seperatly for every new victim as well as the NPC

Link to comment
Share on other sites

  • Recently Browsing   0 members

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