Skip to content

Change log

McHorse edited this page Oct 8, 2021 · 1 revision

This document covers technical changes made to Mappet over testing periods so that you could have an insight of what was added, changed, fixed and most importantly broken in between dev-builds.

When updating, make sure to ⚠ BACKUP ⚠ your worlds!

0.1 to 0.1.1

  • Added IScriptServer.getPlayer(String) scripting method
  • Added Expression condition block (where you can check against arbitrary expression)
  • Added skip if completed option for quest dialogue nodes
  • Fixed crashes when selecting an empty morph in some places within Mappet dashboard panels
  • Fixed condition and and or labels showing the incorrect value (it showed previous' or mode instead of current's)
  • Fixed server side crash on start up due to scripts

-rc5 to 0.1

🔨 Breaking changes

There are none that are known.

🥵 New features

  • Added new scripting methods:
    • Added IScriptBlockState.isAir()
    • Added IScriptWorld.hasTileEntity(int, int, int) and IScriptWorld.getTileEntity(int, int, int)
    • Added IScriptTileEntity, which allows to work with a tile entity
    • Added IScriptEvent.getPlayer() and IScriptEvent.getNPC()
    • Added IScriptItemStack.setCount(int) and IScriptItemStack.setMeta(int)
  • Added expression parsing (${...}) to state objective messages
  • Added On close trigger for dialogues

💡 QoL

  • Added any entity for for commands that accept only players or server (i.e. /mp script exec, /mp event trigger, etc.)
  • Added Once toggle to region block (under write states), which allows to make region block work only once
  • Added multi-line fields to dialogue reaction and reply nodes
  • Added saving of the scrolled position in the script editor
  • Added keybind to toggle word wrap in script editor (Ctrl + P)

🩹 Fixes

  • Fixed morph trigger block to work with NPCs
  • Fixed objective message can't be longer than 40 characters (increased limit to 1000 characters)

-rc4 to -rc5

🔨 Breaking changes

List below of breaking changes:

  • If you already used UIComponent.marginBotom() function for UI components, rename all .marginBotom() calls to .marginBottom() (two ts instead of one)
  • Some global trigger IDs were changed internally, I did put a backward compatibility system in place with triggers mentioned below, however, I can't 100% guarantee this, so if that system fails then you'll have to setup those triggers again

🥵 New features

  • Added world morphs feature which allows using commands or scripting to add temporary client side morphs for visual effects:
    • Added /mp morph add entity <target> <expiration> <rotate> <x> <y> <z> <yaw> <pitch> <morph> command that spawns
    • Added /mp morph add world <expiration> <x> <y> <z> <yaw> <pitch> <morph> command
    • Added IScriptEntity.displayMorph() and IScriptWorld.displayMorph() (these two methods have multiple method variants)
  • Added new scripting methods:
    • Added IScriptPlayer.setXp(int, int), IScriptPlayer.addXp(int), IScriptPlayer.getXpLevel(), and IScriptPlayer.getXpPoints() which allow to access player's experience
    • Added IScriptEntity.setFallDistance(float) and IScriptEntity.getFallDistance() which allow to access entity's fall distance (you can reset fall damage when teleporting using .setFallDistance(0)
    • Added IScriptEntity.swingArm(int) to trigger entity's arm hitting animation
    • Added IScriptEntity.getWidth() and IScriptEntity.getHeight() to query entity's hitbox size
    • Added Graphic.hoverOnly() which allows to make graphic appear only when mouse cursor is within graphic's bounding box
    • Added IScriptEntity.damageAs(IScriptEntity, float) and IScriptEntity.damageWithItemsAs(IScriptPlayer) to damage entities using other entities as context (i.e. allowing to agro mobs, apply enchantment effects, etc.)
    • Added IScriptPlayer.playSound(String, double, double, double, float, float) to play sound event only to specific person
    • Added IScriptPlayer.playRelativeSound(String, float, float) to play sound event without position in the world
    • Added IScriptPlayer.setupHUD(String), IScriptPlayer.changeHUDMorph(String, int, AbstractMorph), IScriptPlayer.changeHUDMorph(String, int, INBTCompound), IScriptPlayer.closeAllHUD(), and IScriptPlayer.closeHUD(String) to manage HUD scenes through scripting API
  • Added new global triggers:
    • Added player respawn trigger
    • Added entity death trigger
    • Added left click block trigger (works only for survival mode left clicks)
  • Changed context's data being copied when scheduling scripts rather than getting linked

