Jibble

Author Topic: Mouse locked to Walk to Mode, blending in/out....??  (Read 404 times)

TheManInBoots

  • Epically wrote function to declare an int
HEy.

So for the project I wanted to submit for the February MAGS in the very last second the AGS editor completely gave up it's spirit!

On certain actions all of a sudden the mouse does not change it's mode anymore and stays on walk to mode all the time.

And then sometimes its start blending in and out...

I can't believe that this is a scripting error I made.

Also I can't remember having changed that much actually, just added animations and variables...

and it stopped working.


It happens when I for example click again quickly while the character talks during an interaction with an object.
Or during a room change.
Or while looking at an object twice in a row while standing in the same spot.

It's very peculiar.

And this seems more engine related.

I'm getting more and more intimidated to try ambitious, bigger projects with AGS...

But maybe someone has an idea what could cause this?


Here's a vid:

You can see that no matter how and where I click, the cursor does not change.
And 16 seconds into the video you see the cursor is starting to blink!?
Watch out though, it always automatically uses the mike for audio, turn the volume down ;)
https://streamable.com/ha8bm

Cassiebsg

  • Cavefish
  • Fleeing the Cylon tyrrany...
    • Cassiebsg worked on one or more games that won an AGS Award!
    •  
    • Cassiebsg worked on one or more games that was nominated for an AGS Award!
Re: Mouse locked to Walk to Mode, blending in/out....??
« Reply #1 on: 03 Mar 2020, 11:44 »
If the streamable, or is the video very "jerky"? Like the computer is doing over work and can't keep up?
There are those who believe that life here began out there...

Re: Mouse locked to Walk to Mode, blending in/out....??
« Reply #2 on: 03 Mar 2020, 11:55 »
The most likely cause is a logical problem in the scripting, I don't think there is any built-in behaviour that will fade the cursor in and out like that. You would likely have to post the source files for the scripts for anyone to try to work out what was going on.

TheManInBoots

  • Epically wrote function to declare an int
Re: Mouse locked to Walk to Mode, blending in/out....??
« Reply #3 on: 03 Mar 2020, 12:35 »
With script source files you mean this?
deleted

I probably could've grouped certain things together better and looped more things to make it clearer in the script.
But all of this developed organically and I wasn't sure when I started off how it will go eventually.
« Last Edit: 14 Mar 2020, 01:34 by TheManInBoots »

TheManInBoots

  • Epically wrote function to declare an int
Re: Mouse locked to Walk to Mode, blending in/out....??
« Reply #4 on: 03 Mar 2020, 16:17 »
Here is a link for the entire game file.

deleted


I'd be eternally grateful for anyone who would be able to understand what the problem is.

I hope this can make access to the script easier.
If you can help me, you're my hero and I'd really appreciate it.

Thanks
« Last Edit: 14 Mar 2020, 01:36 by TheManInBoots »

