[SOLVED] CONST_TAKEMAPSPACE - Unexpected Behaviour

Started by GameGibu, October 13, 2017, 02:14:40 AM

Previous topic - Next topic

GameGibu

Hoo boy it's been a while. I was hoping to make a surprise return to this wonderful community, but now I've hit what appears to be a bug, and I'm wondering if anyone else is experiencing this.

Being somewhat oxidized at CRPL from my long absence, I've got about 10 lines of non-commented-out code. I've turned everything else off, restarted the editor and the game, but for no reason at all, the value set and returned for CONST_TAKEMAPSPACE is identical to CONST_COORDX. Setting CONST_TAKEMAPSPACE to any value instead sets the unit's X-coordinate. Toggling Take Map Space in the editor doesn't cause this however, so it seems like "CONST_TAKEMAPSPACE" is, for an unknown reason, suddenly mapping to "CONST_COORDX"?

Looking back at my code for the Particles game mode, I see this not being an issue, and having recently livestreamed myself playing one of my particle maps I can say that it works there. This could be because the script is bundled with the map, so maybe the compiler is what's broken?

Note: I may re-disappear for any length of time at any time without notice or solid reason. This should be my signature but I'm being lazy and putting it in this post instead.

Spoiler
# CheckAndPlace.crpl
# Author: GameGibu
# ------------------------------------------
ShowTraceLog
once
0 ->myTime
"
" ->nl
"""" 1 1 Substring ->qt
#SetText("Test")
#SetUnitAttribute( Self "CONST_TAKEMAPSPACE" 100 )
GetUnitAttribute( Self "CONST_TAKEMAPSPACE" ) Trace
#SetImage( Self "main" "NONE" )
endonce

#@run

:run
  <-myTime 1 add ->myTime
  #SetImagePositionX( Self "main" GetImagePositionX(Self "main") sub(1) )
[close]

EDIT: All CONST_ values are not strings but rather actually constants mapped to integers. "CONST_TAKEMAPSPACE" as a string was resolving to 0, which is also the  integer that CONST_COORDX is an alias for.
Bringing you Custom maps since 2971!
☆CRPL Master☆