💡 QoL

  • Added tooltip to Edit triggers... button that shows how many triggers are present
  • Added default display title to Trigger node that shows how many triggers that node has
  • Added how many triggers do global triggers have in the list
  • Added custom data option to event, dialogue and script triggers
  • Added x, y, and z variables for trigger and region blocks that represent trigger or region block's position in the world
  • Removed locked icon and black overlay for item slot UI element when it's disabled

🩹 Fixes

  • Changed some of global trigger IDs (with backward compatibility system in place):
    • chat -> player_chat
    • break_block -> block_break
    • place_block -> block_place
    • interact_block -> block_interact
    • damage_entity -> entity_damaged
  • Changed Blockbuster mod to be an optional dependency rather than required
  • Fixed IScriptEntity.getMotion().z returning position Z rather than motion Z
  • Fixed typo in UIComponent.marginBotom() to UIComponent.marginBottom()
  • Fixed HUD morphs copying lighting of player's in the world
  • Fixed HUD morphs transparency issue (by depth sorting before rendering)
  • Fixed crafting recipe's visible option not saving
  • Fixed Copy camera information context menu removed from morph UI component (when UI debug mod option is enabled)
  • Fixed syntax highlighting issues regarding function names
  • Fixed dedicated server crash due to UI components

-rc3 to -rc4

🔨 Breaking changes

List below of breaking changes:

  • All graphics UI component methods now return a Graphics instance instead of UIGraphicsComponent. If you used chaining, i.e. graphics.rect(...).image(...).rect(...), you'll need to break down this expression into three separate lines.

🥵 New features

  • Added new scripting methods:
    • Added IMappetStates.resetMasked(String) which allows to remove states that support * wildcards
    • Added UITextComponent.textAnchor(float) which allows to adjust horizontal alignment
    • Added UIGraphicsComponent.shadow(int, int, int) which allows to draw a drop shadow
    • Added alternative methods to UIGraphicsComponent to create graphic elements
    • Added Graphics to documentation which has similar API to UIComponent to position graphic elements (i.e. x(), y(), xy(), etc.)
    • Added UIComponent.context(String, String, String, int) to add context menus to UI components
    • Added UITrackpadComponent.amplitudes(int, int, int) and UITrackpadComponent.increment(int) which configures how much to the value gets added
    • Added UIButtonComponent.noBackground(), UITextboxComponent.noBackground() and UITextareaComponent.noBackground() methods to hide the background of UI components
    • Changed all of UIGraphicsComponent graphics factory methods (i.e. .rect(), .gradient(), .image(), .text(), .icon(), etc.) to return Graphic instance instead of UIGraphicsComponent
  • Added more global triggers:
    • On player death trigger
    • On player item pick up trigger
    • On player close container
    • On block interact
    • On open player journal
  • Added option Toggle mode to trigger hotkeys which allows trigger that key not only when it was pressed down, but also second time when it gets released (variable's name is down, 0 or 1, variable determines whether key was pressed or released)
  • Added documentation search (select function name, right click it, and it should display Open docs... context menu item)
  • Added Morph condition and trigger blocks

💡 QoL

  • Added ability to skip ), ], }, second " and ' when typing in the script editor
  • Added object entity (if there is an entity that killed NPC) to NPC death trigger
  • Added mod options X and Y offsets to player journal button
  • Added support for ~ (server) as a target for /mp event trigger and /mp script exec commands
  • Added a run button to crafting table, quest, event and dialogue panels to try out the changes (i.e. open crafting table, accept quest, trigger event and open dialogue)
  • Added mod option to disable NPC tool gun for non-OP users (enabled by default)
  • Added an option to collect objective to ignore NBT data during item matching process
  • Added %ID%.slot value to item stack UI component, which tells from which player inventory slot was item chosen, and -1 from elsewhere (i.e. from creative search or got pasted)
  • Changed layout of global triggers section in server settings
  • Renamed trigger delay to frequency

🩹 Fixes

  • Fixed Run script button glitches when toggling sidebar
  • Fixed concurrent modification crash when trigger completes quest
  • Fixed numerous typos in script code samples
  • Fixed Run script button reloads script twice and thus resetting global variables
  • Fixed UILabelBaseComponent.color(int) not working with textbox and textarea UI components

