Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - acronyte

Pages: [1] 2
1
If I directly edit a playersave file on the tnet server hosted online (through ftp for example).... When I run my game, rather than the edited file being read, tnet reads the old version of the file....

Why is this?

2
TNet 3 Support / Does tnet read .txt files directly from server?
« on: November 22, 2017, 07:34:22 AM »
I'm using
  1. TNManager.LoadFile("filename.txt", OnLoadFile);
....for loading data from this file on my server..

What i'd like to know is, Does tnet:
 - read data directly from this file on the server?
 - or does it download the entire file (on start), then read it locally?

I am asking because, the file size will increase over time and concerned on the time taken to read the data...

3
TNet 3 Support / data that all players can access?
« on: October 29, 2017, 08:13:56 AM »
How is this done?

I tried using one file on my server where all players can access, but the file gets rewritten everytime a player uses SetPlayerData.

4
TNet 3 Support / Remove child not working
« on: October 24, 2017, 03:55:58 PM »
how would i go about deleting a child item from my player data file?
Lets say the file on the server (content below) is save using text (not binary) :

  1. Version 198897
  2.         data1 = "1"
  3.         data2 = "2"
  4.         data3 = "3"
  5.        

How would i remove "data3" from the hierarchy?

I know about "TNManager.playerData.RemoveChild".....but that doesnt work in this case.

5
TNet 3 Support / upload image to server
« on: October 19, 2017, 06:02:45 PM »
I know unity has www form to save images to a server through a php or cgi script on the server, but how is this done through tnet? Im thinking it has something to do with saving bytes of a texture and uploading that data to server? I dont know where to begin...

6
TNet 3 Support / Can TNet be used to stream video?
« on: September 13, 2017, 02:02:54 AM »
Can TNet be used stream video?
Specifically...Is it capable of sending a webcam.device / webtexture (with video) through RFC's to other players / users?

Ive tried searching the forum and found this: http://www.tasharen.com/forum/index.php?topic=5387.msg25649#msg25649

but I'n not 100% sure its related...

If TNet is capable...Is there a basic example to get one started in the right direction?

7
TNet 3 Support / How to check if file exists on server?
« on: September 04, 2017, 07:12:40 AM »
How would I got about checking if a file exists on tnet's server? I know I can do this through unity itself, but is there a tnet call or something that can do this?

8
TNet 3 Support / Using Invector Third Person Controller with TNet
« on: April 22, 2017, 08:59:37 AM »
Has anyone successfully used Invectors third person controller from unitys asset store with Tnet?

I've been trying for days to get this asset working along with Tnet....but with no success.

Now I know that I'm supposed to be syncing a controllers input with Tnet and the characters animation will automatically follow, but I just cant seem to get it working...

The Invector controller has three separate scripts which control a characters movement (thirdpersonmotor.cs, thirdpersonanimator.cs and thirdpersoncontroller.cs)

