Navigation

    forum

    • Login
    • Search
    • Categories
    • Recent
    • Popular
    • Users
    • Groups
    1. Home
    2. Rainer_Z
    • Flag Profile
    • block_user
    • Profile
    • Following
    • Followers
    • Topics
    • Posts
    • Groups
    • Blog

    Rainer_Z

    @Rainer_Z

    2
    Posts
    735
    Profile views
    0
    Followers
    0
    Following
    Joined Last Online

    Rainer_Z Follow

    Posts made by Rainer_Z

    • RE: RoomPosition in memory

      Okay,I just read
      http://docs.screeps.com/global-objects.html

      Got it now 😉

       

      posted in Help
      Rainer_Z
    • RoomPosition in memory

      Hey all,

      I am trying to do the following and don't understand why its not working the way I suppose it should:

      I have a creep with an information .memory.destination: RoomPosition

      Now if I'm trying to access this information in a function by console.log it gives me an array of two objects instead of the RoomPosition object.

      So for example:

      myFunction: function(myCreep, myRoomPosition) {
      console.log(myRoomPosition); // yields '[object Object]'
      var myRoomPosition2 = new RoomPosition(myRoomPosition.x,  myRoomPosition.y, myRoomPosition.roomName)
      console.log(myRoomPosition2) // yields the right thing '[room WxxNxx pos xx,yy]'
      ... }

      So what am I missing here? Why do I have to redeclare the RoomPosition object instead of just using it right from the creeps memory?

      Thanks a lot!

      posted in Help
      Rainer_Z