Welcome to Keen Software House Forums! Log in or Sign up to interact with the KSH community.
  1. You are currently browsing our forum as a guest. Create your own forum account to access all forum functionality.

Can someone show me how to read a game variable?

Discussion in 'Programming Questions and Suggestions' started by pcsagan, Mar 17, 2019.

Thread Status:
This last post in this thread was made more than 31 days old.
  1. pcsagan Trainee Engineer

    Messages:
    3
    I've looked at the source code and tried to find working examples, but I just can't seem to do something as simple as get the position of my character. How do you make this code work?

    public override void UpdateAfterSimulation()
    {
    if (!MyAPIGateway.Input.IsNewKeyReleased(MyKeys.F8))
    return;

    MyAPIGateway.Utilities.ShowNotification(..., 10000, MyFontEnum.White);
    // What replaces '...'? I've tried 40 different things here like Sandbox.ModAPI.IMyEntity.GetPosition().ToString()
    }

    Thanks.
     
Thread Status:
This last post in this thread was made more than 31 days old.