Difference between revisions of "Arcane University:Custom Map Marker Implementation"

The Beyond Skyrim Wiki — Hosted by UESP
Jump to: navigation, search
(Getting Your Vectors Ready)
m (Applying your new Marker in xEditor: xEdit not xEditor)
 
(5 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 +
{{Trail|Implementation}}
 
Guide to Implement Map Markers with Flash.
 
Guide to Implement Map Markers with Flash.
 +
 +
= Beyond Skyrim Map Marker Implementation =
 +
 +
== Prerequisites ==
 +
* [https://github.com/jindrapetrik/jpexs-decompiler/releases JPEXS Decompiler]
 +
* svg file with your icon
 +
* Map marker index from [https://docs.google.com/spreadsheets/d/1K-eTmgJRDbMdf8bKDfGHTDfKAlbm8yyrSK-tJmBa1BQ/edit?usp=sharing here]
 +
 +
== Process - for skyui/mapmarkerart.swf and hudmenu.swf ==
 +
* Open the file with JPEXS Decompiler
 +
* Expand shapes
 +
* Right click the shape with your marker index and select Replace - Update Bounds
 +
* Select your icon
 +
* Make sure there is no error (in the bottom right should be a green checkbox - if it is not green, click it and fix the issue)
 +
* Repeat this for the undiscovered marker
 +
* Save
 +
 +
== Add the map markers to Skyrim ==
 +
* Open your map marker in xEdit (they are usually in the persistent worldspace cell)
 +
* Change Map Marker\TNAM to your map marker index
 +
 +
= General Custom Map Marker Implementation =
  
 
== Prerequisites ==
 
== Prerequisites ==
Line 40: Line 63:
 
This step is similar to step 2, This time in the library look for a MovieClip called “CompassMarker_mc” and try and understand the clip. This is a little different to the map marker art, this has some markers which are not in the map marker array at the beginning of the keyframe, so add four to your index, (eg: if your index is 24, do 24 + 4 and there is your new index for this file). Repeat the following, and implement your marker at the correct index, compile the file, and insert it in Data/Interface.  
 
This step is similar to step 2, This time in the library look for a MovieClip called “CompassMarker_mc” and try and understand the clip. This is a little different to the map marker art, this has some markers which are not in the map marker array at the beginning of the keyframe, so add four to your index, (eg: if your index is 24, do 24 + 4 and there is your new index for this file). Repeat the following, and implement your marker at the correct index, compile the file, and insert it in Data/Interface.  
  
=== Applying your new Marker in xEditor ===
+
=== Applying your new Marker in xEdit ===
 
When you have added your marker, you can now apply it to a map marker in xEdit. Look for the map marker you would like to change, and then change the current type by typing your markers index in. For example, this should end up displaying something like “Custom 95”. Save your plugin and launch your game. If all is successful, your new marker should be in-game.
 
When you have added your marker, you can now apply it to a map marker in xEdit. Look for the map marker you would like to change, and then change the current type by typing your markers index in. For example, this should end up displaying something like “Custom 95”. Save your plugin and launch your game. If all is successful, your new marker should be in-game.
  
Line 50: Line 73:
 
*'''Q:''' ''Your tutorial sucks and I could do with some assistance.''
 
*'''Q:''' ''Your tutorial sucks and I could do with some assistance.''
 
**'''A:''' I fully understand if my tutorial sucks, try and contacting me on discord: Greavesy#9357.
 
**'''A:''' I fully understand if my tutorial sucks, try and contacting me on discord: Greavesy#9357.
 +
 +
== Adding Custom Music Stinger to Map Marker ==
 +
For custom discovery sounds, every team makes a keyword per discovery sound and adds it in BSAssets. Add each stinger to MUSDiscoverGeneric in BSAssets and condition them so they play if the player is in a cell with a location that's marked with a keyword that’s specific to the stinger. Every team can now implement custom map markers with sounds by setting the necessary location keywords, up to 1 custom map marker type per location.
  
  
[[Category:Arcane University]] [[Category:Asset_Tutorial]]
+
[[Category:Asset_Tutorial]]

Latest revision as of 21:51, 27 November 2022

< Arcane University:Implementation

Guide to Implement Map Markers with Flash.

Beyond Skyrim Map Marker Implementation[edit]

Prerequisites[edit]

Process - for skyui/mapmarkerart.swf and hudmenu.swf[edit]

  • Open the file with JPEXS Decompiler
  • Expand shapes
  • Right click the shape with your marker index and select Replace - Update Bounds
  • Select your icon
  • Make sure there is no error (in the bottom right should be a green checkbox - if it is not green, click it and fix the issue)
  • Repeat this for the undiscovered marker
  • Save

Add the map markers to Skyrim[edit]

  • Open your map marker in xEdit (they are usually in the persistent worldspace cell)
  • Change Map Marker\TNAM to your map marker index

General Custom Map Marker Implementation[edit]

Prerequisites[edit]

  • Source files of the following UI files:
    • MapMarkerArt.swf
    • MapMenu.swf
    • HudMenu.swf
  • Adobe Flash CS5 OR Adobe Flash CS6.
  • Minor ActionScript 2 knowledge.
  • Lots of time.
  • Minor understanding of Flash’s keyframe system.
  • Knowledge of Adobe Illustrator OR other programs which can export .ai or .SVGs.
  • A copy of the Skyrim UI and SkyUI source files found here and here respectively.

Introduction[edit]

Skyrim’s map marker system is quite easy to understand, yet a pain to implement new map markers simply because of how Bethesda implemented the system. When implementing new markers, you need to implement them in both HudMenu.swf and MapMarkerArt.swf, which is a SkyUI file. If you want to edit the vanilla map markers, then you can simply look for the art in MapMenu.swf and work off it instead of the SkyUI file. The known maximum limit is 255; anything above that is not read by the game and skipped. The markers are stored in two large arrays; one for “Discovered” markers and the other for “Undiscovered” markers. The aim is to assign our marker an “index”, and then fill that slot with our marker in the UI files so they display in-game. In xEdit, you might have noticed that when selecting the type of marker, you can insert a number rather than select an already existing type of marker. This becomes extremely handy later on in the guide.

Setting up the workspace: (For Beyond Skyrim Users looking to add more)[edit]

Once you have the two sources from GitHub, you’ll need this so you can add new map markers that will work alongside other map markers from other “Beyond Skyrim” projects. From the archive, make sure the contents of “SkyrimUI/src” are in the source folders “SkyrimUI/src”. Do the same for folder “SkyUI/src”, but instead place it in “SkyUI/src”. This should help when it comes to building.

Getting Your Vectors Ready[edit]

To begin with, your vector can either be drawn up in Illustrator or Flash, both results can be utilized. When exporting out of illustrator, make sure you export the .ai as “CS5/CS6” format or Adobe Flash will not accept the file. For flash, make sure you can import it into the flash document when ready. The marker can either be saved as a flash document or already stored as a Movie Clip.

Adding the Name[edit]

Even after a few years of doing this process, I am still not sure if this is used. However, the game uses the size of the array to set up the map markers later in the process. The Map source files should have another child directory named “Map”, and then an ActionScript file called “MapMarker.as”. Open this file and make yourself comfortable with the layout. The array you need to edit is called “ICON_MAP” and the naming convention is usually “MarkerName”, followed by “Marker”, for example, “MyAwesomeMarker” (See Figure 1 on the next page). It is best to keep this name saved somewhere for later. If you are using the files for “Beyond Skyrim”, there is lots of space below the current markers and starts at index 90. Once this is complete, you will need to recompile the MapMenu.swf and insert it into your “Data/interface” folder. If you do not know how to recompile a flash document, please google it. MM1.PNG

  • Figure 1: The array which stores marker names and which you need to edit.

Adding it to MapMarkerArt.swf[edit]

MM2.PNG

  • Figure 2: The timeline, this is where the magic happens.

In the library, look for a MovieClip called “MapMarkerArt”. Open it up and look around and try and understand how it works. Each keyframe in the timeline is each “Discovered” map marker in the game, and this specific file has already been modified to store as many markers as possible, so all you must do is replace the marker at the given index. To figure out the index of your new marker, there are two ways. Either count every element in the array, starting from zero, and when you reach your marker, you have your index. Or, you just have a big fat guess and hope it’s correct. To import your marker art into flash, select File > Import to Library and then select your illustrator or SVG document. Proceed through the importing steps and hope it comes out okay. This should be basic flash stuff to insert it into the keyframe, so I will skip ahead to the next step. When this step is complete, compile “MapMarkerArt.swf” and insert it into data/interface/skyui”

Adding it to HudMenu.swf[edit]

This step is similar to step 2, This time in the library look for a MovieClip called “CompassMarker_mc” and try and understand the clip. This is a little different to the map marker art, this has some markers which are not in the map marker array at the beginning of the keyframe, so add four to your index, (eg: if your index is 24, do 24 + 4 and there is your new index for this file). Repeat the following, and implement your marker at the correct index, compile the file, and insert it in Data/Interface.

Applying your new Marker in xEdit[edit]

When you have added your marker, you can now apply it to a map marker in xEdit. Look for the map marker you would like to change, and then change the current type by typing your markers index in. For example, this should end up displaying something like “Custom 95”. Save your plugin and launch your game. If all is successful, your new marker should be in-game.

Troubleshooting[edit]

  • Q: My marker isn’t correct on the MapMenu/HudMenu, it’s invisible or a circle dot!
    • A: This means you need to look back in flash and make sure your marker is in the correct slot. If you want to make sure your marker is working in-game, replace the dot with your new marker and relaunch your game. If your marker is working, try and play around with the keyframes surrounding your index.
  • Q: My game crashes on loading or none of the menus are loading!
    • A: This usually means compiling one of the menus has resulted in tons of errors and will not work in-game. You need to fix these compilation errors before testing your marker.
  • Q: Your tutorial sucks and I could do with some assistance.
    • A: I fully understand if my tutorial sucks, try and contacting me on discord: Greavesy#9357.

Adding Custom Music Stinger to Map Marker[edit]

For custom discovery sounds, every team makes a keyword per discovery sound and adds it in BSAssets. Add each stinger to MUSDiscoverGeneric in BSAssets and condition them so they play if the player is in a cell with a location that's marked with a keyword that’s specific to the stinger. Every team can now implement custom map markers with sounds by setting the necessary location keywords, up to 1 custom map marker type per location.