Speech Bubbles

You are here:
← All Topics
Version: 2019.200 Requirements:uMMORPG3d, ToolsScript Define:None
Core Changes:YesTutorial Video:No

Description

This AddOn will display Speech Bubbles for regular local chat in uMMORPG. Only works with regular, local chat commands (not whisper etc.).


Core Changes

  1. [Required] Open the following script PlayerChat.cs. See Changes...

    Locate this line:
    [ClientRpc]
        public void RpcMsgLocal(string sender, string message)
        {
            // add message with identifierIn or Out depending on who sent it
            string identifier = sender != name ? local.identifierIn : local.identifierOut;
            string reply = local.command + " " + sender + " "; // whisper
            UIChat.singleton.AddMessage(new ChatMessage(sender, identifier, message, reply, local.textPrefab));
        }

    Modify to match:

    [ClientRpc]
        public void RpcMsgLocal(string sender, string message)
        {
            // add message with identifierIn or Out depending on who sent it
            string identifier = sender != name ? local.identifierIn : local.identifierOut;
            string reply = local.command + " " + sender + " "; // whisper
            UIChat.singleton.AddMessage(new ChatMessage(sender, identifier, message, reply, local.textPrefab));
    Utils.InvokeMany(typeof(PlayerChat), this, "RpcMsgLocal_", sender, message);
        }
  2. [Required] Open the following script Player.cs. See Changes...

    Locate this line:
    foreach (Animator anim in GetComponentsInChildren<Animator>())
                {
                    anim.SetBool("MOVING", IsMoving() && !IsMounted());
                    anim.SetBool("CASTING", state == "CASTING");
                    anim.SetBool("STUNNED", state == "STUNNED");
                    anim.SetBool("MOUNTED", IsMounted()); // for seated animation
                    anim.SetBool("DEAD", state == "DEAD");
                    foreach (Skill skill in skills)
                        if (skill.level > 0 && !(skill.data is PassiveSkill))
                            anim.SetBool(skill.name, skill.CastTimeRemaining() > 0);
                }

    Modify to match:

    foreach (Animator anim in GetComponentsInChildren<Animator>())
                {
    				if (anim.parameters.Any(x => x.name == "MOVING"))
                    	anim.SetBool("MOVING", IsMoving() && state != "CASTING" && !IsMounted());
                    if (anim.parameters.Any(x => x.name == "CASTING"))
                    	anim.SetBool("CASTING", state == "CASTING");
                    if (anim.parameters.Any(x => x.name == "STUNNED"))
                    	anim.SetBool("STUNNED", state == "STUNNED");
                    if (anim.parameters.Any(x => x.name == "MOUNTED"))
                    	anim.SetBool("MOUNTED", IsMounted()); // for seated animation
                    if (anim.parameters.Any(x => x.name == "DEAD"))
                    	anim.SetBool("DEAD", state == "DEAD");
                    
                    foreach (Skill skill in skills)
                        if (skill.level > 0 && !(skill.data is PassiveSkill) && anim.parameters.Any(x => x.name == skill.name))
                            anim.SetBool(skill.name, skill.CastTimeRemaining() > 0);
                }

Installation

  1. [Required] Drag UI Camera Prefab onto Main Camera in Hierarchy (World Scene), so it will become a child of it (so Speechbubbles cannot dissapear behind 3D objects).

Support the IndieMMO Team Today!

Leave a reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.