Single Status Update
I had a tiny query in the Discord server, one I figured would take less than two minutes for someone with greater knowledge about RGSS3 to answer than I could figure out.
Really, cold shoulder stings, so now I'm doubling down on this.
I can conditional check just fine for the player's region ID, but every attempt thus far at checking against event region ID's has given me invalid syntax errors (I know they're invalid due to where the error points to).
What is my goal? Well, let us just say that too many games allow player-event interactions when the player and event are on different areas but are also horizontally aligned (i.e. player on cliff and event below cliff). I want that NOT TO HAPPEN, dig?
Of course ya do.
I havn't been discording lately, so sorry I wasn't there to help! You know you can always PM me any time, right? I might not always be able to help, but it's fine to ask!
That said... I really have to say even though I know it's done out of frustration and some errors can admittedly be misleading, you really have to stop blaming the errors and assuming they are invalid. Errors are never invalid. Misleading sometimes, yes. Hard to spot the cause of sometimes, very yes. But if you are getting a syntax error, it means there is something you did that Ruby just can't parse somewhere.
I will say this though: When it comes to events and conditional checks, the place errors are reported as coming from is always in Game_Interpreter because any code that is run though an eval command that gives an error is always reported as the error coming from the eval command. Which is kind of annoying as it makes errors in script calls and conditional checks kinda hard to debug, but would be sort of tricky to report otherwise. Maybe I should try and code something to properly display where those errors actually come from?
Or, you can pop in on Steam like you used to do out of the blue, lolz
Anyway, case in point: When the error points to a bracket, that contains a non-empty array, you know that the error is not valid, or to say, that the error is misleading. Specifically, it pointed to '['. Yeah. If it were an issue with an uncompleted loop...
[ [ [ ] ]
Then, that would be valid.
Makes that error invalid/misleading. An invalid error means it is not correctly pointing out what the issue is. I never thought I'd have to explain that.
So, with that in hand...
The conditional check is to check if the activated event is standing on the same region as the player.
$game_map.events[#].region_id is redundant since the check only applies to the current event being activated.
Even having the following as a check throws the invalid error:
$game_map.events[#].region_id == $game_player.region_id
So, yeah...I mean, I could take the event's region ID and store it in a variable and use that as comparison, but if I can do that, then doing it directly should, not, be, a, problem.
Wait, are you including the # there? Pretty sure that is meant to be a placeholder, as # starts a comment in Ruby and ignores the rest of the line. That would give that exact error because everything after the # doesn't count. So really that error would be 100% correct. Now imagine how much worse it would be if Ruby just closed the brackets for you. The conditional would just always pass and you would have no idea anything was wrong with it!
For the record, the current event is in @event_id, so it should be $game_map.events[@event_id].region_id == $game_player.region_id
- Show next comments 3 more