-rc1 to -rc3

🔨 Breaking changes

There should be none.

🥵 New features

  • Added UI scripting API that allows creating custom GUIs (Graphical User Interfaces)
  • Added new scripting methods:
    • IScriptFactory.createUI() allows to build UIs using different UI components
    • IScriptPlayer.getUIContext() processes UI input from the player when a custom UI screen is opened
    • IScriptPlayer.openUI(IMappetUIBuilder) opens built UI with IScriptFactory.createUI() for this player
    • IScriptPlayer.closeUI() close any GUI (but not pause menu GUI) player has opened
    • IScriptPlayer.getSkin() returns player's skin in minecraft:skins/... format
    • IScriptPlayer.sendRaw(INBT) sends raw message, like using /tellraw command
    • IScriptPlayer.sendTitleDurations(int, int, int), IScriptPlayer.sendTitle(String), IScriptPlayer.sendSubtitle(String), and IScriptPlayer.sendActionBar(String) which are basically work like /title command
    • INBTCompound.setNBT(String, String) a short hand for compound.setCompound("key", mappet.createCompound("{...}"))
    • IScriptEvent.scheduleScript(int, ScriptObjectMirror) schedules a JS function (either anonymous or function reference)
  • Added Manage libraries... button in the script editor, which allows to load other scripts as libraries

💡 QoL

  • Added sections to in-game documentations
  • Added Run script button to script editor

🩹 Fixes

  • Fixed crash on dedicated server due to new HUD morph changes
  • Fixed players losing states and quests data on Mohist
  • Fixed crash when empty reaction was given in the dialogue
  • Fixed missing /mp hud commands help messages
  • Fixed HUD morphs not animating when updating with /mp hud morph command
  • Fixed JS scripts over 64kb kick out of the server (big thanks to Joziah2 for thoroughly testing it)
  • Fixed hex numbers (like 0xff00ff00) are not getting highlighted as other numbers

-dev3 to -rc1

🔨 Breaking changes

List below of possibly breaking changes:

  • If you used /mp script eval command, you'll need to change all these commands to /mp script exec
  • Event, Dialogue and Script nodes were removed in favor of Trigger node, there is a backward compatibility code put into place, however I'm not 100% sure whether it will work, it worked on my simple event test
  • quest alias for Quest chain node was removed, so if you have a map from dev1 or dev2, quest chain nodes will get lost

