• Visit Rebornbuddy
  • Visit Panda Profiles
  • Visit LLamamMagic
  • Help With Calling Properties

    Discussion in 'Archives' started by DissBeeChris, Dec 11, 2010.

    1. DissBeeChris

      DissBeeChris New Member

      Joined:
      Jan 15, 2010
      Messages:
      34
      Likes Received:
      0
      Trophy Points:
      0
      Due to my noobishness with C#, I can't figure out how to call Styx.WoWInternals.WoWObjects.WoWPlayer.IsGhost and Styx.WoWInternals.WoWObjects.LocalPlayer.CorpsePoint.

      I was getting this error: An object reference is required for the non-static field, method, or property 'Styx.WoWInternals.WoWObjects.WoWPlayer.IsGhost.get' for both properties. I Googled to try to find out about calling properties, but I'm just getting frustrated. Could someone give me an example of how to call these types of properties?
       
    2. chinajade

      chinajade Well-Known Member Moderator Buddy Core Dev

      Joined:
      Jul 20, 2010
      Messages:
      17,540
      Likes Received:
      172
      Trophy Points:
      63
      Try
      • Styx.StyxWoW.Me.IsGhost
      • Styx.StyxWoW.Me.CorpsePoint

      Styx.StyxWoW.Me is static, and provides the missing object reference for the methods you're trying to use.

      cheers,
      CJ
       
    3. DissBeeChris

      DissBeeChris New Member

      Joined:
      Jan 15, 2010
      Messages:
      34
      Likes Received:
      0
      Trophy Points:
      0
      Thank you, it works now.

      But, now I'm getting a new error trying to call FindHeight. I've never had problems with FindHeight, but now I'm getting:

      Code:
      System.NullReferenceException: Object reference not set to an instance of an object.
         at ci.b()
         at Tripper.Navigation.WowNavigator.LoadTile(TileIdentifier wowTile)
         at b2.a(Single A_0, Single A_1)
         at Styx.Logic.Pathing.Navigator.FindHeights(Single x, Single y)
         at Styx.Logic.Pathing.Navigator.FindHeight(Single x, Single y, Single& z)
         at HighVoltz.ClickToGo.OnButtonPress() in c:\HBHBHB\Plugins\lololol.cs:line 70
         at Styx.Plugins.PluginWrapper.OnButtonPress()
      This is what my code looks like:
      Code:
      WoWPoint worldPoint = new WoWPoint();
      worldPoint.X = (float)-6491.5580605;
      worldPoint.Y = (float)-3295.554;
      Navigator.FindHeight(worldPoint.X, worldPoint.Y, out worldPoint.Z);
       

    Share This Page