Jump to content
  • Announcements

    • AndalayBay

      Orphan Attachments   07/31/2018

      I have been doing some housekeeping lately and I've noticed that I had a lot of orphaned attachments. Attachments get orphaned when the PM or post is deleted without removing the attachment first. Deleting a PM or post does not delete the attachment and the file or image remain on the server. I'd like to ask all members to go through their attachments and delete any attachments you don't need anymore or those that have been orphaned. Where can I get a list of my attachments? Click on your display name in the upper right corner of the forums and pick "My Attachments" from the drop-down list. How can I tell an attachment is orphaned? If the PM has been deleted, you'll see a message like this in your attachment list: Unfortunately there is no message if the post has been deleted, so please check your old posts. We do purge old birthday threads every once in a while. Also some hosted projects have been shut down, so you may have orphaned attachments on one of those locations. Thanks!
Sign in to follow this  
Leonardo

A map showing map markers when having it in the inventory

Recommended Posts

Just after I released my Skyrim Map Markers mod I got an idea about a similar map marker mod, but I think this is gonna be tricky perhaps impossible to do.

 

Anyway, this picture from the CK show you what I mean and I wonder if it's possible to create a similar map and each marker on the dragon burial mound map will show a map marker on the game map.

 

Dragon Burial Mound Map   CK

The player always need to have this special map in the inventory in order to show all map markers (only the dragon burial mound) on the game map, otherwise only visited map marker on the game map will be shown on the game map.
 
 

What do you think, is it possible? :)

Share this post


Link to post
Share on other sites

If you're asking what I think you're asking, I would do something like run a script on a player alias that checks to see if the player has said item in their inventory, something like GetItemCount, and set the map markers up to an xmarker that disables/enables depending on this factor.

 

So, and I haven't tested this, but I think it would be something like

 

if (Game.GetPlayer().GetItemCount(DragonBurialMap) == 1)
DragonBurialXMarker.Enable()
endIf

if (Game.GetPlayer().GetItemCount(DragonBurialMap) == 0)
DragonBurialXMarker.Disable()
endIf

 

And you would just run that on an alias pointing to the player in a Start Game Enabled quest, of course, including a SEQ file with your esp.

 

You would need to figure something out for the already visited ones.

Edited by Vincent

Share this post


Link to post
Share on other sites

I read the Notes in the GetItemCount section at the official CK-wiki and I find this interesting.

 

 

 

If the argument akItem is a keyword and the object reference is an actor this function will fail to operate properly. A solution is to transfer the contents of the actor's inventory to a container and call the function on that container

