dMZX Forums: Robot THISX/THISY values are not updated after movement from WALK -> Archived MegaZeux Bugs -> Tracker

Jump to content

Report ID 746 Title Robot THISX/THISY values are not updated after movement from WALK
Product Archived MegaZeux Bugs Status Fixed (Severity 5 - Critical)
Version 2.91i Fixed in 2.92
Introduced In Version <2.80Operating System All platforms

Page 1 of 1
  • Cannot start a new Issue
  • Closed Issue This issue is locked

Report ID #746: Robot THISX/THISY values are not updated after movement from WALK

#1 User is offline  
Lachesis 

  • the pinnacle of human emotion
  • Group: DigiStaff
  • Posts: 3,895
  • Joined: 17-July 04
  • Gender:Female
  • Location:Sealand

Posted 29 January 2019 - 06:19 AM

This bug exists in all versions back to at least 2.51. When a robot is walking via the WALK command, the THISX and THISY counter values are not updated until after the robot has ended its cycle. This means that if the robot checks its THISX or THISY values during a cycle while it is walking, those values will not reflect its current position.

It isn't clear how this affects other features reliant on robot->xpos/robot->ypos either. Example: SAVE_GAME in versions prior to 2.90 would occur during the robot's cycle before those values are updated (which happens at the end of run_robot).

Code to reproduce in any version:
walk EAST
: "l"
wait 1
if c?? Robot p?? at "THISX" "THISY" "ok"
if c?? Space p?? at "THISX" "THISY" "lol"
goto "l"
: "ok"
* "~fThere is a robot at (thisx,thisy)."
goto "l"
: "lol"
* "~fThere is a ~cspace ~fat (thisx,thisy). wat"
goto "l"


Fixing this requires a version check since I can imagine other MZXers have used WALK and THISX/THISY at the same time, and to make these counters accurate they would have offset the values.
"Let's just say I'm a GOOD hacker, AND virus maker. I'm sure you wouldn't like to pay for another PC would you?"

xx̊y (OST) - HELLQUEST (OST) - Zeux I: Labyrinth of Zeux (OST) (DOS OST)
w/ Lancer-X and/or asgromo: Pandora's Gate - Thanatos Insignia - no True(n) - For Elise OST
MegaZeux: Online Help File - Keycode Guide - Joystick Guide - Official GIT Repository


Page 1 of 1  
  • Cannot start a new Issue
  • Closed Issue This issue is locked

Replies (1 - 4)

#2 User is offline  
Lachesis 

  • the pinnacle of human emotion
  • Group: DigiStaff
  • Posts: 3,895
  • Joined: 17-July 04
  • Gender:Female
  • Location:Sealand

Posted 11 March 2019 - 02:58 AM

Updating severity to: 5 - Critical

This goes a lot deeper than I thought it did.

  • Any time a robot moves from WALK, its THISX/THISY values aren't updated until the end of its cycle.
  • Any time a robot moves itself through a transport, its THISX/THISY values aren't updated correctly.
  • Any time a robot is pushed outside of its cycle, its THISX/THISY values aren't updated at all.
  • If a robot is moved with the MOVE ALL command, its THISX/THISY values aren't updated at all.
  • These values are only correctly set at the start of robot execution and (unless it moved through a transport/moved itself with MOVE ALL) at the end of robot execution.
  • If the robot is ended, its THISX/THISY values may not be computed properly AT ALL. This might have appeared this way due to a bug further down though.


Aside from THISX and THISY, these bugs affect
  • IF ALIGNEDROBOT
  • the THIS_COLOR, PLAYERDIST, HORIZPLD, and VERTPLD counters.
  • anything that uses get_robot_id (currently just the counters ROBOT_ID_# and RID#).
  • displaying the robot's X and Y position in the counter debugger and robot debugger.
  • bounding the size of an MZM while saving it, meaning if these values are incorrect they can crash MegaZeux.


Also, these wrong values get saved and loaded with save files. I'm not sure it's worth trying to version check all of this stuff, it just needs to be fixed.
"Let's just say I'm a GOOD hacker, AND virus maker. I'm sure you wouldn't like to pay for another PC would you?"

xx̊y (OST) - HELLQUEST (OST) - Zeux I: Labyrinth of Zeux (OST) (DOS OST)
w/ Lancer-X and/or asgromo: Pandora's Gate - Thanatos Insignia - no True(n) - For Elise OST
MegaZeux: Online Help File - Keycode Guide - Joystick Guide - Official GIT Repository

#3 User is offline  
Lachesis 

  • the pinnacle of human emotion
  • Group: DigiStaff
  • Posts: 3,895
  • Joined: 17-July 04
  • Gender:Female
  • Location:Sealand

Posted 11 March 2019 - 05:59 AM

This can also be caused by the SWITCH [dir] [dir] command and rotation.
"Let's just say I'm a GOOD hacker, AND virus maker. I'm sure you wouldn't like to pay for another PC would you?"

xx̊y (OST) - HELLQUEST (OST) - Zeux I: Labyrinth of Zeux (OST) (DOS OST)
w/ Lancer-X and/or asgromo: Pandora's Gate - Thanatos Insignia - no True(n) - For Elise OST
MegaZeux: Online Help File - Keycode Guide - Joystick Guide - Official GIT Repository

#4 User is offline  
Lachesis 

  • the pinnacle of human emotion
  • Group: DigiStaff
  • Posts: 3,895
  • Joined: 17-July 04
  • Gender:Female
  • Location:Sealand

Posted 13 March 2019 - 04:32 AM

Updating status to: Fixed
Issue fixed in: 2.92

Fixed in GIT 9d98c2f7 in the master-2.92 branch.
"Let's just say I'm a GOOD hacker, AND virus maker. I'm sure you wouldn't like to pay for another PC would you?"

xx̊y (OST) - HELLQUEST (OST) - Zeux I: Labyrinth of Zeux (OST) (DOS OST)
w/ Lancer-X and/or asgromo: Pandora's Gate - Thanatos Insignia - no True(n) - For Elise OST
MegaZeux: Online Help File - Keycode Guide - Joystick Guide - Official GIT Repository

#5 User is offline  
Terryn 

  • ******
  • Group: DigiStaff
  • Posts: 2,960
  • Joined: 12-October 00
  • Gender:Male

Posted 23 July 2019 - 12:35 AM

Moving to: Archived MegaZeux Bugs


Page 1 of 1
  • Cannot start a new Issue
  • Closed Issue This issue is locked

0 User(s) are reading this issue
0 Guests and 0 Anonymous Users


Powered by IP.Tracker 1.3.2 © 2026  IPS, Inc.