Re: Mouse locked to Walk to Mode, blending in/out....??
« Reply #5 on: 03 Mar 2020, 19:39 »
TheManInBoots, can you tell which gfx driver do you select to play the game? (just in case there's difference)

NOTE: I was able to see the cursor stuck in walk to mode, but could not yet reproduce the cursor fading bug.

Cursor often stucks in walk to mode after displaying an "exit arrow" at least once (EDIT: but not always... :/).
« Last Edit: 03 Mar 2020, 20:16 by Crimson Wizard »

TheManInBoots

  • Epically wrote function to declare an int
Re: Mouse locked to Walk to Mode, blending in/out....??
« Reply #6 on: 04 Mar 2020, 00:40 »
Crimson Wizard, in order to re-create the blending mouse cursor go into Global script asc., to the very beginning of the late_repeatedly_execute_always function at line 503, and restore what has been hidden with slash asterisk.

(This part:)
Code: Adventure Game Studio
  1. //walks behind tent
  2. /*if(cJames.Room==2)
  3. {Jamesposition=Screen.ScreenToRoomPoint(cJames.x, cJames.y);
  4. if(Jamesposition.x>400&&Jamesposition.x<450&&Jamesposition.y>300&&Jamesposition.y<340)
  5. {
  6. behind=true;
  7. }
  8. }*/

=>

Code: Adventure Game Studio
  1. //walks behind tent
  2. if(cJames.Room==2)
  3. {Jamesposition=Screen.ScreenToRoomPoint(cJames.x, cJames.y);
  4. if(Jamesposition.x>400&&Jamesposition.x<450&&Jamesposition.y>300&&Jamesposition.y<340)
  5. {
  6. behind=true;
  7. }
  8. }

i recommend setting the cloththickness int variable to 200 or any high number and don't forget to turn the last gui gGui2's Visibility to false.
Then set cJames to room 2 (if you want to save time, set his start coordinates 480, 350)
Now walk to the right coordinates  behind the green tent where the cut-scene is triggered.
The bug might affect the cutscene, but also I changed a few things around to figure out what triggers the bug, so don't pay much attention to the cutscene.

after the cutscene you will observe the exact same fading in and out of the mouse.
« Last Edit: 08 Apr 2020, 23:33 by TheManInBoots »

TheManInBoots

  • Epically wrote function to declare an int
Re: Mouse locked to Walk to Mode, blending in/out....??
« Reply #7 on: 04 Mar 2020, 00:43 »
Aren't the settings also saved in the project file?
Or only in winsetup?
I used Direct3D 9
« Last Edit: 04 Mar 2020, 01:09 by TheManInBoots »

Re: Mouse locked to Walk to Mode, blending in/out....??
« Reply #8 on: 04 Mar 2020, 01:02 »
If you fix all your code so it looks like this:

Code: Adventure Game Studio
  1.   //walks behind tent
  2.   if (cJames.Room == 2)
  3.   {
  4.     Jamesposition = Screen.ScreenToRoomPoint(cJames.x, cJames.y);
  5.     if (Jamesposition.x > 400 && Jamesposition.x < 450 && Jamesposition.y > 300 && Jamesposition.y < 340)
  6.     {
  7.       behind = true;
  8.     }
  9.   }

and reupload your game I'll take a look.
(Note that you don't have to do this by hand; simply paste your script into the JS area here: https://jsfiddle.net/ and click "tidy")
« Last Edit: 04 Mar 2020, 01:04 by Khris »
Fail at Floaty Rog' now!  still having to deal with what games are going through

TheManInBoots

  • Epically wrote function to declare an int
Re: Mouse locked to Walk to Mode, blending in/out....??
« Reply #9 on: 04 Mar 2020, 01:07 »
Hahah, I would expect you would have a hard time looking at my script, since you like everything orderly.

Spoiler: ShowHide
So you mean every additional bracket causes a paragraph offset. Symbols separated by space.
And you also want a constant one paragraph offset on the left side for the entire script?


Oh never mind just saw your foot note!

What a nice thing the JS area!
« Last Edit: 04 Mar 2020, 01:26 by TheManInBoots »

Re: Mouse locked to Walk to Mode, blending in/out....??
« Reply #10 on: 04 Mar 2020, 07:18 »
It's not about what I like, it's about making it readable in general. Squishing together operators and variables or not indenting blocks simply leads to objectively unreadable code which makes it way less likely for anybody usually inclined to do so to take a look.

The difference in readability is staggering in my book, and if somebody doesn't put in minimal effort to produce readable code, why should I put in effort to help them fix their buggy, unreadable mess? 50% of the time, using proper indentation is what had prevented the bug in the first place.

And indenting the entire block by two spaces is just something I do when I post code that's inside a function. The idea is that people can copy-paste it as-is and don't have to worry about fixing the indentation.
Fail at Floaty Rog' now!  still having to deal with what games are going through

TheManInBoots

  • Epically wrote function to declare an int
Re: Mouse locked to Walk to Mode, blending in/out....??
« Reply #11 on: 05 Mar 2020, 13:24 »
Currently compressing a clean script project file...

TheManInBoots

  • Epically wrote function to declare an int
Re: Mouse locked to Walk to Mode, blending in/out....??
« Reply #12 on: 05 Mar 2020, 20:52 »
So here is a cleaner script.

https://drive.google.com/file/d/1LGWmfQo3E6HuUBLKi7uVNYML2H4MnuXN/view?usp=sharing

If I remember well you gotta remove
Code: Adventure Game Studio
  1. int angle=1;
in the beginning of room script 11.

TheManInBoots

  • Epically wrote function to declare an int
Re: Mouse locked to Walk to Mode, blending in/out....??
« Reply #13 on: 05 Mar 2020, 21:43 »
Also the reason Khris that I wasn't immediately ready to post a clean script was the way you asked me.
You said, the only way you gonna help me is if I do this particular thing.
It felt more like trying to mâle me do things rater than an intention to help me.

You know, after the game stopped working, I spent several just trying to fix the problem.

You think I wouldn't take 5 minutes to clean the script?

You could've also said, that you'd be glad to help, but it would be easier for everyone to find a solution if the script was cleaner.
Instead of putting pressure on me.

So, I just so you know.
« Last Edit: 05 Mar 2020, 22:24 by TheManInBoots »

Cassiebsg

  • Cavefish
  • Fleeing the Cylon tyrrany...
    • Cassiebsg worked on one or more games that won an AGS Award!
    •  
    • Cassiebsg worked on one or more games that was nominated for an AGS Award!
Re: Mouse locked to Walk to Mode, blending in/out....??
« Reply #14 on: 05 Mar 2020, 21:45 »
Okay, I did a few tests, basicly just /* and */ for codes in rep_exec and blocking the code for the cinema bars seems to solve the problem that is lines 607 to 641 ( 644 to 654 are blocked by you)

I've only tested by placing the character on room 1 and opening and closing the stove door. But before I blocked those lines it would be stuck in walk to mode, and now it's not.

EDIT: you the one that asked for help. I also tried to read the script before and gave up, since it was impossible (or too much effort).

EDIT2: Seems like there's more code that needs blocking, now I went outside and after the "discover Clara scene" the mouse is again stuck in walk to mode, this time blinking.

EDIT3: So I figured out what is happening with Clara's room. And it's got nothing to do with engine bug!

Simply in GlobalScript line 147 you have:
Code: Adventure Game Studio
  1. function repeatedly_execute()
  2. {
  3.   //behind tent
  4.   if (behind == true)
  5.   {
  6.     if (Game.DoOnceOnly("disco")
  7.     {
  8.       cJames.SayBackground("blabalan"); // I'm typing and don't want to type the text since irrelevante
  9.     }
  10.     cJames.ChangeRoom(4, 690, 380, eDirectionLeft);
  11.   }
  12. // script continues
  13. }
  14.  

If you haven't spotter it yet, you never change this condition to false! Which means it keeps repeating (the changeRoom) and blocking the player from doing anything!

Add behind=false; before you change room, and it's fixed.  (roll)
« Last Edit: 05 Mar 2020, 23:43 by Cassiebsg »
There are those who believe that life here began out there...

Re: Mouse locked to Walk to Mode, blending in/out....??
« Reply #15 on: 06 Mar 2020, 01:36 »
Also the reason Khris that I wasn't immediately ready to post a clean script was the way you asked me.
You said, the only way you gonna help me is if I do this particular thing.
It felt more like trying to mâle me do things rater than an intention to help me.

You know, after the game stopped working, I spent several just trying to fix the problem.

You think I wouldn't take 5 minutes to clean the script?

You could've also said, that you'd be glad to help, but it would be easier for everyone to find a solution if the script was cleaner.
Instead of putting pressure on me.

So, I just so you know.

Clearly i'm not the only one drunk/on drugs on this forum. (laugh) It's a joke btw, cops please don't take me down, i dont use drugs. If you ask for help on this forum, they want the code to look at least somewhat clean. How could you not get that? Guys in here are amazing (Khris included) and you get butthurt cause he asks you for such a simple feat?! Come on man!

TheManInBoots

  • Epically wrote function to declare an int
Re: Mouse locked to Walk to Mode, blending in/out....??
« Reply #16 on: 06 Mar 2020, 12:23 »
Yeah, I might have over-reacted for the clean script and come across as a "drug addict".

I just don't like when things are said in a certain way.

Cassiebsg well thanks for looking into this.
I have blended out repeatedly execute functions before to see if it changed something, but it didn't for me.
So I will test that one specifically you mentioned and see if it works.
« Last Edit: 06 Mar 2020, 14:19 by TheManInBoots »

TheManInBoots

  • Epically wrote function to declare an int
Re: Mouse locked to Walk to Mode, blending in/out....??
« Reply #17 on: 06 Mar 2020, 23:26 »
Okay, checked it out, Cassiebsg.
That was the problem. Game works now.
Umm, guess upload now...

Re: Mouse locked to Walk to Mode, blending in/out....??
« Reply #18 on: 07 Mar 2020, 00:21 »
So, the fading cursor was because of repeated ChangeRoom call?
To think of it, the room transition might be "crossfade" or "dissolve"? I forgot to check that out, and it did not come to me that this might be the case.

TheManInBoots

  • Epically wrote function to declare an int
Re: Mouse locked to Walk to Mode, blending in/out....??
« Reply #19 on: 07 Mar 2020, 00:27 »
Exactly, that seems to be the reason.
It's crossfade.
« Last Edit: 07 Mar 2020, 00:30 by TheManInBoots »