60fpshacksrock Posted March 29, 2023 Share Posted March 29, 2023 (edited) (Edit: My apologies for the typos) Here is the script from a mod in quotation marks: "scn aaaaaDeathScript begin ScriptEffectStartif aaaaaCheatsEnabled == 1killendifend" I am looking to add "setessential 0" to it but it gives me this: "Script 'aaaaaDea'd‘nScript', line 5:Non-persistent reference '0' cannot be used in a script." then this: "Scn'pt 'aaaaaDeathScript‘, line 5:Item '0' not found for parameter Actor Base.Compiled script not saved!" I know it wants an NPC ID but it accepts the kill command without issue. Edited March 29, 2023 by 60fpshacksrock Link to comment Share on other sites More sharing options...
RomanR Posted March 30, 2023 Share Posted March 30, 2023 (edited) Set Essential is working only with base objects, so you should fill some ref variable first or use SetRefEssential command. scn aaaaaDeathScript ... ref target ... begin ScriptEffectStart set target to GetSelf if target != 0 && aaaaaCheatsEnabled == 1 SetEssential target 0 kill ;kill is working with references, so you can use it like this endif end or scn aaaaaDeathScript ... begin ScriptEffectStart if aaaaaCheatsEnabled == 1 SetRefEssential 0 Kill endif end According to wiki, SetRefEssential makes change in base object too, so if you have 10 copies of your NPC in the world, all will become essential. Edited March 30, 2023 by RomanR Link to comment Share on other sites More sharing options...
60fpshacksrock Posted March 31, 2023 Author Share Posted March 31, 2023 It accepts the bottom script you posted but now it does nothing. It won't even work on non-essential npc's. This is the mod here: https://www.nexusmods.com/oblivion/mods/44129 I do not take credit for it either. The main reason I wanted this mod was to unlock locks that require keys . But the "silent death" I would like to extend to include essential npc's as well. Link to comment Share on other sites More sharing options...
RomanR Posted March 31, 2023 Share Posted March 31, 2023 (edited) That's quite weird. As I tested the second approach with this script scn RomRKillSpellScript short ess begin ScriptEffectStart set ess to IsEssential if ess != 0 SetRefEssential 0 Message "Some actors were robbed of essential status." ;only as a debug message endif kill end and I found it working without problems. But with first post I found that SetEssential command seems truly working as return after execution in this case, so the rest of script was ignored. Edited March 31, 2023 by RomanR Link to comment Share on other sites More sharing options...
60fpshacksrock Posted March 31, 2023 Author Share Posted March 31, 2023 (edited) That's quite weird. As I tested the second approach with this script scn RomRKillSpellScript short ess begin ScriptEffectStart set ess to IsEssential if ess != 0 SetRefEssential 0 Message "Some actors were robbed of essential status." ;only as a debug message endif kill end and I found it working without problems. But with first post I found that SetEssential command seems truly working as return after execution in this case, so the rest of script was ignored. It gives me this when I tried the new one you posted: Script 'RomRiGllSpellScript‘, line 7:Script command 'SetRefEssential' not found. Edited March 31, 2023 by 60fpshacksrock Link to comment Share on other sites More sharing options...
RomanR Posted March 31, 2023 Share Posted March 31, 2023 (edited) SetRefEssential is an OBSE command. I completely forgot about this, I'm sorry. Unfortunately without OBSE you will be stuck here, as wiki mentions that using SetEssential command with ref variable will act as return and so it makes my first posted script meaningless. Maybe someone more experienced using this command can give some insight, how to solve this without OBSE. Edit: But didn't you wrote that the bottom script of my first post was accepted, which contains SetRefEssential too? Edited March 31, 2023 by RomanR Link to comment Share on other sites More sharing options...
60fpshacksrock Posted April 1, 2023 Author Share Posted April 1, 2023 SetRefEssential is an OBSE command. I completely forgot about this, I'm sorry. Unfortunately without OBSE you will be stuck here, as wiki mentions that using SetEssential command with ref variable will act as return and so it makes my first posted script meaningless. Maybe someone more experienced using this command can give some insight, how to solve this without OBSE. Edit: But didn't you wrote that the bottom script of my first post was accepted, which contains SetRefEssential too? It does. But it has no effect. I do in fact use OBSE, but I am trying to make it work without it. Link to comment Share on other sites More sharing options...
RomanR Posted April 1, 2023 Share Posted April 1, 2023 Vanilla Oblivion to my knowledge doesn't have function to get base object from reference, so OBSE is only solution. In the meantime I made change to RomRKillSpellScript and now it looks like this: scn RomRKillSpellScript2 short ess ref actor begin ScriptEffectStart set actor to GetBaseObject set ess to IsEssential if ess != 0 && actor != 0 SetEssential actor 0 print "Actor:"+$actor+" Essential status:"+$ess ;debug message printed to console Message "Some actors were robbed of essential status." endif kill end Now it uses OBSE function GetBaseObject to get base object form target and so SetEssential command now works. As GetBaseObject is basic OBSE function, failing to compile this script could mean that OBSE isn't working in your editor. Print is OBSE command too. Link to comment Share on other sites More sharing options...
60fpshacksrock Posted April 2, 2023 Author Share Posted April 2, 2023 I am not sure how to load obse in the editor. I am not new to modding, as I have made a few changes to scripts (Oblivion) or npc's (Skyrim) but I am no expert. Link to comment Share on other sites More sharing options...
RomanR Posted April 2, 2023 Share Posted April 2, 2023 For standard Construction Set execute obse_loader.exe with parameter -editor. Best is to make a shortcut. Sorry for a quality, I wanted to be a file size of picture as small as possible. My Win is in Czech, but I hope it will still help you. If you use some Constructon Set replacement (CS Extender etc.), consult its documentation how to start it with OBSE. Link to comment Share on other sites More sharing options...
Recommended Posts