Can you explain the purpose of the akItem (I've no idea what this is called since my scripting knowledge is more or less zero)?

Share this post


Link to post
Share on other sites

You can't put a keyword on the player, from my understanding. That's what that is referring to. It doesn't apply to this situation. akItem is just the item you are calling. The map, in this example. Are you familiar with properties when you run a script on something, by the way? Because that's essential knowledge for using scripts.

Edited by Vincent

Share this post


Link to post
Share on other sites

Sadly no, I am not familiar with properties via a script on an item.

 

Just before I read your recent post I got another idea of how to make it work and this is what I was thinking.

 

A script is attached on an item, in this case the map (dragon burial mound map has an unique ID in the CK and replace the vanilla map in-game) in the picture, and the script is just checking if the player has the map in the inventory or not.

 

Am I wrong here?

Share this post


Link to post
Share on other sites

This will tell you everything you need to know regarding properties. Essentially, when you reference something in papyrus like DragonBurialMap from my example above, you need to fill in the property on the object you are attaching the script to, or else it won't do anything.

 

I'm not sure attaching the script to the item itself would actually work, I suppose it might.

Share this post


Link to post
Share on other sites

I read TK's tutorial and I understand very little, but what I did understand was that sometimes an ObjectRefence doesn't need a property.  Does the static MapMarker object in the CK need a property?

Share this post


Link to post
Share on other sites

Correct. If you call it in the script, it needs to have a property associated with it. Papyrus knows nothing until the CK tells it what to know.

 

So the full script from my example would look like this.

Scriptname DragonBurialMap extends ReferenceAlias

MiscObject Property MQ106DragonParchment auto

ObjectReference Property DragonBurialXMarkerRef auto

Event OnItemAdded(Form akBaseItem, int aiItemCount, ObjectReference akItemReference, ObjectReference akSourceContainer)

AddInventoryEventFilter(MQ106DragonParchment)

if (Game.GetPlayer().GetItemCount(MQ106DragonParchment) == 1)

DragonBurialXMarkerRef.Enable()

endIf
endEvent

Event OnItemRemoved(Form akBaseItem, int aiItemCount, ObjectReference akItemReference, ObjectReference akDestContainer)

AddInventoryEventFilter(MQ106DragonParchment)

if (Game.GetPlayer().GetItemCount(MQ106DragonParchment) == 0)

DragonBurialXMarkerRef.Disable()

endIf
endEvent

So from there you would create a quest and tick "Start Game Enabled" and then create a reference alias that points to the player and you would put that script on it. Now in the script properties click "auto fill" and it will automatically find MQ106DragonParchment because that's the actual name of the object. The only other property you would have to add is DragonBurialXMarker as an ObjectReference, and this is the xmarker that you would need to place somewhere in the world. You will have to click the property and then "edit value" then "Pick Reference in Render Window" and locate the xmarker and double click on it with the crosshair that comes up.

 

Once you've done that, you need to set the new xmarker as the enable parent on ALL of the map markers you want to use.

 

Finally, you need to generate an SEQ file so that your start game enabled quest will work. You can easily do this with TES5Edit. Arthmoor explains how to do that here. This is to fix the dialogue bug caused by this. I assume you're not using any dialogue so this isn't really needed, but I would do it anyway.

Edited by Vincent

Share this post


Link to post
Share on other sites

Correct. If you call it in the script, it needs to have a property associated with it. Papyrus knows nothing until the CK tells it what to know.

 

So the full script from my example would look like this.

Scriptname YourScriptNameHere extends Alias

MiscObject Property MQ106DragonParchment auto

ObjectReference Property DragonBurialXMarkar auto

if (Game.GetPlayer().GetItemCount(MQ106DragonParchment) == 1)

DragonBurialXMarker.Enable()

endIf
if (Game.GetPlayer().GetItemCount(MQ106DragonParchment) == 0)

DragonBurialXMarker.Disable()

endIf
So from there you would create a quest and tick "Start Game Enabled" and then create a reference alias that points to the player and you would put that script on it. Now in the script properties click "auto fill" and it will automatically find MQ106DragonParchment because that's the actual name of the object. The only other property you would have to add is DragonBurialXMarker as an ObjectReference, and this is the xmarker that you would need to place somewhere in the world. You will have to click the property and then "edit value" then "Pick Reference in Render Window" and locate the xmarker and double click on it with the crosshair that comes up.

 

Once you've done that, you need to set the new xmarker as the enable parent on ALL of the map markers you want to use.

 

Finally, you need to generate an SEQ file so that your start game enabled quest will work. You can easily do this with TES5Edit. Arthmoor explains how to do that here. This is to fix the dialogue bug caused by this. I assume you're not using any dialogue so this isn't really needed, but I would do it anyway.

We are getting somewhere at least I understand more than I did before I posted this thread.  Very useful, thanks Vincent. :)

 

 

The script could be something like this, if I understood your script correctly.

Scriptname DragonBurialMound extends Alias

MiscObject Property MQ106DragonParchment auto

ObjectReference Location DragonBurialXMarkar auto

if (Game.GetPlayer().GetItemCount(MQ106DragonParchment) == 1)

DragonBurialXMarker.Enable()

endIf
if (Game.GetPlayer().GetItemCount(MQ106DragonParchment) == 0)

DragonBurialXMarker.Disable()

endIf

I assume the DragonBurialXMarker object needs to be added to the game for each cell in the CK or is that static already added and only need some information about the script I've attached to the Dragon Burial Mound Map.

 

Based on what I know about the MapMarker static, when I was working on the Skyrim Map Markers mod, is that the MapMarker have a couple of mini tabs in the CK when adding a new one or editing an existing one.

 

Can I use of one these mini tabs, because I also want to add a "Dragon Mound" icon, the same location "Dragon Lair" icon as it is in vanilla, for each Dragon Burial Mound since I've no idea of how to create a new icon?

Edited by Leonardo

Share this post


Link to post
Share on other sites
The top of the script actually needs to say "Scriptname" and not "DragonBurialMound"

 

