Jump to content

How to make an ESP refer to things inside another ESP


Bluarchon

Recommended Posts

Couldnt one ESP create a global varible that a 2nd ESP could refer to ?

I am not so familiar with the game engine to know if a ESP created GLOBAL is treated
by the game engine as a true global.

 

Easy enough to test it tho.


EDIT: and idealy, if/when the ESP is removed from game load, be nice if there was a mechanism
that would delete ESP specific globals, even if that mechanism was provided by the mod author to
clean up your game saves.

Edited by Sirropoo
Link to comment
Share on other sites

  • 2 weeks later...

Sorry for not being able to read this thread sooner. Lots of good ideas here.

 

 

Sjogga, on 04 Mar 2013 - 13:58, said:

VectorPlexus, on 04 Mar 2013 - 12:03, said:
not possible, you have to turn the ESP into an ESM

http://www.creationkit.com/Creating_Custom_Master_Files


This is only half true. You don't need to convert it into an actual .esm-file. You do however need to esmify the first mod using Wrye Bash while working on the second mod inside the kit.

@BlueArchon: What is supposed to trigger your second quest to start?

@Sjogga I wanted the second questline to trigger once it detects that the player has already finished the first questline.

 

 

scrivener07, on 04 Mar 2013 - 14:02, said:

VectorPlexus, on 04 Mar 2013 - 12:03, said:
not possible, you have to turn the ESP into an ESM

http://www.creationkit.com/Creating_Custom_Master_Files



Ummm no, Game.GetFormFromFile(int aiFormID, string asFilename)

@scrivener07 This command looks really promising if I make it work haha. What FormID do I pass on the function though? I'm not sure but don't they include a prefix for the load order? And the resulting FormID would be different per user?

 

jet4571, on 04 Mar 2013 - 20:19, said:
He could also make something vanilla a trigger for the second mod, have the first mod disable it then replace by enabling a mod version of the item. the second mod's quest kicks in when the vanilla item becomes disabled.


@jet4571 This is by far the easiest solution to my problem I think. Like finding a rock on the very edge of the map for me to disable. It is a dirty solution but the most practical. I'll see what I can do with it.

 

 

unuroboros, on 04 Mar 2013 - 22:23, said:
You can also use Tes5Edit. You can add masters to an ESP directly from Tes5Edit, I've done it several times to hand-craft my own three-way merge files on Actors or Leveled's. Unfortunately, the disadvantage to this method is that subsequently opening the file in the CK breaks the inheritance, and you'll need to re-do it in Tes5Edit. GetFormFromFile is an option... but I'd really worry about its overhead (disk I/O is a great way to cause blocking).

The best way to make the contents of a script agnostic of the Forms they are working against is Properties.

  • Use a GlobalVariable in the first mod to indicate that quest is complete.
  • In the second mod's script where you are checking for completion, include a GlobalVariable Property. Check for .GetValueInt() == 1 or the like.
  • Now, in your development environment, do ESM-ify the first quest's mod and parent it to the second mod. You don't have to distribute / upload it as an ESM; this is just to make it easier for you to work on in the CK.
  • Finally, point the GlobalVariable Property to the Global in the parent / ESM / first quest.
This could be a little more challenging if your goal is actually to prevent the second ESP from crashing the game even if its dependency (first quest ESP) is missing, but I'm assuming you're enforcing the dependency and just want some reliable way to refer to a Form from the first mod.

@unuroboros I'll try experimenting with this method too. I'm currently conflicted whether enforcing the dependency is such a good idea considering all the issues that come with it should users decide not to play the first one.

Thanks to all you guys for your suggestions! I appreciate all of them!

Edited by Bluarchon
Link to comment
Share on other sites

Couldnt one ESP create a global varible that a 2nd ESP could refer to ?

 

I am not so familiar with the game engine to know if a ESP created GLOBAL is treated

by the game engine as a true global.

 

Easy enough to test it tho.

 

EDIT: and idealy, if/when the ESP is removed from game load, be nice if there was a mechanism

that would delete ESP specific globals, even if that mechanism was provided by the mod author to

clean up your game saves.

 

I haven't played with Globals before and as you said, would they leave trails when users uninstalled the mod? I'll try experimenting with this one too. Thanks mate :)

Link to comment
Share on other sites

 

not possible, you have to turn the ESP into an ESM

 

http://www.creationkit.com/Creating_Custom_Master_Files

This is only half true. You don't need to convert it into an actual .esm-file. You do however need to esmify the first mod using Wrye Bash while working on the second mod inside the kit.

 

@BlueArchon: What is supposed to trigger your second quest to start?

 

You can also use Tes5Edit. You can add masters to an ESP directly from Tes5Edit, I've done it several times to hand-craft my own three-way merge files on Actors or Leveled's. Unfortunately, the disadvantage to this method is that subsequently opening the file in the CK breaks the inheritance, and you'll need to re-do it in Tes5Edit. GetFormFromFile is an option... but I'd really worry about its overhead (disk I/O is a great way to cause blocking).

 

The best way to make the contents of a script agnostic of the Forms they are working against is Properties.

  • Use a GlobalVariable in the first mod to indicate that quest is complete.
  • In the second mod's script where you are checking for completion, include a GlobalVariable Property. Check for .GetValueInt() == 1 or the like.
  • Now, in your development environment, do ESM-ify the first quest's mod and parent it to the second mod. You don't have to distribute / upload it as an ESM; this is just to make it easier for you to work on in the CK.
  • Finally, point the GlobalVariable Property to the Global in the parent / ESM / first quest.

This could be a little more challenging if your goal is actually to prevent the second ESP from crashing the game even if its dependency (first quest ESP) is missing, but I'm assuming you're enforcing the dependency and just want some reliable way to refer to a Form from the first mod.

 

I was totally unware you could "esmify" an ESP without turning it to an ESM (I knew that Wrye Bash had that option, but I just assumed it did the same as described in the CK article)... So I'm guessing I can keep editing an esmified ESP in the CK, instead of having 2 files, right? Thanks for the tip!

 

 

not possible, you have to turn the ESP into an ESM

 

http://www.creationkit.com/Creating_Custom_Master_Files

 

 

Ummm no, Game.GetFormFromFile(int aiFormID, string asFilename)

 

That is a very cool function indeed, but you can only read from forms, not write in them (adding new stuff to FormLists in the target file, for example). Also, it only works if you are not expecting the FormID to be changed, which could cause the 2nd ESP to no longer work, if the first is edited. Thanks for letting me know though, I didnt knew this function =)

Edited by VectorPlexus
Link to comment
Share on other sites

I agree. I read up more on the GetFormFromFile function and I'm positive that this would enable me to accomplish what I needed to do. Also I've read in the CK website that it is possible to add stuff to an existing FormList of another mod. Of course the addition is not permanent (I would think) and that the bit of code to add the stuff in the FormList needs to be run everytime for the 2nd mod to work properly.

; Obtain form 0000ABCD we expect to be added by the KillerBees plugin
; Note the top most byte in the given ID is unused so 0000ABCD works as well as 0400ABCD
FormList beekillerlist = Game.GetFormFromFile(0x0000ABCD, "KillerBees.esp") As FormList
; If "KillerBees.esp" is not loaded the form will be NONE. Otherwise, add our weapon to the list.
if ( beekillerlist )
  beekillerlist.AddForm( WeapBeeSlayer )
endif


And now that I read that the function is not dependent on the load order as you only need to use the lower bits of the FormID. Awesome! Thanks again scrivener07!

Edited by Bluarchon
Link to comment
Share on other sites

  • Recently Browsing   0 members

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