I've been only editing the 'thirdpersoncontroller.cs' to work with Tnet with the code below:
Invectors original code (the 'input' part')
  1.  /// <summary>
  2.         /// CONTROLLER INPUT - gets input from keyboard, gamepad or mobile touch to move the character
  3.         /// </summary>
  4.  
  5.                 public void ControllerInput()
  6.         {
  7.             if (inputType == InputType.Mobile)
  8.                 input = new Vector2(CrossPlatformInputManager.GetAxis("Horizontal"), CrossPlatformInputManager.GetAxis("Vertical"));
  9.             else if (inputType == InputType.MouseKeyboard)
  10.                 input = new Vector2(Input.GetAxis("Horizontal"), Input.GetAxis("Vertical"));
  11.             else if (inputType == InputType.Controler)
  12.             {
  13.                 float deadzone = 0.25f;
  14.                 input = new Vector2(Input.GetAxis("LeftAnalogHorizontal"), Input.GetAxis("LeftAnalogVertical"));
  15.                 if (input.magnitude < deadzone)
  16.                     input = Vector2.zero;
  17.                 else
  18.                     input = input.normalized * ((input.magnitude - deadzone) / (1 - deadzone));
  19.             }
  20.  
  21.         }
  22.  
  23.  

Ive edited this to show:

  1. public void ControllerInput()
  2.         {
  3.             if (inputType == InputType.Mobile)
  4.                 input = new Vector2(CrossPlatformInputManager.GetAxis("Horizontal"), CrossPlatformInputManager.GetAxis("Vertical"));
  5.             else if (inputType == InputType.MouseKeyboard)
  6.                 input = new Vector2(Input.GetAxis("Horizontal"), Input.GetAxis("Vertical"));
  7.             else if (inputType == InputType.Controler)
  8.             {
  9.                 float deadzone = 0.25f;
  10.                 input = new Vector2(Input.GetAxis("LeftAnalogHorizontal"), Input.GetAxis("LeftAnalogVertical"));
  11.                 if (input.magnitude < deadzone)
  12.                     input = Vector2.zero;
  13.                 else
  14.                     input = input.normalized * ((input.magnitude - deadzone) / (1 - deadzone));
  15.             }
  16.                         tno.Send (1, Target.OthersSaved, input);
  17.         }
  18.  
  19.                 [RFC(1)]
  20.                 void Move(Vector2 i){
  21.                         input = i;
  22.                 }
  23.  

I've added Tnets original autosyncrigidbody script and it works...the character sync but not their animation...

I'm assuming Invectors other two files need to be edited?

Can someone guide me in the right direction? Ive attached the three Invector controller files if anyone is willing to help me out...

9
As the title states , Im trying to create a new object using:

  1. Vector3 pos = new Vector3 (0, 0, 0);
  2. Quaternion rot = Quaternion.Euler(new Vector3(0, 0, 0));
  3. String playername = TNManager.GetPlayerData<string> ("CharacterName");
  4. TNManager.Instantiate (3, "CreatePlayer", playerprefabPath, false, pos, rot, playername);
  5.  

I passed all the arguments(rot, pos, playername, but still getting this error....

[TNet] Failed to call function CreatePlayer: parameters do not match signature
  Expected args: UnityEngine.GameObject, UnityEngine.Vector3, UnityEngine.Quaternion
  Received args: UnityEngine.GameObject, UnityEngine.Vector3, UnityEngine.Quaternion, System.String

Does anyone have an idea on whats wrong?

10
Im trying to test out a lobby in my project, where players who have now connected can prepare their character for the actual game world...

The lobby itself is the first channel users join when connecting for the first time. After they have prepared their character , they can then enter the game world.

My issue is that everyone sees everyone else character when joining the lobby channel. Is there a way for tnet to hide or make invisible each players characters when they are in the lobby channel?


11
TNet 3 Support / Assigning GUI avatars to players in a channel
« on: November 23, 2016, 09:26:01 PM »
I have a scene where there is a channel limit of six players. The attached GUI shows 6 'slots' where I want to implement content based on each of the six players in the channel....

So...
Player1 ---> Slot1
Player2 ---> Slot2
Player1 ---> Slot3
and so on....

How would one go about assigning these players (lets say...each playerID) their respective GUI objects.

Is there an example here in the forums that can guide me in the right direction?

12
TNet 3 Support / Instantiate object as child (not working)
« on: October 31, 2016, 11:15:53 PM »
Im trying to instantiate an object as a child of another with tnet on a movable player, but it doesn't seem to be working.....

  1. public GameObject launchpoint; <------ this object is to be parent
  2.  
  3. public int channelID = 0;
  4.  
  5. public void T1A1press(){
  6.  
  7.                         if (channelID < 1) channelID = TNManager.lastChannelID;
  8.                 TNManager.Instantiate(channelID, "T1A1go", "Prefabs/Projectiles/t1a1", false, launchpoint.transform.position, launchpoint.transform.rotation);
  9.  
  10.         }
  11.         [RCC]
  12.         static GameObject T1A1go (GameObject prefab, Vector3 pos, Quaternion rot)
  13.         {
  14.                 // Instantiate the prefab
  15.                 GameObject go = prefab.Instantiate() as GameObject;
  16.  
  17.                 // Set the position and rotation based on the passed values
  18.                 Transform t = go.transform;
  19.                 t.position = pos;
  20.                 t.rotation = rot;
  21.  
  22.                 go.GetComponent<Rigidbody> ().AddRelativeForce (Vector3.forward * 1000.0f);
  23.  
  24.  
  25.  
  26.                 return go;
  27.         }
  28.  
  29.  


What happens is that during gameplay, the instantiated object spawns at original location of the player which has "launchpoint" as a child...but when my player moves, future objects spawn at the original location of the player, rather than the new location of the player...

Can anyone pick up what I am doing wrong?

13
TNet 3 Support / Not able to obtain unique playerID
« on: October 23, 2016, 08:36:52 AM »
Below is my code for creating a player (using TNet 3).

Im have managed to rename the instantiated prefab at the end.

My problem is during runtime the instantiated object has the same name for each player that joins the channel. ( see "go.name = "player" + TNManager.playerID;" in my code below) <<--which is intended to give each instantiated object a unique name.

Can I request some guidance into why this isnt working?

  1.  
  2. using UnityEngine;
  3. using System.Collections;
  4.  
  5. namespace TNet
  6. {
  7.         /// <summary>
  8.         /// Instantiate the specified prefab at the game object's position.
  9.         /// </summary>
  10.  
  11.         public class TNAutoCreatePlayer : TNBehaviour
  12.         {
  13.                 public static Manager manager_instance;
  14.  
  15.                 /// <summary>
  16.                 /// ID of the channel where the prefab should be created. '0' means "last used channel".
  17.                 /// </summary>
  18.  
  19.                 public int channelID = 0;
  20.  
  21.                 /// <summary>
  22.                 /// Prefabs to instantiate.
  23.                 /// </summary>
  24.  
  25.                 string playerprefabPath;
  26.                 string charactertype;
  27.  
  28.  
  29.                 /// <summary>
  30.                 /// Whether the instantiated object will remain in the game when the player that created it leaves.
  31.                 /// Set this to 'false' for the player's avatar.
  32.                 /// </summary>
  33.  
  34.                 public bool persistent = false;
  35.  
  36.                 void Awake (){
  37.                         charactertype = PlayerPrefs.GetString ("charactertype");
  38.                         manager_instance = GameObject.FindGameObjectWithTag ("manager").GetComponent<Manager>();
  39.                 }
  40.  
  41.                 IEnumerator Start ()
  42.                 {
  43.                         while (TNManager.isJoiningChannel) yield return null;
  44.  
  45.  
  46.                         if (charactertype == "1")
  47.                                 playerprefabPath = "petmaster_world";
  48.                         if (charactertype == "2")
  49.                                 playerprefabPath = "champion_world";
  50.                         if (charactertype == "3")
  51.                                 playerprefabPath = "mystic_world";
  52.  
  53.                         if (channelID < 1) channelID = TNManager.lastChannelID;
  54.                         TNManager.Instantiate(channelID, "CreatePlayer", playerprefabPath, persistent, transform.position, transform.rotation);
  55.  
  56.                         Destroy(gameObject);
  57.                 }
  58.  
  59.                 [RCC]
  60.                 static GameObject CreatePlayer (GameObject prefab, Vector3 pos, Quaternion rot)
  61.                 {
  62.                         // Instantiate the prefab
  63.                         GameObject go = prefab.Instantiate();
  64.  
  65.                         // Set the position and rotation based on the passed values
  66.                         Transform t = go.transform;
  67.                         t.position = pos;
  68.                         t.rotation = rot;
  69.                         go.name = "player" + TNManager.playerID; // The name of the gameobject is the same for each player that joins
  70.                         return go;
  71.  
  72.                 }
  73.  
  74.  
  75.  
  76.  
  77.         }
  78. }
  79.  

14
TNet 3 Support / Setting up controller script for Mecanim syncing
« on: May 30, 2016, 04:23:04 PM »
My controller script has references to functions in an external script , where the mecanim animation functions are...

I tried and managed to sync the player movement (position and rotation) but not the mecanim animations. I did his using the default TNSync Rigidbody script that came with TNet. I have read in the forums that I need to sync the inputs but I don't know how to start as my script has the external reference....

Can someone please point me in the right direction in setting up my controller script below to send RFC's to the external script, so that the mecanim animation can sync? Below is the part of my controller script with the references to functions from the external script and input functions

  1. using UnityEngine;
  2. using System.Collections;
  3. using UnityStandardAssets.CrossPlatformInput;
  4.  
  5. namespace Invector.CharacterController
  6. {
  7.     public class ThirdPersonController : ThirdPersonAnimator
  8.     {
  9.  
  10.                 private static ThirdPersonController _instance;
  11.         public static ThirdPersonController instance
  12.         {
  13.             get
  14.             {
  15.                 if (_instance == null)
  16.                 {
  17.                     _instance = GameObject.FindObjectOfType<ThirdPersonController>();
  18.                     //Tell unity not to destroy this object when loading a new scene
  19.                     //DontDestroyOnLoad(_instance.gameObject);
  20.                 }
  21.                 return _instance;
  22.             }
  23.         }
  24.  
  25.         private bool isAxisInUse;
  26.  
  27.        
  28.  
  29.         void Start()
  30.         {
  31.             InitialSetup();                                     // setup the basic information, created on Character.cs
  32.             Cursor.visible = false;
  33.         }
  34.  
  35.  
  36.  
  37. //////This is where the external functions begin////////////
  38.                 void FixedUpdate()
  39.         {
  40.                        
  41.                         UpdateMotor();                                  // call ThirdPersonMotor methods
  42.                     UpdateAnimator();                           // update animations on the Animator and their methods
  43.                     UpdateHUD();                    // update HUD elements like health bar, texts, etc
  44.             ControlCameraState();                       // change CameraStates    
  45.                        
  46.  
  47.         }
  48.  
  49.         void LateUpdate()
  50.         {            
  51.                        
  52.                         InputHandle();                                  // handle input from controller, keyboard&mouse or mobile touch            
  53.                     DebugMode();                                        // display information about the character on PlayMode
  54.  
  55.         }
  56.        
  57.         /// <summary>
  58.         /// INPUT - every input is been handle in this script, you can change the input map here or directly on the InputManager
  59.         /// </summary>
  60.                 void InputHandle()
  61.                 {
  62.                        
  63.                                 CloseApp ();
  64.                                 CameraInput ();
  65.                                 if (!lockPlayer && !ragdolled) {                
  66.                                         ControllerInput ();
  67.  
  68.                                         // we have mapped the 360 controller as our Default gamepad,
  69.                                         // you can change the keyboard inputs by chaging the Alternative Button on the InputManager.                
  70.                                         InteractInput ();
  71.                                         JumpInput ();
  72.                                         RollInput ();                
  73.                                         CrouchInput ();                
  74.                                         AttackInput ();                
  75.                                         DefenseInput ();                
  76.                                         SprintInput ();
  77.                                         LockOnInput ();
  78.                                         DropWeaponInput ("D-Pad Horizontal");
  79.                                 } else
  80.                                         LockPlayer ();            
  81.                        
  82.                 }
  83.  
  84.      
  85. ////The Input ///////////////
  86.         /// <summary>
  87.         /// CONTROLLER INPUT - gets input from keyboard, gamepad or mobile touch to move the character
  88.         /// </summary>
  89.                 public void ControllerInput()
  90.         {
  91.                        
  92.                                
  93.                                 if (inputType == InputType.Mobile)
  94.                                         input = new Vector2 (CrossPlatformInputManager.GetAxis ("Horizontal"), CrossPlatformInputManager.GetAxis ("Vertical"));
  95.                                 else if (inputType == InputType.MouseKeyboard)
  96.                                         input = new Vector2 (Input.GetAxis ("Horizontal"), Input.GetAxis ("Vertical"));
  97.                                 else if (inputType == InputType.Controler) {
  98.                                         float deadzone = 0.25f;
  99.                                         input = new Vector2 (Input.GetAxis ("LeftAnalogHorizontal"), Input.GetAxis ("LeftAnalogVertical"));
  100.                                         if (input.magnitude < deadzone)
  101.                                                 input = Vector2.zero;
  102.                                         else
  103.                                                 input = input.normalized * ((input.magnitude - deadzone) / (1 - deadzone));
  104.                                
  105.                                        
  106.                                
  107.                                 }
  108.  
  109.         }
  110.  
  111.        
  112.  
  113. }
  114.  

15
Misc Archive / Quote please! Simple project :)
« on: October 04, 2015, 02:20:12 PM »
Hi everyone!

I would appreciate if someone can give me a quote for small work on my multiplayer project.

ArenMook had gave me a solution , but I would like someone to implement it for me. Its a matter of syncing user inputs on their character , which would in turn sync the character animation on each client.

Please see the thread here:
http://www.tasharen.com/forum/index.php?topic=13615.0

thanks!

Pages: [1] 2