What's new
  • Visit Rebornbuddy
  • Visit Panda Profiles
  • Visit LLamamMagic
  • Visit Resources
  • Visit Downloads
  • Visit Portal

Help with refreshing player position

Sharpy

New Member
Joined
Mar 22, 2016
Messages
2
Reaction score
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 sender, EventArgs e)
        {
            RefreshMe();
            richTextBox1.Text += Me.Position.ToString() + "\n";
        }

        private void RefreshMe()
        {
            Me.Update();
        }
    }
}
 
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 sender, EventArgs e)
        {
            RefreshMe();
            richTextBox1.Text += Me.Position.ToString() + "\n";
        }

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

You are reading information from another thread. Memory reads are thread-local cached. Just add in "GameManager.Memory.ClearCache()" before your Me.Update() call.
 
Back
Top