|
Post by tbird on Apr 14, 2022 23:08:49 GMT -6
I finally found the issue.. that was a long painful process.
'This Works If MouseX() >= 1200 And MouseX() <= 1298 And MouseY() >= 16 And MouseY() <= 113 Then Print "Number 0" ElseIf MouseX() >= 1200 And MouseX() <= 1298 And MouseY() >= 114 And MouseY() <= 211 Then Print "Number 1" ElseIf MouseX() >= 1200 And MouseX() <= 1298 And MouseY() >= 212 And MouseY() <= 309 Then Print "Number 2" ElseIf MouseX() >= 1200 And MouseX() <= 1298 And MouseY() >= 310 And MouseY() <= 407 Then Print "Number 3" End If
'This does not Work Function MouseInZone(x1, y1, x2, y2) mX = MouseX() mY = MouseY()
If MouseX() >= x1 And MouseX() <= x2 And MouseY() >= y1 And MouseY() <= y2 Then Return True End If End Function
If MouseInZone(1200, 16, 1298, 113) Then Print "Number 0" ElseIf MouseInZone(1200, 114, 1298, 211) Then Print "Number 1" ElseIf MouseInZone(1200, 212, 1298, 309) Then Print "Number 2" ElseIf MouseInZone(1200, 310, 1298, 407) Then Print "Number 3" End If 'This Works If MouseX() >= entSlotX_ent[i] And MouseX() <= entSlotX_ent[i] + slotSize And MouseY() >= entSlotY_ent[i] + scrollAdj And MouseY() <= entSlotY_ent[i] + slotSize Then
'This Does not If MouseInZone(entSlotX_ent[i], entSlotY_ent[i] + scrollAdj, entSlotX_ent[i] + slotSize, entSlotY_ent[i] + slotSize) Then
The MouseInZone() Function is used in about 100 other spots and works flawlessly...can you explain what is going on here??
|
|
|
Post by johnno56 on Apr 15, 2022 9:05:28 GMT -6
Without testing the last two instructions... I would say that the last mouseinzone() (line #36 and 37) will 'only' work 'if' the mouse is perfectly aligned with the bounding box. No tolerance. The mouse would have to be precisely touching the boundary of the box... Whereas the previous mouseinzone() (line #32 and 33) will allow the mouse to be detected anywhere 'within' the bounding box... That would be my guess... But I could be wrong...
This function is familiar to me as I have created one just like it. As RC does not have a built-in mousezone(), I found the use of an Access Aligned Bounding Box routine, makes for a great work-a-round....
|
|
|
Post by tbird on Apr 15, 2022 9:22:05 GMT -6
johnno56 The principal is exactly the same between them all, and the function as it sits is used at least 100 times throughout the engine and works flawlessly, and when I put "does not work" I should clarify, it selects inside the "zone" as it should, but after a second press inside any of the "zones" RC errors out.
|
|
|
Post by n00b on Apr 15, 2022 13:29:45 GMT -6
tbird I will look at it today. Just from looking at it, I can't really tell what is going on. Could you share a minimal program that produces the error? I just want to know everything that you did leading up to the error.
|
|
|
Post by johnno56 on Apr 15, 2022 15:29:05 GMT -6
My response would only be seen as repetition of my previous point. But I did say that I could be wrong. I also agree with n00b, without context, a guess is the best we can do...
|
|
|
Post by tbird on Apr 15, 2022 16:07:25 GMT -6
The first section that doesn't produce an error, is identical to the functional call, context is irrelevant. The first part is hard coded MouseX() MouseY() functions while the second part uses a function that assigns them to variables but they do the exact same thing, except RC errors out with the custom function call, and not with using RCBasic function calls directly.
Here's the interesting part I can't create a minimal program that produces this error and it wasn't an error in 3.13 the code is unchanged and works exactly how its supposed to. After 3.14 it errors out but only in this one instance, even though like I said it's being used 100 times across the engine without an error....
So color me confused, I have poured hours into this trying to reproduce it and I can't, but I wasn't really calling for a fix more just saying I finally found the problem here, and it makes no sense at all to me.
|
|
|
Post by johnno56 on Apr 16, 2022 2:53:40 GMT -6
Please forgive if this has been asked before, if so then just ignore me... lol What error message are you getting?
|
|
|
Post by tbird on Apr 16, 2022 4:21:27 GMT -6
Well the error is that typical error when an array is out of bounds error (107467....etc..) that was one of the reasons I had such a difficult time figuring out what the issue was I kept looking at the array and it's values as the source of the problem, till I removed the array and it's iterations entirely and the problem persisted.
When I can reproduce the error in a minimal program which should be a possibility now without me pulling my hair out lol, we can get to the root of the issue.
I am just blown away by what it was, but being the person dealing with it for a long time now, it's obviously much more impactful to me, I have been running circles around this for so long, only to find out th problem is a function which works in 99% of the calls that is made to it but not this one lol, and only in newer versions of RC....oh well another 4-6 months and I might be able to make a applicable program to solve the issue.
|
|
|
Post by tbird on May 24, 2022 23:30:11 GMT -6
Well I tried..briefly again and nope, I can't reproduce the issue and at this point I kinda don't care, it works now. It still baffles me to no end, but it's easier to move on and forget about it for now.
|
|
|
Post by n00b on May 25, 2022 16:39:19 GMT -6
Well I tried..briefly again and nope, I can't reproduce the issue and at this point I kinda don't care, it works now. It still baffles me to no end, but it's easier to move on and forget about it for now. Awesome. Glad to hear it is working for you now.
|
|
|
Post by tbird on Jan 18, 2023 20:02:43 GMT -6
n00b In response to your question I'll just post here, I didn't want to hijack johnno56's thread. I am finally working on it again, my last real commit was in August last year so when I pushed some more bug fixes and features in December and some more this month, well it feels great. Version 2 is going great, the appearance overhaul is working out good..well in my opinion. I rewrote my collision engine again, and it was a good improvement in the performance department. Working on my vertical shooter hopefully can post it soon.
|
|
|
Post by johnno56 on Jan 18, 2023 21:25:57 GMT -6
No offence taken... Hijack away... Moo Ha Ha Ha...
|
|
|
Post by n00b on Jan 19, 2023 9:11:29 GMT -6
tbird Cool. When you get a chance, could you also post some screenshots of your editor. I remember the last time you actually showed it off it had isometric tiling support and would like to see how that changed.
|
|
|
Post by tbird on Jan 22, 2023 15:42:17 GMT -6
johnno56, thanks but I'd rather not muddy the waters, I'm looking forward to the game when you post it. n00b I will post some stuff soon, besides being....better on the eyes the layout hasn't changed alot. Most of the upgrades are in the code.
|
|
|
Post by johnno56 on Jan 22, 2023 16:18:53 GMT -6
tbirdI am not worried about mud... More concerned about the lack of water... lol Go for it... The game I am testing is based on an old sdlbasic platform that I did some years back. Using that one because, for me, it seems the simplest... (famous last words... lol) I am still trying to figure out the connection between the Engine and how it relates to the sprites. N00b demonstrated how to "pick up coins" - which works very well - I have managed to be able to put conditions on a switch (pick up a number of coins first) before it can change its sprite to a 'closed' switch. I am yet to figure out how to also change the image of a sprite that is not touched (change a door from closed to open) when the switch is activated... frustrating... but fun! So... I am not certain that I will publish the game or use it as a tutor to work on a different platform game... The current game has 3 fixed levels... Ideally I would like to have a side-scrolling platform similar to Mario... Oh and then there are enemies and their movement paths.... Moving platforms... Completely forgot about those... Might be beyond my reach at the moment... lol Just getting it to work properly is my main goal... lol You could be waiting a while before anything playable is ready... What is the phrase you guys use? "I am slower than molasses in January." lol Just think, how much harder would it have been to create the game 'old school' (reading data statements into arrays), without a level creator? Yikes! The engine is SO much quicker in creating a level... (credit to n00b!!) Breakfast and first coffee are done... Time to fire up the Engine....
|
|