Legacy GM 'if room != rm_example' does not work

FrostyCat

Redemption Seeker
rm_example is the ID you need. Don't believe me? Try doing this:
Code:
// You should see a number here
show_message(rm_example);
I have never encountered a situation where something like if (room != rm_example) doesn't work, in fact I use it myself. Chances are the original poster from that Reddit topic is accidentally doing stuff like these, where string names are compared against numeric IDs (which NEVER match):
Code:
// This never works
if (room != "rm_example")
Code:
// Neither can this
if (room_get_name(room) != rm_example)
 

jobjorgos

Member
Ah you made it very clear!
I just checked my code again, and I acctually had if room == 'rm_example' with quotes.
I was never aware that using these quotes or not may really matter for the room comparing script to work.
Thanks for the good lesson with the numeric IDs and string names stuff
 
Top