9zAZO Posted July 21, 2021 Share Posted July 21, 2021 So... once again, I'm going crazy with minimal scripting.Everything left to do for a mod I have is the scripting part. All I need to do is enabling an initially disabled XMarker, with all its children objects, to enable upon the death of two specific npcs.I have no clue to how are you supposed to do it.Thanks in advance on who can help me here. Link to comment Share on other sites More sharing options...
mixxa77 Posted July 21, 2021 Share Posted July 21, 2021 (edited) Multiple ways to do this. One could be: Create two new scripts for each NPC like this: Begin OnDeath if otherNPCRef.getdead == 1 MyXMarkerRef.enable endif EndYou could also use otherNPC.getdeadcount > 0 if you fancy that more. This method works best if the NPCs are supposed to be killed by the player or during his presence. If they can or are supposed to die "off-screen" then another method using a quest script would be better. Edited July 21, 2021 by mixxa77 Link to comment Share on other sites More sharing options...
9zAZO Posted July 21, 2021 Author Share Posted July 21, 2021 Multiple ways to do this. One could be: Create two new scripts for each NPC like this: Begin OnDeath if otherNPCRef.getdead == 1 MyXMarkerRef.enable endif EndYou could also use otherNPC.getdeadcount > 0 if you fancy that more. This method works best if the NPCs are supposed to be killed by the player or during his presence. If they can or are supposed to die "off-screen" then another method using a quest script would be better.I was trying to make something like that work, but while writing it I had a very stupid but haunting questionDoes the script fail to load on other player's systems due to how the esp load order work?Meaning if the ref id has the 01 digits at the start, so on my script I write the 01 too, do those two digits can change on other people's system, if the esp load order is for example set to a 6a digit, thus making the script useless? I hope I made myself clear enough Link to comment Share on other sites More sharing options...
mixxa77 Posted July 21, 2021 Share Posted July 21, 2021 (edited) A fair question. If that is an issue, then it is being solved or circumvented by doing it the human way: Using names instead of numbers. You can give references unique names of your choosing, you do so this way: Double click a world reference (your XMarker or the NPCs) and enter a custom "Reference Editor ID" of your choosing (It is one of the few fields you can edit when double-clicking a reference). This name has to be unique, so be creative, like "Mixxa77ModnameFlaviusHonoriusREF". The only thing that matters is that it's unique and at best descriptive for you to easily remember. You can then use these reference "names" in your scripts instead of their IDs. Edited July 21, 2021 by mixxa77 Link to comment Share on other sites More sharing options...
9zAZO Posted July 21, 2021 Author Share Posted July 21, 2021 (edited) A fair question. If that is an issue, then it is being solved or circumvented by doing it the human way: Using names instead of numbers. You can give references unique names of your choosing, you do so this way: Double click a world reference (your XMarker or the NPCs) and enter a custom "Reference Editor ID" of your choosing (It is one of the few fields you can edit when double-clicking a reference). This name has to be unique, so be creative, like "Mixxa77ModnameFlaviusHonoriusREF". The only thing that matters is that it's unique and at best descriptive for you to easily remember. You can then use these reference "names" in your scripts instead of their IDs.I seem to be having a problem here: i can't seem to make the scripts work I written the two scripts as follow | ScriptName AAAEnableNecroShack BeginOnDeath if AAALouiseDelacroix.getdead == 1AAANecroShackEnabler.enable endifEnd ----------- ScriptName AAANecroShackEnable2 BeginOnDeath if AAAAlkasAyorus.getdead == 1AAANecroShackEnabler.enable endifEnd | Both the scripts are set to object and assigned to the NPC with the opposite name, but when I do the testings and kill them both, the objects do not appear, but can be forced to appear through the use of Console Commands. I have no idea what is the problem here, and i've spent almost two hours trying to figure this out :sad: Edited July 21, 2021 by 9zAZO Link to comment Share on other sites More sharing options...
mixxa77 Posted July 22, 2021 Share Posted July 22, 2021 Such is the fun of troubleshooting and testing. Then we have to go a different way. Another possible way would be to use the same script for both NPCs that reads: Begin GameMode if NPC1.geatdead == 1 && NPC2.getdead == 1 MyXMarker.enable endif End If that also doesn't work, a questscript would probably be needed. For such, create a new quest with the "Enabled at game start" flag checked and attach a questscript to it that reads the following (Same as above): Begin GameMode if NPC1.geatdead == 1 && NPC2.getdead == 1 MyXMarker.enable StopQuest MyNewQuest endif EndIf you have any questions about the questscript approach or it's (supposed) workings, feel free to ask. The issue might also just be a need for a cell change? Maybe the linked items will only enable properly when the cell is loaded again. Link to comment Share on other sites More sharing options...
qwertyasdfgh Posted July 22, 2021 Share Posted July 22, 2021 I suspect the issue here might be that GetDead should be called on a reference. Don't know for sure, but NPC ids from above look like they might be for a base object. Link to comment Share on other sites More sharing options...
mythlessninja Posted July 22, 2021 Share Posted July 22, 2021 (edited) Hey, I am bad at scripting but maybe instead gamemode script from a hidden quest, make a result script on hidden quest that will execute once for better performance(im not sure how fragile oblivion is)? on both targetsbegin OnDeath if getstage questenabler < 10 setstage questenabler 10else setstage questenabler 20endif and on quest stage 20 something.enableStopquest questenabler But i haven't done something like this so idk if it would work. Edited July 22, 2021 by mythlessninja Link to comment Share on other sites More sharing options...
9zAZO Posted July 24, 2021 Author Share Posted July 24, 2021 I decided to reduce the required npcs to one, remove the if statement and go with the Begin on Death function on the single npcTested out and it's working, so I'm taking the easy route on this XDThanks for the help ;) Link to comment Share on other sites More sharing options...
Recommended Posts