Python Forum
JS Buffer.from VS struct.pack
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
JS Buffer.from VS struct.pack
#4
Ok, I think I fixed it. I missed a break in a for loop so it was calling the write function more times that it needed to.
The map now actually loads in the map editor. which is good. It doesn't look how I expected it to but I don't think its an issue with the code.

Edit: Found the reason. I deleted a bit of code that multiplied the room size by 8 because I didn't know why it was doing that. Turns out it's because the game "builds" in pixels, not blocks, and a block is 8x8 pixels so to make a room 10x10 it needs to actually be 80x80.
Reply


Messages In This Thread
JS Buffer.from VS struct.pack - by DreamingInsanity - Apr-05-2021, 02:58 PM
RE: JS Buffer.from VS struct.pack - by deanhystad - Apr-05-2021, 03:14 PM
RE: JS Buffer.from VS struct.pack - by DreamingInsanity - Apr-05-2021, 06:27 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Python Struct Question, decimal 10, \n and \x0a. 3python 2 700 Aug-11-2023, 09:29 AM
Last Post: 3python
  Read buffer from bluetooth frohr 2 2,213 Jun-01-2022, 01:31 PM
Last Post: frohr
  Seperate output buffer matt_the_hall 2 2,412 Mar-15-2021, 08:44 PM
Last Post: matt_the_hall
  PyAudio Buffer Data Calculation MclarenF1 0 2,184 Aug-21-2020, 10:55 AM
Last Post: MclarenF1
  struct.unpack failed Roro 2 3,419 Jun-13-2020, 05:28 PM
Last Post: DreamingInsanity
  Pack integer values as single bytes in a struct bhdschmidt 3 2,412 Jun-09-2020, 09:23 PM
Last Post: bhdschmidt
  struct.decode() and '\0' deanhystad 1 3,292 Apr-09-2020, 04:13 PM
Last Post: TomToad
  Additional buffer for Windows constantin01 0 1,428 Mar-31-2020, 10:24 AM
Last Post: constantin01
  Getting MemoryError frames.write(buffer) kunwarsingh 0 1,653 Feb-10-2020, 09:39 PM
Last Post: kunwarsingh
  How to remove empty struct from matlab file in python? python_newbie09 0 2,419 Jun-25-2019, 12:13 PM
Last Post: python_newbie09

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020