Search Unity

uMMORPG Official Thread

Discussion in 'Assets and Asset Store' started by mischa2k, Dec 29, 2015.

  1. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    It has a few public functions that you can call from anywhere.
     
  2. david_unity165

    david_unity165

    Joined:
    Sep 14, 2022
    Posts:
    3
    Is there any documentation about it? We'd like to wrap this to a HTTPs callable API
     
  3. david_unity165

    david_unity165

    Joined:
    Sep 14, 2022
    Posts:
    3
    Can it run via Unity Web?
     
  4. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    It's not exposed to outside of your project, you would have to add that yourself
     
  5. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347

    live in about 1h :)
     
  6. cidolfas2015

    cidolfas2015

    Joined:
    Sep 27, 2015
    Posts:
    87
    hello, I am using fizzysteamworks and steamworks.net to login into ummorpg. however I need to use onserveraddplayer to connect to lobbies/leaderboards/etc. but it doesn't look like ummorpg ce uses that? I put a debug.log in the the onserveraddplayer on the networkmanagermmo and nothing showed up.
    I did find this line:
    //public override void OnServerAddPlayer(NetworkConnection conn) { Debug.LogWarning("Use the CharacterSelectMsg instead"); }

    how is characterselectmsg used? I see it as a parameter in OnServerCharacterSelect, but I don't think that takes the code I want to implement for this. anyone have any ideas how to advance?
     
  7. cidolfas2015

    cidolfas2015

    Joined:
    Sep 27, 2015
    Posts:
    87
    here's the code I am trying to add
    Code (CSharp):
    1. public override void OnServerAddPlayer(NetworkConnection conn)
    2.     {
    3.         Debug.Log("Checking if player is in correct scene. Player's scene name is: " + SceneManager.GetActiveScene().name.ToString() + ". Correct scene name is: TitleScreen");
    4.         if (SceneManager.GetActiveScene().name == "Scene_SteamworksLobby")
    5.         {
    6.             bool isGameLeader = GamePlayers.Count == 0; // isLeader is true if the player count is 0, aka when you are the first player to be added to a server/room
    7.  
    8.             GamePlayer GamePlayerInstance = Instantiate(gamePlayerPrefab);
    9.  
    10.             GamePlayerInstance.IsGameLeader = isGameLeader;
    11.             GamePlayerInstance.ConnectionId = conn.connectionId;
    12.             GamePlayerInstance.playerNumber = GamePlayers.Count + 1;
    13.  
    14.             GamePlayerInstance.playerSteamId = (ulong)SteamMatchmaking.GetLobbyMemberByIndex((CSteamID)SteamLobby.instance.current_lobbyID, GamePlayers.Count);
    15.  
    16.             NetworkServer.AddPlayerForConnection(conn, GamePlayerInstance.gameObject);
    17.             Debug.Log("Player added. Player name: " + GamePlayerInstance.playerName + ". Player connection id: " + GamePlayerInstance.ConnectionId.ToString());
    18.         }
    19.     }
     
  8. cidolfas2015

    cidolfas2015

    Joined:
    Sep 27, 2015
    Posts:
    87
    I did find this in the documentation, but I am confused as to how to reimplement the code! NetworkManagerMMO.OnServerAddPlayer replaced with OnServerCharacterSelect and CharacterSelectMsg to avoid obsolete Mirror warnings. NetworkManagerMMO.OnServerCharacterSelect addon hook added too.
     
  9. kishipo32

    kishipo32

    Joined:
    Apr 15, 2021
    Posts:
    1
    Hello!

    I would like to ask for help.
    I would like to make a skill that does NOT target an Entity but the ground.
    For example: After using a skill, the character starts casting, a circle indicator appears that can be moved with the mouse. The center of the skill will be where the mouse is.
    Heals or deals damage, it doesn't matter.
    My problem is that I don't know how to create a NON Entity target.
    I have already done everything, but the skill can only be cast on Entity.
    How can I transfer the Mouse Raycast point to the script? So that the script of the current Skill system accepts the Raycast point as an Entity.
     
  10. cidolfas2015

    cidolfas2015

    Joined:
    Sep 27, 2015
    Posts:
    87
    for anyone who saw my question the answer was to simply use
    Code (CSharp):
    1. GameObject go = Database.singleton.CharacterLoad(characters[message.index], playerClasses, false);
    to load the player and everything worked fine in that method. However I would like to warp the character at the start but there are no arguments in the method I am using related to the player. anyone know how to make this work?
    Code (CSharp):
    1. public void StartGame()
    2.     {
    3.         Debug.Log("networkmanagermmo.startgame");
    4.         if (CanStartGame() && SceneManager.GetActiveScene().name == "GameZero")
    5.         {
    6.          
    7.             Vector3 position = new Vector3(0,0,0);
    8.             GameObject go = GameObject.FindWithTag("Player");
    9.             Player player = go.GetComponent<Player>();
    10.             Transform start = GetNearestStartPosition(position);
    11.  
    12.             ServerChangeScene("Scene_SteamworksGame");
    13.             Debug.Log("scene changed to steamworksgame");
    14.             player.movement.Warp(start.position);
    15.             Debug.Log("tranforming position to 0,0,0");
     
  11. cidolfas2015

    cidolfas2015

    Joined:
    Sep 27, 2015
    Posts:
    87
    to rephrase that question. how can I reference the player in the networkmanagerMMO?
     
  12. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    NetworkClient.player on the client, or on the server you need NetworkServer.connections[Your_Connection_Id].player
     
  13. cidolfas2015

    cidolfas2015

    Joined:
    Sep 27, 2015
    Posts:
    87
    would I need to use networkserver.connections to do a warp on scenechange through the network manager?
     
  14. cidolfas2015

    cidolfas2015

    Joined:
    Sep 27, 2015
    Posts:
    87
    I tried this in the network manager but it only changes scenes it doesn't port him.
    Code (CSharp):
    1. public void StartGame()
    2.     {
    3.         Debug.Log("networkmanagermmo.startgame");
    4.         if (CanStartGame() && SceneManager.GetActiveScene().name == "GameZero")
    5.         {
    6.             ServerChangeScene("Scene_SteamworksGame");
    7.             Debug.Log("scene changed to steamworksgame");
    8.  
    9.  
    10.             if(NetworkServer.connections.Count > 0){
    11.                 Debug.Log("This is the host.");
    12.             } else
    13.             {
    14.                 GameObject go = GameObject.FindWithTag("Player");
    15.                 Player player = go.GetComponent<Player>();
    16.                 player.movement.Warp(new Vector3(0,0,0));
    17.                 Debug.Log("performinig movement warp on client");
    18.                 Debug.Log("This is a client.");
    19.             }
    20.         }
    21.     }
     
  15. cidolfas2015

    cidolfas2015

    Joined:
    Sep 27, 2015
    Posts:
    87
    ok I got it to work like this.
    Code (CSharp):
    1.  public void StartGame()
    2.     {
    3.         Debug.Log("networkmanagermmo.startgame");
    4.         if (CanStartGame() && SceneManager.GetActiveScene().name == "GameZero")
    5.         {
    6.             GameObject go = GameObject.FindWithTag("Player");
    7.             Player player = go.GetComponent<Player>();
    8.             Warping.instance.Warper(player);
    9.             ServerChangeScene("Scene_SteamworksGame");
    10.             Debug.Log("scene changed to steamworksgame");
    11.         }
    12.     }
    and then put this code on the player.
    Code (CSharp):
    1. public static Warping instance;
    2.     private void Awake()
    3.     {
    4.         MakeInstance();
    5.     }
    6.     // OverlapSphereNonAlloc array to avoid allocations.
    7.     // -> static so we don't create one per skill
    8.     // -> this is worth it because skills are casted a lot!
    9.     // -> should be big enough to work in just about all cases
    10.     void MakeInstance()
    11.     {
    12.         if (instance == null)
    13.             instance = this;
    14.     }
    15.  
    16.     public bool GetCaster(Player player)
    17.     {
    18.         // no target necessary, but still set to self so that LookAt(target)
    19.         // doesn't cause the player to look at a target that doesn't even matter
    20.         player.target = player;
    21.         return true;
    22.     }
    23.  
    24.     public void Warper(Player player)
    25.     {
    26.  
    27.         // validate
    28.         if (player.target != null &&
    29.             player.target.health.current > 0)
    30.         {
    31.             player.movement.Warp(new Vector3(0,0,0));
    32.             player.target = null;
    33.         }
    34.  
    35.         return;
    36.  
    37.  
    38.     }
    39.  
    40.  
    41.     public bool CheckDistance(Player player, int skillLevel, out Vector3 destination)
    42.     {
    43.         // can cast anywhere
    44.         destination = player.transform.position;
    45.         return true;
    46.     }
     
  16. cidolfas2015

    cidolfas2015

    Joined:
    Sep 27, 2015
    Posts:
    87
    now I just need to leave the match back to the world.
     
  17. cidolfas2015

    cidolfas2015

    Joined:
    Sep 27, 2015
    Posts:
    87
    I can travel back and change scenes to the beginning using this code
    Code (CSharp):
    1. GameObject go = GameObject.FindWithTag("Player");
    2.         Player player = go.GetComponent<Player>();
    3.         SceneManager.LoadScene("GameZero");
    4.         game.state = NetworkState.World;
    5.         player.movement.Warp(new Vector3(0, 0, 0));
    , but it logs me out and takes me to the login screen where the login button is greyed out. is there anyway to change scenes to the world state and bypass the login and character selection screens?
     
  18. cidolfas2015

    cidolfas2015

    Joined:
    Sep 27, 2015
    Posts:
    87
     
  19. cidolfas2015

    cidolfas2015

    Joined:
    Sep 27, 2015
    Posts:
    87
    ok I have another question, I am want to tally deaths and kills, which would be the best method to place an increment? I have deaths, playerkills, and monsterkills to account for.

    I think here, but I don't know how to add playerkills += 1; to a lamba function.
    Code (CSharp):
    1. bool EventDied() =>
    2.         health.current == 0;
    Code (CSharp):
    1.   bool EventTargetDied() =>
    2.         target != null && target.health.current == 0;
     
    Last edited: Sep 23, 2022
  20. cidolfas2015

    cidolfas2015

    Joined:
    Sep 27, 2015
    Posts:
    87
    I followed the path and put my increments in this method instead.
    Code (CSharp):
    1.  public void OnKilledEnemy(Entity victim)
    2.     {
    3.         // killed an innocent player
    4.         if (victim is Player && ((Player)victim).IsInnocent())
    5.         {
    6.             playerkills += 1;
    7.             StartMurderer();
    8.         }
    9.         if (victim is Monster)
    10.         {
    11.             monsterkills += 1;
    12.         }
    13.         // killed a pet with an innocent owner
    14.         else if (victim is Pet && ((Pet)victim).owner.IsInnocent())
    15.         {
    16.             StartMurderer();
    17.         }
    18.     }
    it works fine for pvp, but if you attack a dead monster is counts a kill. this is also happening for levelling up. I can level up from 1-13 off 3 dead monsters with my aoe attack. any ideas how to change this?
     
  21. cidolfas2015

    cidolfas2015

    Joined:
    Sep 27, 2015
    Posts:
    87
     
  22. cidolfas2015

    cidolfas2015

    Joined:
    Sep 27, 2015
    Posts:
    87
    I was able to stop damage and experience gains on dead bodies by changing if (!victimCombat.invincible) to if (!victimCombat.invincible && victim.health.current > 0) in the dealdamageat method.
     
  23. cidolfas2015

    cidolfas2015

    Joined:
    Sep 27, 2015
    Posts:
    87
    hmmm it doesn't always register a kill though. they die but I get no credit.
     
  24. Wonderbread0

    Wonderbread0

    Joined:
    Oct 19, 2021
    Posts:
    1
    It appears that the majority of the addons available for uMMORPG do not currently support the 2021 version. I purchased uMMORPG recently and I'm version 2.38 which doesn't support Network Lobby or the majority in the addons which are in the Unity Asset Store or Trugord's bundles. I really want to be able to jump start my platform development with access to these addons. Is there a way to download an older version of uMMORPG, pay for access to a code repo where I could download older versions, because 99% of the addons which I need to run do not run on 2.38 or unity 2021. I need a version such as 2.36 with 2020 in order to get started. Any help would be greatly appreciated.
     
    oricooo likes this.
  25. ELC2909

    ELC2909

    Joined:
    Jun 17, 2016
    Posts:
    8
    Hello, when will UMMORPG adopt Mirror 2022.10?
     
  26. matthieu_sokolowski

    matthieu_sokolowski

    Joined:
    Jan 2, 2023
    Posts:
    1
    Hello, I'm working on a project with uMMORPG, and after some creation ( ennemies, player, pet) i've a probleme the canvas don't spawn when i start the test, disabled when the game start
     
  27. cidolfas2015

    cidolfas2015

    Joined:
    Sep 27, 2015
    Posts:
    87
    ok i have a box collider which I use for water. I put it at -1y location with 1,1,1 scale. When you step in the water at -1y he starts to swim, but then around -2y he starts to run again, and then around -4y he starts to swim again. Any ideas why he wouldn't just stay swimming the first time you enter at -1y? also, none of my clothes are working anymore. I don't even know where to begin looking. I use uma and the clothes work if I manually add them in the dynamic character avatar, but if I add them in game nothing shows up. any ideas?
     
  28. cidolfas2015

    cidolfas2015

    Joined:
    Sep 27, 2015
    Posts:
    87
    I was able to fix that by taking off hidden colliders on the character
     
  29. cidolfas2015

    cidolfas2015

    Joined:
    Sep 27, 2015
    Posts:
    87
    next question. how can you use the offers like a regular button? If I try to do that it shows a player slot that i have to add the player? the button works fine as an offer but i want it to work in other contexts as well! ty for the time.
     
  30. cidolfas2015

    cidolfas2015

    Joined:
    Sep 27, 2015
    Posts:
    87
    is there an easy way to port all players at one time? I tried this but it didn't work
    Code (CSharp):
    1.  foreach (Player player in players)
    2.         {
    3.             if (lobbyManager.IsPlayerOwner)
    4.             {
    5.                 player.npcArenaTeleport.CmdArenaCreator();
    6.                 Debug.Log("player is owner, cmdarenacreator called");
    7.             }
    8.             player.npcArenaTeleport.CmdTeleport();
    9.             Debug.Log("cmdteleport called on all players");
     
  31. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,030
    Why does uMMORPG add so many mirror defines? As far as I can tell, these are not used anywhere in the code.

    upload_2023-7-8_9-13-9.png
     
    Radivarig likes this.
  32. matus99

    matus99

    Joined:
    Jul 19, 2021
    Posts:
    5
    is there a way to convert MMORPG KIT to Urp? i tried by but does not work
     
  33. Demonith88

    Demonith88

    Joined:
    Jun 30, 2014
    Posts:
    216
    What games are made with this asset
     
  34. Ziron999

    Ziron999

    Joined:
    Jan 22, 2014
    Posts:
    282
    is it possible to use mirror or anything else that is free without CCU limitations?
     
  35. Ziron999

    Ziron999

    Joined:
    Jan 22, 2014
    Posts:
    282
    This project is still useless until it goes away from CCU and creates its own Dedicated Exe that can be ran. I have created my own architecture that can do this and avoid unity issues, but it would be amazing if uMMORPG would do the same.
     
  36. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,698
    uMMORPG uses Mirror. It's made by the developer of Mirror.
     
    mischa2k likes this.
  37. sabbath1989

    sabbath1989

    Joined:
    Jan 20, 2016
    Posts:
    14
    I have a problem, in ummorpg when we click on a ui element, it takes the target of what is behind it, npcs, mobs players. This is in the mobile version, where is the script that controls this? because it is not in the OnMouseDown entity