UndertaleModTool icon indicating copy to clipboard operation
UndertaleModTool copied to clipboard

Having a variable called "score" that is global will be reverted to non-global when saving

Open AndrewIdot opened this issue 2 years ago • 4 comments

Describe the bug

im editing a pizza tower fangame, and utmt happens to mess up most of the code I tend to edit when saving

Reproducing steps

  1. edit any code with a global value called score (global.score) that is having a new value set (i.e. global.score = 15)
  2. save
  3. said global.score variable will turn into score (i.e. score = 15)
  4. watch as the game you're modifying crumbles

Setup Details

  1. UndertaleModTool version: Github commit fa327ab
  2. Operating system: Windows 10
  3. Gamemaker Game: Internship Alpha 1.6, although this seems to happen with every game

AndrewIdot avatar Aug 09 '23 05:08 AndrewIdot

this is not a bug. it is conflicting with the builtin global score variable. avoid using score since it's a deprecated variable.

fixdude avatar Aug 09 '23 16:08 fixdude

Well, GameMaker games can theoretically use the builtin and a global in tandem. It's just a bad idea that apparently breaks the tool; I bet the same goes for other builtins, maybe even explicit self.score values.

Jacky720 avatar Aug 09 '23 16:08 Jacky720

@colinator27 whats the status with this on UA?

Miepee avatar Mar 22 '25 17:03 Miepee

Just did a test and it seems to now compile correctly, but I'm not sure if it registers the variable correctly or not. Would be nice to re-test this fully on bleeding edge to see if anything breaks at runtime.

colinator27 avatar Mar 22 '25 17:03 colinator27