DragonBurialXMarker needs to only be added once, to one spot in the world. You will need to add this xmarker and give the object reference the DragonBurialXMarker name so that the script can find it.

 

On the map markers themselves, those mini tabs are needed for this. You will need to go into the one called Enable Parent on each one, and set the parent to DragonBurialXMarker. This will cause the map markers to share enable data with the xmarker, so you don't have to script an enable/disable for each map marker individually.

 

When you refer to mini tabs, are you referring to the tabs that you can click through when you double click on a reference? I'm not sure what you're getting at with using them to add "Dragon Mound" to the same location. I would say just add another map marker there and give it your own data.

Share this post


Link to post
Share on other sites

Ah, I corrected it.  I thought the "Scriptname" needed to be change into what name the script will have then declare a "aaaMapMarker" variable.

 

Well that should be fairly easy since the special Dragon Burial Mound map is gonna be activated in the MQ106 quest, and I think you gave me an idea about a small misc quest to get triggered once the MQ106 quest gets a journal update.

 

So from there you would create a quest and tick "Start Game Enabled" and then create a reference alias that points to the player and you would put that script on it. Now in the script properties click "auto fill" and it will automatically find MQ106DragonParchment because that's the actual name of the object. The only other property you would have to add is DragonBurialXMarker as an ObjectReference, and this is the xmarker that you would need to place somewhere in the world. You will have to click the property and then "edit value" then "Pick Reference in Render Window" and locate the xmarker and double click on it with the crosshair that comes up.

 

Once you've done that, you need to set the new xmarker as the enable parent on ALL of the map markers you want to use.

 

Finally, you need to generate an SEQ file so that your start game enabled quest will work. You can easily do this with TES5Edit. Arthmoor explains how to do that here. This is to fix the dialogue bug caused by this. I assume you're not using any dialogue so this isn't really needed, but I would do it anyway.

 

 

I'm aware of the SEQ file and I've had read Arthmoors dialogue bug fix thread a couple of times in the past.  I once tried to generate a SEQ in Steam and managed to do that, but that was 3-4 years ago.

 

 

Yes, I'm referring to those tabs one need to use when double clicking on a reference.  What I mean is that I know you can use the LocationRef tab and in that tab there is a pull down menu for all known used cells in the CK.

Share this post


Link to post
Share on other sites

One thing I noticed, you changed property to location in the script. That's not a thing and will not work.

Why can't a location work as a property?   I thought location would work if I follow TK's tutorial.

Share this post


Link to post
Share on other sites

Nope. Just when you're writing it in the script, it's 

 

MiscObject Property MQ106DragonParchment auto

 

and not

 

MiscObject Location MQ106DragonParchment auto

Share this post


Link to post
Share on other sites

Nope. Just when you're writing it in the script, it's

 

MiscObject Property MQ106DragonParchment auto

 

and not

 

MiscObject Location MQ106DragonParchment auto

I corrected it.

Scriptname DragonBurialMound extends Alias

MiscObject Property MQ106DragonParchment auto

ObjectReference Property DragonBurialXMarker auto

if (Game.GetPlayer().GetItemCount(MQ106DragonParchment) == 1)

DragonBurialXMarker.Enable()

endIf
if (Game.GetPlayer().GetItemCount(MQ106DragonParchment) == 0)

DragonBurialXMarker.Disable()

endIf

Does the DragonBurialXMarker exist in the CK, I couldn't found it, or do I need to create a new static (I assume the DragonBurialXMarker is a static) or perhaps the DragonBurialXMarker is the same as the MapMarker static?

 

 

The top of the script actually needs to say "Scriptname" and not "DragonBurialMound"
 
DragonBurialXMarker needs to only be added once, to one spot in the world. You will need to add this xmarker and give the object reference the DragonBurialXMarker name so that the script can find it.
 
On the map markers themselves, those mini tabs are needed for this. You will need to go into the one called Enable Parent on each one, and set the parent to DragonBurialXMarker. This will cause the map markers to share enable data with the xmarker, so you don't have to script an enable/disable for each map marker individually.
 
When you refer to mini tabs, are you referring to the tabs that you can click through when you double click on a reference? I'm not sure what you're getting at with using them to add "Dragon Mound" to the same location. I would say just add another map marker there and give it your own data.

