Pyrathas Posted January 25, 2018 Share Posted January 25, 2018 I'm making a player home mod for Evil characters: Thrallmire Keep. The mod starts as a kill Necromancers quest, get Reward, go back, Accept the BYOH quest or refuse the power (fail). There are Prisoners in the Dungeon and a Boss. The Free prisoners are optional but here is the Kicker: Many switches only one frees them the others kill them (failed optional quest) Spawning Undead to swarm your only means of escape (evil laughter). Yes Later on a feature is given where if you killed a unique NPC, you have the option of having their remains brought to the crypt, and you resurrect them as thralls. So you are a Vampire? Great food source. Do you want guards and Servants? Here you go! Now assign them a task. Death is a Release, not a Punishment. Any help with references for coding would be great as I am just learning to code and finally got the Main Mod Questline to work (Aside from the scenes) and the BYOH script to work. I'm trying to set up a scene where you see the Boss reanimate a dead corpse, then he summons undead that is lying on the ground to attack, in one scene, I got the Undead spawn to go on toggle, and the last scene is where the Former Master of the Keep, a Ghost named Micar the Corruptor asks you to rebuild the Keep in exchange for his secrets and the Power of the Keep (BYOH Questline). I can't seem to mirror the Valthume Opening scene... So right now Im trying to make a mod where an NPC when equipping Shackles is restrained and ignores Faction enemies (Player) and when a player flips a switch the NPC is free. Here is what I got so far: I think I fixed it. But I can't compile in CK and yes checked scripts Link to comment Share on other sites More sharing options...
Pyrathas Posted February 2, 2018 Author Share Posted February 2, 2018 Bump Link to comment Share on other sites More sharing options...
Elias555 Posted February 3, 2018 Share Posted February 3, 2018 Where's the script? What's the question? It seems like you just wanted to tell us about your mod. Link to comment Share on other sites More sharing options...
Pyrathas Posted February 4, 2018 Author Share Posted February 4, 2018 ack I thought I added it. Scriptname _PyrTKShackleScript extends ObjectReferenceObjectReference property Lever autoObjectReference Property BadLever AutoObjectReference property Shackle autoObjectReference Property Trap AutoObjectReference property akactivator autoQuest Property _PyrTKQuest01 AutoActor Property akActor AutoInt LeverPosition = 1Int LeverPositionOldbool property beenActivated auto hidden Function SetRestrained(bool shouldBeRestrained)Self.SetRestrained(shouldBeRestrained)EndFunction Function SetDefaultState(ObjectReference Akactivator) If (LeverPosition == 1) PlayAnimation("PullUp") elseif (LeverPosition == -1) PlayAnimation("PushUp") endif LeverPositionOld = LeverPosition LeverPosition = 0 if Akactivator == Lever UnlockShackle() elseif Akactivator == BadLever ActivateTrap()endifEndFunctionFunction UnlockShackle()if akactivator == Lever If (LeverPosition == -1) Shackle.SetOpen() self.SetRestrained(false) if _PyrTKQuest01.IsRunning() if (_PyrTKQuest01.GetStageDone(30)) _pyrTKQuest01.SetObjectiveCompleted(55)endifendifendifendifEndFunctionFunction ActivateTrap() if (LeverPosition == -1) trap.enable() if _PyrTKQuest01.IsRunning() if (_PyrTKQuest01.GetStageDone(30)) if akActor.IsEssential() akActor.KillEssential() _PyrTKQuest01.SetObjectiveFailed(55) endif endif endif elseif(LeverPosition == 1) Trap.IsDisabled()endifEndFunction Event OnSit(ObjectReference furniture) Self.SetRestrained(True)EndEvent Event OnLoad() self.SetRestrained(True)EndEvent EVENT onActivate(objectReference akActivatingRef) if akActivatingRef == BadLever !beenActivated beenActivated = TRUE ActivateTrap() elseif akActivatingRef == Lever !beenActivated beenActivated = TRUE UnlockShackle() endifEndEvent I'm trying to make a quest where the NPC (akactor) stays on the shackle and the Player has to choose which switch (lever) releases him and which switch kills him (badlever), If he dies the objective failed if he lives the objective succeeds. I have more than one hostage and I am trying to use all of them with one switch. But first I want to get the one working, and second I do not know how to reference every NPC in game that activates it. When released they have a package where they "escape" the lair. But I do not know how to do activate an AI package on a script. I've searched the CK wiki for it. I also want to try and make it where the levers are used to release or torture prisoners in the game (I am making it where you can resurrect NPCs you killed to torture but I haven't started that yet) after the quest is complete. That would be easy. just remove the Kill scripts). Link to comment Share on other sites More sharing options...
Pyrathas Posted February 4, 2018 Author Share Posted February 4, 2018 I guess what Im asking is where am I going wrong. It compiles but in my test cell it doesn't work the NPC attacks, and the traps don't kill or release Link to comment Share on other sites More sharing options...
foamyesque Posted February 5, 2018 Share Posted February 5, 2018 First check: Are the properties filled? Link to comment Share on other sites More sharing options...
IsharaMeradin Posted February 5, 2018 Share Posted February 5, 2018 Here is one problem: EVENT onActivate(objectReference akActivatingRef) if akActivatingRef == BadLever !beenActivated beenActivated = TRUE ActivateTrap() elseif akActivatingRef == Lever !beenActivated beenActivated = TRUE UnlockShackle() endif EndEvent In the OnActivate event the passed in variable akActivatingRef (akActionRef in stock scripts) is the object reference that activated the object holding the script. In otherwords, you are comparing the player or an NPC to your levers. They obviously don't match and thus halts the script. Link to comment Share on other sites More sharing options...
Pyrathas Posted February 5, 2018 Author Share Posted February 5, 2018 Here is one problem: EVENT onActivate(objectReference akActivatingRef) if akActivatingRef == BadLever !beenActivated beenActivated = TRUE ActivateTrap() elseif akActivatingRef == Lever !beenActivated beenActivated = TRUE UnlockShackle() endif EndEvent In the OnActivate event the passed in variable akActivatingRef (akActionRef in stock scripts) is the object reference that activated the object holding the script. In otherwords, you are comparing the player or an NPC to your levers. They obviously don't match and thus halts the script.So it should be akActionRef? Link to comment Share on other sites More sharing options...
Pyrathas Posted February 5, 2018 Author Share Posted February 5, 2018 First check: Are the properties filled?Yes they are all filled Link to comment Share on other sites More sharing options...
IsharaMeradin Posted February 5, 2018 Share Posted February 5, 2018 Here is one problem: EVENT onActivate(objectReference akActivatingRef) if akActivatingRef == BadLever !beenActivated beenActivated = TRUE ActivateTrap() elseif akActivatingRef == Lever !beenActivated beenActivated = TRUE UnlockShackle() endif EndEvent In the OnActivate event the passed in variable akActivatingRef (akActionRef in stock scripts) is the object reference that activated the object holding the script. In otherwords, you are comparing the player or an NPC to your levers. They obviously don't match and thus halts the script.So it should be akActionRef?Doesn't matter if you call the variable akActionRef, akActivatingRef, or TheGuyWhoYankedTheLever. The problem is that the variable contains the object reference of the actor that activated the activator. To break it down, your script is basically saying this: If the player character is the same thing as this lever then do this stuff otherwise do nothing.The result is, your script does nothing. If the script is on the lever(s), try comparing to self instead. i.e. If self == lever ;do stuff EndIf Link to comment Share on other sites More sharing options...
Recommended Posts