Jump to content

MatroseFuchs

Administrator
  • Content Сount

    18
  • Joined

  • Last visited

  • Battles

    6

Community Reputation

25 Neutral

1 Follower

About MatroseFuchs

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. MatroseFuchs

    [ModAPI] Documentation

    FlashAPI - StageModule "StageModule" methods allow you to work with "Stage". Available methods: gameAPI.stage gameAPI.stage.addChild(child:displayObject) gameAPI.stage.addChildAt(child:displayObject, index:int) gameAPI.stage.removeChild(child:displayObject) gameAPI.stage.removeChildAt(index:int) gameAPI.stage.width() gameAPI.stage.height() gameAPI.stage.addChild(child:displayObject) It works in a way similar to the "addChild" method, it adds a "displayObject" to the "Stage" to visualize the object. The input argument "child" is a Flash object that is being created. gameAPI.stage.addChildAt(child:displayObject, index:int) Like the "addChildAt" method, it adds a DispalyObject to a certain layer of the Stage.The input arguments: "child" - a Flash object that is being created; index - an indexing number of the layer where a DisplayObject should be added. gameAPI.stage.removeChild(child:displayObject) The method removes a DispalyObject from the Stage.The input argument "child" is a DisplayObject that should be removed from the Stage. gameAPI.stage.removeChildAt(index:int) The method removes the top layer from the Stage. The input argument "index" is an indexing number of the layer where a DisplayObject should be removed. gameAPI.stage.width() The method returns the Stage width. The returned value is a "Number" type of data. gameAPI.stage.height() The method returns the Stage height. The returned value is a "Number" type of data.
  2. MatroseFuchs

    Unbound framework (documentation)

    DataHub 2.0 Binding List DHCollectionRepeatBinding DHCollectionGeneratorBinding DHCollectionBinding DHEntityBinding DHHandleEventBinding DHWatchBinding DHDataRefBinding
  3. MatroseFuchs

    Unbound framework (documentation)

    Bindings Bindings are directives assigning different behavior to elements: synchronization with the data model, tooltip display, drag-and-drop, etc. Bindings are defined as follows: (bind %binding_name% "binding_expression1; binding_expression2; ..."). The binding expressions syntax is a subset of the JS / AS3 syntax as it supports lines, numbers, true, false, null, arithmetical, logical operations, comparison operators, access to array elements via [], access to object properties via . and a ternary operator. Binding expressions are calculated for the current scope (i.e. "player.name" is in fact "scope.player.name"). When an element is instantiated by the framework, a scope object is created automatically where the programmer can enter any data at their own choice. To control data in the scope you may write controllers that will obtain data from the game logic (e.g. via GameInfoHolder), process them and fill the scope with them. public class NewWindowController extends UbController { public var gameInfoHolder:GameInfoHolder; override public function init(... params):void { scope.playerName = ... // grab player name from GameInfoHolder } } For the controller not to be cut by a linker (or whatever this thing is called in SWF's compilation), you need to import it in the main window class and declare a private variable of a corresponding type. When instantiating, necessary variables are injected into controllers – the framework does it for every public field. All public methods of the controller are imported to the scope it is linked to. A controller can be declared as follows: (bind controller "lesta.dialogs.new_window.NewWindowController; arg1; arg2; ...") Calculated arg1, arg2, arg3, ... are passed to the init method of the controller. Frequently used controllers A list of available bindings UbChildBinding UbInstanceBinding UbEventBinding  UbSyncBinding  UbRepeatBinding  UbGeneratorBinding  UbDraggableBinding  UbClikListBinding  UbStyleBinding  UbStyleClassBinding  UbAppearBinding  UbTransitionBinding  UbTooltipBinding  UbSequenceBinding  UbPropertyBinding  UBVariablesBinding  UbCatchEventBinding  UbDispatchBinding  UbDispatchDelayResetBinding  UbChangeDispatchBinding  UbCountdownBinding  UbClockBinding UbContainsBinding UbFileBinding UbEventSequenceBinding UbTimeFormatBinding UbRestrictFeedbackBinding UbIndexOfBinding UBAccountLevelBinding SFMRequestBinding and SFMActionBinding FocusBinding InputMappingBinding UbScopeTraceBinding UbSubstituteBinding UbEventPlaySoundBinding DesignerCollectionBinding ConcatBinding ClipboardBinding ColorTransformBinding SliceBinding ResourceBinding DHCollectionGeneratorBinding GSTimelineBinding WowsResizeBinding UbFadeBinding UbPluralTextBinding UbContextMenuBinding UbBlurLayerBinding, UbBlurMapBinding UbWatchBinding ActionIsDisplayBinding UbRepeatWithScopeHoldBinding UbStageSizeBinding UBClickSplitBinding UbLinearChartBinding UBServerTimeBinding UbFeatureCheckBinding UbGeneratorBinding UbInOutActionBinding UbIMEEnableBinding
  4. Hi, everyone! On the behalf of our development team we'd like to share our gratitude and appreciation to the members of modders program for your continuous efforts in creating mods for World of Warships. Our modding program now a fully distinctive and independent community of proactive, innovative and talented people, whose mods make our game process more interesting and engaging. While our community continues to grow in numbers and ideas, we also try to be ready to provide you with the required tools for your creative work. As a token of our appreciation we've issued special emblem and patch, unique for our respected modders. You'll receive these patch and emblem in next few days. Congrats on your well-deserved tribute, we are looking forward to see more of your great ideas and to developing our future collaboration even further! Best regards,
  5. MatroseFuchs

    ModAPI (discussion)

    All greetings! Unfortunately, the ContentSDK bugfix has moved to version 7.12, so please do not throw out the fixContentSDK utility yet. Peace for everyone
  6. MatroseFuchs

    ModAPI (discussion)

    Update The documentation translated and published:
  7. MatroseFuchs

    [ModAPI] How-To

    Interaction between Python and Flash Let’s take the "Hello World!" mod and look at how its Python and Flash parts interact: Here is a brief explanation: The mod consists of two files Main.py and Main.swf (a compiled file from the ".as" project). As the mod already has a Flash part, the second file (Main.swf) should also be added to the mod folder (!), where Main.py is located. In Main.py, create the event handler "events.onFlashReady" that will report that the Flash file has finished loading and you can transfer information to it. Now let’s pass the line "Hello World!" to Flash using the method "flash.call". At this time, Flash takes our data using the method "gameAPI.data.addCallBack" and passes it to the handler function subscribed to this callback. Then the handler function brings the message to the stage and calls a function in a Python file using the method "gameAPI.data.call", but no data is passed in this case. The Python file gets a call from Flash using the method "flash.addExternalCallback", calls the handler function. And finally, the handler function puts the message about successful work to the log file. Battle Mod Let’s make the task a little more complicated. Let’s try to change the way a certain game effect is displayed. For example, let’s change the way damage from enemy shells is displayed. Let’s show the damage in a different place, set a different color, different font type and see how it works. Development comments: Let’s get our ship’s ID using the method "battle.getPlayersInfo". The method "events.onReceiveShellInfo" will inform us about the event of damage dealt to our ship and pass this information to the handler function. Then the handler function will pass the information to Flash using the same method. And finally, Flash will display the received damage the way we want it. As a result, we got a mod displaying dealt damage in the place defined by us, with the message color and font size we want. In this mod, we set the position above the center, the message is bright red and it is displayed for three seconds if it’s not replaced by another message. PS This mod is just an idea and not the final version. You can use this idea to create your own mod; and maybe it’s your mod that will be included in the official mod pack. Good luck!
  8. MatroseFuchs

    [ModAPI] How-To

    "HelloWorld" Mod on FlashAPI Now let’s create a simple Flash mod. Open the project in the editor (see documentation) and rework the script a bit: Compile the project file and put the resulting "Main.swf" file in the mod folder. Launch the game client to make sure that the mod works.
  9. MatroseFuchs

    [ModAPI] How-To

    "HelloWorld" Mod on PythonAPI Open the "PnFMods" folder created earlier and create a folder for the mod called "HelloWorld". Create a Python file in the mod folder and call it "Main.py". Open the file in the editor and write the first line API_VERSION = 'API_v1.0', this will allow ModAPI to recognize the file as part of the mod. Then write one more line displaying the message "Hello World!". Save changes. Launch the game client, wait until it loads and then close it. Open a "python.log" file in "World_of_Warships\profile\, you will see something like this there:
  10. MatroseFuchs

    [ModAPI] How-To

    The first step to a mod ModsAPI is not active in the client by default. You need to add a "PnFMods" folder to the game directory "World_of_Warships/res_mods/<game_version>" to activate it. Then you need to put an empty Python file "PnFModsLoader.py" to the same directory "World_of_Warships/res_mods/<game_version>": The "PnFMods" folder should contain folders with mods: The simplest case is when a mod consists of just one file: "Main.py". Therefore, the simplest possible mode can be located at: "World_of_Warships/res_mods/<версия_игры>/PnFMods/TestMod/Main.py". ModsAPI consists of two parts, Python and Flash. The Python part is responsible for loading Main.py, and the Flash part loads a specially prepared Main.swf. Python and Flash parts of the mod operate separately from the game client. The provided interface is used to receive and send various data.
  11. MatroseFuchs

    [ModAPI] Documentation

    FlashAPI - DataBridgeModule "Data Bridge Module" methods allow the mod to pass or receive data to/from the Python part of the mod. Available methods: gameAPI.data gameAPI.data.call(methodName:String, params:Array):void gameAPI.data.addCallBack(methodName:String, func:Function):void gameAPI.data.removeCallBack(methodName:String = null, callBack:Function = null):void gameAPI.data.call(methodName:String, params:Array):void The method allows you to pass information to the Python part of the mod. Input parameters: "methodName" – a name, callback key the Python function is subscribed to (in Python - falsh.addExternalCallback(name, func) where "name" corresponds to "methodName") "params" – an array of passed parameters. gameAPI.data.addCallBack(methodName:String, func:Function):void The method adds a callback to get information from Python (in Python - flash.call(name, args)) the Flash function is subscribed to. Input parameters: "methodName" – a name, callback key the function in the Flash part of the mod is subscribed to (Main.swf file) "func" – a callback handler function gameAPI.data.removeCallBack(methodName:String = null, callBack:Function = null):void The method removes a callback the Flash function is subscribed to. Input parameters: "methodName" - callback key the function in the Flash part of the mod is subscribed to (Main.swf file) "callBack" - a callback handler function
  12. MatroseFuchs

    [ModAPI] Documentation

    FlashAPI To create the Flash part of the mod, you need an ActionScript 3 IDE, you can use "FlashDevelop", "Adobe Flash Professional", "Adobe Flash Builder" and other editors. Let’s create a new AS3 project. We call the main file "Main", it will have an extension "*.as” and we add an external SWC library (you can find an updated version in our resources) depending on the selected IDE. (an example of adding it to Flash Builder) Then we rework the script in the "Main.as" file of the project for our mod template. We can create the Flash part of our mod now. As you see, our main class has the basic class "ModBase" contained in the added library, the Flash file of the mod will not work without it.
  13. MatroseFuchs

    [ModAPI] Documentation

    PythonAPI - Devmenu "Devmenu" methods make it possible to use the developer menu. The menu has two buttons: "Constants" - opens / hides a list of some game constants: types of lootboxes, rewards, ribbons and damage "Reload Mod" - reloads the mod Available methods: devmenu devmenu.enable() constants devmenu.enable() After entering the port allows you to call the developer menu. To show/hide the menu by a shortcut "Ctrl" + "F1". The button "Reload Mod" reloads the mod that calls the menu. When calling a menu of several mods, the "Reload Mod" button will reload the last loaded mod that brings up this menu. constants Gives access to the constant value. The value of a specific constant (for example, credits) is obtained in the following way: constants.LootboxType.CREDITS. Returns int() value.
  14. MatroseFuchs

    [ModAPI] Documentation

    PythonAPI - Doc "Dock" methods allow you to get additional game information in the port. Available methods: doc dock.getActiveShipId() dock.getShipInfoById(shipID) dock.getActiveShipId() This function returns the ID of the selected ship. dock.getShipInfoById(shipID) This function returns an object with information about the ship. The input parameter shipID is the ID of the selected ship.
  15. MatroseFuchs

    [ModAPI] Documentation

    PythonAPI - UserMusic "UserMusic" methods allow you to work with ".mp3" audio files. a basic path for a folder with audio files - "World_of_Warships\res_mods\<game_version>\userMusic", a basic folder "userMusic" is created manually, the folder name should be as specified above, otherwise (if a path or folder name is different from the basic one) the path is set by the method "userMusic.setPath" (see the description below) when forming the playlist all files (tuples) on the list are shuffled automatically the playlist is looped; when the track list ends the player gets to the beginning of the list and continues playing tracks playing of the list can be stopped this way: use "userMusic.clearPlaylist()" (described below) in the handler function "SetOnPlayTrackCallback" (described below), the playlist will be cleared, and the player will stop playing when it finishes playing the current track to use your own sound files, flag the checkbox “Use your music” in the sound settings; otherwise the game music and user sound files overlap can result in conflicts and a game client crash Available methods: userMusic events.onPlayTrack(SetOnPlayTrackCallback) userMusic.setPath(path) userMusic.getPlaylist() userMusic.getMediaFileList(path) userMusic.addFiles(filelist) userMusic.removeFiles(idsList) userMusic.clearPlaylist() userMusic.playNext() userMusic.playPrevious() userMusic.play(id) userMusic.activate(state) events.onPlayTrack(SetOnPlayTrackCallback) This event is triggered when an audio file is played. The method takes the handler function "SetOnPlayTrackCallback" that receives an index number of the playing track from the playlist as an input argument "arg". userMusic.setPath(path) The method sets a path to an audio file directory that is different from the basic one.When the basic directory "World_of_Warships\res_mods\<game_version>\userMusic" is present, a new "path" to directory is added to the basic one to search for audio files to be played; added files are shuffled.The input argument is "path", a path to a directory with audio files. userMusic.getPlaylist() The method returns a "list" of "tuples" with various information about "*.mp3" audio files (a path to the file, track name, singer, etc.) that will be played, where a tuple index on the playlist is an audio file index for the player. userMusic.getMediaFileList(path) The method returns a "list" with paths to "*.mp3" audio files. The input argument is "path", a path to an audio file directory. userMusic.addFiles(filelist) The method adds a "list" with paths to "*.mp3" audio files to the main audio file playlist. The input argument is "filelist", a list with paths to audio files. userMusic.removeFiles(idsList) This method removes selected audio files from the playlist (userMusic.getPlaylist).It returns "True/False" if the file was/was not found in the list. The input argument "idsList" is a "list" with IDs of file indexes on the player playlist (starting from 0). userMusic.clearPlaylist() The method clears the audio file playlist (getPlaylist). userMusic.playNext() It plays the next track form the playlist. It can start playing tracks from the second track on the playlist if the method "userMusic.play(id)" is not called; then the "id" basic index is id = 1. userMusic.playPrevious() It plays the previous track form the playlist.It can start playing tracks from Track 0 on the playlist if the method "userMusic.play(id)" is not called; then the "id" basic index is id = 1. userMusic.play(id) The method allows you to play a selected track from the playlist. The input argument "id" is a track index (tuple on the player list), the next track from the list is played, that is, if id = 0 then id = 1 is played if a track with this index is available; if the playlist contains no fewer than two files and this index is not available, then id = 1 is played. userMusic.activate(state) The method activates/deactivates the audio file player. The input argument "state" takes on "True/False" (False is a base value), switching to False does not stop playing.
×