So what I need to do next is to place a DragonBurialXMarker in the Kynesgrove's Dragon Burial Mound location and I think that would be in the KynesgroveBurialMound6 exterior cell.

 

Or could this DragonBurialXMarker be placed in the unused E3DemoDragonLair cell (a little south of Whiterun city gate).

 

Then attach the script to the DragonBurialXMarker and place a map marker to every dragon burial mound cell in the CK with the necessary information a map marker needs to have.

Share this post


Link to post
Share on other sites

I've tried a couple of times to get your script compiled in the CK to no avail, but after Kesta at the AFK Mods forum posted this script I dunno what script is the best perhaps both scripts are.

 

However, even if Kesta's script looks complicated I think I understand it while your script sounds logic, but I find the DragonBurialXmarker difficult to understand when fiddling with an object like that in the CK.

 

The MapMarker static I fairly understand, so Kesta's script sounds more easier to get it compiled in the CK as soon I added the script.

Share this post


Link to post
Share on other sites

Does the DragonBurialXMarker exist in the CK, I couldn't found it, or do I need to create a new static (I assume the DragonBurialXMarker is a static) or perhaps the DragonBurialXMarker is the same as the MapMarker static?

DragonBurialXMarker needs to be "created" so to speak. You have to find the xmarker object and place it in the world, and then give that reference the name DragonBurialXMarker.

 

So what I need to do next is to place a DragonBurialXMarker in the Kynesgrove's Dragon Burial Mound location and I think that would be in the KynesgroveBurialMound6 exterior cell.

 

Or could this DragonBurialXMarker be placed in the unused E3DemoDragonLair cell (a little south of Whiterun city gate).

 

Then attach the script to the DragonBurialXMarker and place a map marker to every dragon burial mound cell in the CK with the necessary information a map marker needs to have.

 

It could be placed in either of those locations. It doesn't matter where it is placed.

 

In my example, which again, I said I have not tested, I would put the script on a player alias in a start game enabled quest. Also, you wouldn't be placing new map markers if you want this to interact with the existing ones. You would be using the ones that are already there. The reason I think this is sort of OK is because I don't think there are many mods that are using those objects. Perhaps there are, I don't know.

 

I've tried a couple of times to get your script compiled in the CK to no avail, but after Kesta at the AFK Mods forum posted this script I dunno what script is the best perhaps both scripts are.

 

However, even if Kesta's script looks complicated I think I understand it while your script sounds logic, but I find the DragonBurialXmarker difficult to understand when fiddling with an object like that in the CK.

 

The MapMarker static I fairly understand, so Kesta's script sounds more easier to get it compiled in the CK as soon I added the script.

 

I don't know how he's doing it. That seems overly complicated to me. I think there are multiple ways to accomplish this, and I presented you the way I would have done it. As for why it's not compiling, I will need to know the error you are receiving to help with that.

Share this post


Link to post
Share on other sites

I'm gonna to try to compile the script in the CK and here is the result.

Starting 1 compile threads for 1 files...
Compiling "DragonBurialMap"...
<unknown>(0,0): Unable to find flags file: TESV_Papyrus_Flags.flg
No output generated for DragonBurialMap, compilation failed.

Batch compile of 1 files finished. 0 succeeded, 1 failed.
Failed on DragonBurialMap
Edited by Leonardo

Share this post


Link to post
Share on other sites

OK, that is not related to the script. There is a file called "Scripts.rar" in your Skyrim Data directory, and it needs to be extracted in order for your scripts to compile.

Share this post


Link to post
Share on other sites

Alright, I got the script compiled and the script is this.

Scriptname DragonBurialMound extends Alias

MiscObject Property MQ106DragonParchment auto

ObjectReference Location DragonBurialXMarkar auto

if (Game.GetPlayer().GetItemCount(MQ106DragonParchment) == 1)

DragonBurialXMarker.Enable()

endIf
if (Game.GetPlayer().GetItemCount(MQ106DragonParchment) == 0)

DragonBurialXMarker.Disable()

endIf

I assume my next step would be to add a property in the same way TK did in his tutorial.  Correct?

Share this post


Link to post
Share on other sites

Did you create the quest and mark it as Start Game Enabled? That would be the next step. Then from there you need to create the player alias, put the script on it, and then fill the properties.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×