• Visit Rebornbuddy
  • Visit Panda Profiles
  • Visit LLamamMagic
  • Help with refreshing player position

    Discussion in 'Wildbuddy Developers' started by Sharpy, Apr 23, 2016.

    1. Sharpy

      Sharpy New Member

      Joined:
      Mar 22, 2016
      Messages:
      2
      Likes Received:
      0
      Trophy Points:
      0
      Currently have this bit of code to print the local player position to a text box. Only problem is that it doesn't update the player position and prints the same value.
      PHP:
      using Buddy.Wildstar.Game.Actors;
      using System;
      using System.Windows.Forms;

      namespace 
      ProfileJabbit.GUI
      {
          public 
      partial class Menu Form
          
      {
              private 
      Player Me;
              public 
      Menu()
              {
                  
      InitializeComponent();
                  
      Me GameManager.LocalPlayer;
              }

              private 
      void addButton_Click(object senderEventArgs e)
              {
                  
      RefreshMe();
                  
      richTextBox1.Text += Me.Position.ToString() + "\n";
              }

              private 
      void RefreshMe()
              {
                  
      Me.Update();
              }
          }
      }
       
    2. Apoc

      Apoc Moderator Staff Member Moderator

      Joined:
      Jan 16, 2010
      Messages:
      2,790
      Likes Received:
      94
      Trophy Points:
      48
      You are reading information from another thread. Memory reads are thread-local cached. Just add in "GameManager.Memory.ClearCache()" before your Me.Update() call.
       
    3. Sharpy

      Sharpy New Member

      Joined:
      Mar 22, 2016
      Messages:
      2
      Likes Received:
      0
      Trophy Points:
      0
      Thanks, works great now!
       

    Share This Page