🥵 New features

  • Added REPL (interactive console) into scripts panel to test JS scripts
  • Added in-game scripting documentation (with code samples that can be directly tested out in REPL)
  • Added more scripting methods:
    • Added mappet.dump(obj) returns a String that contains dump of all obj's Java methods and fields, so you can inspect the values with REPL like print(mappet.dump(c.getSubject()))
    • Added IScriptEntity.isSame(IScriptEntity) which allows to compare entities (generally === won't work with directly with Mappet's scripting wrappers)
    • Added potion effects API:
      • Added IScriptEntity.applyPotion(Potion, int, int, boolean), IScriptEntity.hasPotion(Potion), IScriptEntity.removePotion(Potion), IScriptEntity.clearPotions() to manage entity's potion effects
      • Added IScriptFactory.getPotion(String) to get the Potion by given type (hint: you can use /effect @r command's tab completion to get the list of all possible potion types)
    • Added IScriptPlayer.getGameMode() and IScriptPlayer.setGameMode(int) methods to manage player's game mode
    • Added IScriptEntity.isBurning() and IScriptEntity.setBurning(int) methods to check and set entities on fire
  • Added GUI states editor to server settings panel and NPC editor
  • Added toggleable data caching, which should increase performance when a lot of data needs to be reused all the time
  • Added /mp script eval <code...> command which allows to execute one-liner JS code
  • Added Item (allows you to take and give items) and State (allows you to manage states) trigger blocks
  • Added Trigger node which allows you to use triggers within events and dialogues
  • Added Quest node to dialogues which allows you offer and complete one quest to a player
  • Added HUD scenes mechanism which allows to use morphs as Head-Up Display
  • Removed Event, Dialogue and Script nodes in favor of Trigger node
  • Removed quest alias for Quest chains nodes

💡 QoL

  • Added /mp data rencode <from> <to> command to re-encode Mappet's files from one charset to another
  • Added auto-disable option to emitter block
  • Added support for masks in /mp state clear for [id] argument, for example, you can use /mp state clear ~ quests.* to remove all quest related states
  • Added formatting processing (i.e. [ to §) for quest objective messages
  • Added arrow keys and Ctrl + left click dragging navigation into node graph editor
  • Added "Craft" button's title option to crafting tables
  • Added Recipe's description option to crafting recipes
  • Added /mp npc despawn <target> to despawn NPCs with a command
  • Added a [inventory] argument to /mp data clear to specify whether player inventories should be reset
  • Added target option to sound trigger
  • Added a button in player's inventory to open player journal
  • Added immovable option to NPCs
  • Changed the way crafting recipes are displayed
  • Changed /mp data clear command by default no longer clearing player inventories
  • Changed /mp script eval to /mp script exec

🩹 Fixes

  • Fixed crash with binary toggle
  • Fixed character encoding when reading Mappet files (only for new maps)
  • Fixed NPCs not spawning when they had previously a faction
  • Fixed all sounds being stopped when picking another reply in a dialogue
  • Fixed regions list sometimes not showing region blocks at all in Mappet's dashboard
  • Fixed region block's condition to being checked globally, rather than on individual players
  • Fixed region blocks sending player under bedrock sometimes
  • Fixed region block's condition is inverted for non-passable region blocks
  • Fixed crashing when copying one thing and pasting to another place (i.e. copying NPC state and pasting it in the condition editor)
  • Fixed NPCs still chasing after players when the faction score was changed
  • Fixed friendly faction not doing anything

-dev2 to -dev3

🔨 Breaking changes

List below of possibly breaking changes:

  • Triggers were refactored to use block based design (like conditions) which possibly could break any configuration of existing triggers, there is backward compatibility code, but I can't guarantee it will work 100% of the time

🥵 New features

  • Added an ability to import .ogg sounds by placing them into config/mappet/sounds/, they will be available after resource pack reloading (i.e. F3 + T) as sound events mp.sounds:...
  • Added sound event option to Reaction nodes, so a sound event will be played when the player opens a dialogue or advances to the next reaction
  • Added mpe target selector that allows to use very primitive math expressions to target entities with specific states
  • Added basic scripting API and script editor
  • Added Write state options to region block
  • Added support of multiple shapes to region block
  • Added states to NPCs
  • Added entity condition block with multiple options to check against
  • Added Is true, Is false and expression comparison modes
  • Added global triggers and server settings dashboard panel
    • On chat message, when player sends a message in the chat (not command though)
    • On block break, when player breaks a block
    • On block place, when player places a block
    • On server load, when server gets loaded
    • On server tick, when server updates logic
    • On player log in, when player logs in on the server (or opens the world)
    • On player left click, when player left clicks in the air
    • On player right click, when player right clicks in the air
  • Added delay to trigger blocks
  • Added Event, Dialogue and Script nodes to events and dialogues
  • Added allow retake, auto accept and condition options to quest chain's quest nodes
  • Added an ability to cancel default behavior of triggers from events and scripts
  • Changed trigger to block based design (same as condition editor)

💡 QoL

  • Added Player and NPC target selectors in condition blocks
  • Added subject_name, object_name player, player_name, npc and npc_name variables
  • Added Instant option to quests
  • Added NPC peaceful damage option
  • Added an ability to spawn NPCs with an NPC tool without selecting a template
  • Added update frequency option to emitter and region blocks
  • Added rename, copy and paste context menu items to states overlay panel
  • Added crafting recipe hotkeys to F9 keybind list
  • Added option argument dimension_id to world expression functions
  • Added an ability to store strings in states
  • Changed /mp quest decline tab competition to show only player's available quest list (instead of global list)
  • Changed region blocks to throw back players who try to enter non passable region block (instead of teleporting)
  • Moved event hotkeys to server settings and renamed them to trigger hotkeys

🩹 Fixes

  • Fixed target selectors within not working in region blocks relative to their block position
  • Fixed first condition block's inverse option didn't work
  • Fixed leash not rendering on NPCs
  • Fixed command and scripting compatibility with server plugin APIs (at least Mohist)
  • Fixed debug rendering of emitter and region blocks flickering
  • Fixed name tag items not working with NPCs
  • Fixed morph picker not responding when opened in multiple places
  • Fixed expressions couldn't use non-latin characters for strings

-dev1 to -dev2

🔨 Breaking changes

You need to be aware of following changes when updating from -dev1 to -dev2:

  • NPC ID was transferred to the state, so Matching NBT in kill objectives should be changed from {NpcId:"%NPC_ID%"} to {State:{Id:"%NPC_ID%"}}
  • Most of the fields that accepted expressions were transformed into a hybrid between expressions and condition editor, so in case expressions went missing, you'll have to manually retype them from let's say "dialogue_read(\"test\", subject)" into {"Expression":"dialogue_read(\"test\", subject)","Mode":1} within JSON files.
  • Quest chain nodes now provide the ID (instead of NPC's ID or [subject_id]) that should be used by quest nodes within a quest chain to compare quest provider/receiver.
  • Due to changes done to dialogue reading (it was the state would be written when player opens a dialogue), you need to go and to toggle Mark read of every end Reaction nodes to all dialogues

🥵 New features

  • Added custom objective messages to all quest objectives
  • Added new state objective which allows give an objective when player or global state changes
  • Added support of expression parsing within dialogue reactions and phrases
  • Added condition editor with following condition blocks:
    • Quest block, it allows to check for quest on specific player being complete, present or not present
    • State block, it allows to check the value of the state
    • Dialogue block, it allows to check whether a dialogue (or its sub dialogue) was read
    • Faction block, it allows to check faction state of a player
    • Item block, it allows to check inventory of a player
    • Condition block, it allows to nest conditions
    • World time block, it allows to check world's time
  • Added a toggle to disallow user closing dialogue until they reach the end
  • Added an option to reaction dialogue nodes to mark reading of the dialogue (writing to states)
  • Added event hotkeys which allow to trigger events when a player presses a key
  • Added checker component which is a hybrid between expressions and conditions

💡 QoL

  • Added Mark entry node context menu item to node graph
  • Added additional handling to untie method:
    • When selected one node, it will untie all of its children nodes (connections from bottom side)
    • When selected two nodes, it will untie these two from each other
  • Added display of quest, faction, crafting table, and other IDs when in creative mode
  • Added an ability to drag and drop node connections from top and bottom of nodes
  • Added Sort input nodes left-to-right context menu and keybind in node editor to sort children node indices from left-to-right
  • Added labels and animations to call user for action
  • Added modal pickers to most of the fields to pick quest, dialogue, event, faction, quest chain and crafting table IDs without having to input them manually
  • Added colors and shadows to some context menus
  • Added ability to copy/paste crafting tables, quests, events, dialogues, NPCs, factions and quest chains by right clicking on the ID list on the right
  • Added Edit in fullscreen... context menu to some text fields (like Quest's description, Content of reaction and reply nodes, or any other text fields where a lot of text could be edited)
  • Added OP checks for creative editing
  • Added an ability to use color formatting in quest titles
  • Changed layout of NPC editor to be like in McLib
  • Changed trigger layout to be more compact and intuitive
  • Changed scrolling speed in some modals
  • Changed dialogue to allow only reaction with no replies, quests or crafting (user may close the screen with Escape afterwards)
  • Changed NPC tool to:
    • Right click on ground to place NPC from the NPC and state configuration, and edit it immediately
    • Sneak + right click on an NPC to remove NPC
    • Sneak + right click on ground to place NPC from the NPC and state configuration
  • Changed Matching NBT to partially check child compound tags instead of fully
  • Improved multiplayer editing (locking editing of specific data when another player edits it)
  • Moved NPC ID, unique (still not used) and path finding distance properties to NPC state
  • Moved NPC states editing to a separate modal

🩹 Fixes

  • Fixed crash when clearing or removing an item slot in crafting creative screen
  • Fixed the label for M keybind saying remove selected
  • Fixed /mp data clearing happens twice on players that were present
  • Fixed NPCs name being entity.npc.name
  • Fixed NPC follow property not working with player usernames
  • Fixed crafting triggers not working with dialogue's context
  • Fixed missing data when editing in Mappet dashboard screen
  • Remove mappet:npc entity from the morph system
Clone this wiki locally