[RESOLVED TY] Cutscene - will not run through

Started by zombard, Sun 07/09/2025 20:45:59

Previous topic - Next topic

zombard

Hi, this is my first post so please be gentle lol

I have the below programmed in my testing file, but Roger just stands there.
Coordinates are on a walkable part, but that should be covered by eAnywhere. So I'm not sure what's happening.

Code: ags
function room_AfterFadeIn()
{
  StartCutscene(eSkipMouseClick);
  player.Walk(63, 142,  eAnywhere);
  dD1.Start();
  EndCutscene();
  //oCup.Clickable = 0;
}


My ultimate attempt is to ensure that  //oCup.Clickable = 0; in the actual game I have lol. I have that turned off currently to check that the cutscene can run.


For reference, this is the actual game I'm trying to make.
This one, the cutscene runs fine.
I have looked over both files to see what this one has that Roger is missing but, no luck.


Code: ags
function room_FirstLoad()
{
  aExt_mp3.Play(eAudioPriorityNormal);
  StartCutscene(eSkipMouseClick);
  
  player.Walk(570, 493);
  cE.Walk(662, 468,  eBlock);
  dIntro.Start(); 
  EndCutscene();
  cE.FollowCharacter(cCel, 70, 10);
 // oRope.Clickable = 0;
}

Crimson Wizard

The default BlockingStyle for Walk is eNoBlock, which means that the game will not wait until the character finishes walking, but keeps running the script. Next script command starts the dialog, it seems. So the dialog will be started before the character makes even one step.

In your second code example you're using eBlock, but in wrong place. All parameters must match their order:

Code: ags
player.Walk(63, 142, eAnywhere, eBlock);

zombard

@ Crimson Wizard
Thank you. I copied that directly in but Roger still stares vacantly and doesn't move. ):

Code: ags
function room_AfterFadeIn()
{
  StartCutscene(eSkipMouseClick);
  player.Walk(63, 142, eAnywhere, eBlock);
  dD1.Start();
  EndCutscene();
  //oCup.Clickable = 0;
}

Rik_Vargard

#3
I think the right line would be in this order:

Code: ags

player.Walk (63, 142, eBlock, eWalkableAreas); 

// Notice that eBlock comes first
// or use eAnywhere instead of eWalkableAreas if you wish so


Crimson Wizard

Right sorry, blocking style goes first, so your second variant was actually correct.

If that still does not work, then question is: does this function run at all? Do you see the Dialog starting?
If nothing happens at all, then the high chance is that you did not connect the function to event here:
https://adventuregamestudio.github.io/ags-manual/images/acintro3_05.png


zombard

Quote from: Crimson Wizard on Sun 07/09/2025 22:02:03Right sorry, blocking style goes first, so your second variant was actually correct.

If that still does not work, then question is: does this function run at all? Do you see the Dialog starting?
If nothing happens at all, then the high chance is that you did not connect the function to event here:
https://adventuregamestudio.github.io/ags-manual/images/acintro3_05.png



dear god that was it

i keep building the code and forgetting that.

thank you so much!!

zombard

follow up question.

Let's say I clicked the events icon, populated the function into the globalscript and then deleted it all from the globalscript.
the events icon still shows "..." and trying to retype it doesn't make that function work.
is this just an "sol don't delete that" lesson?

Crimson Wizard

Quote from: zombard on Sun 07/09/2025 22:09:11dear god that was it

i keep building the code and forgetting that.

Question: which version of AGS are you using right now?

Starting with AGS 3.6.2 the Editor should display warnings if there are script functions that look like event handlers, but not connected to actual events.
These are meant to bring your attention to this problem.

Quote from: zombard on Sun 07/09/2025 22:46:45Let's say I clicked the events icon, populated the function into the globalscript and then deleted it all from the globalscript.
the events icon still shows "..." and trying to retype it doesn't make that function work.
is this just an "sol don't delete that" lesson?

Sorry, I dont fully understand, what are you trying to retype, and how is it not working?

zombard

v3.6.1 - I'll go on the site and update it now.

Does this make more sense? ) :
Let's say I go into the global script and type
function iCup_Look(InventoryItem *theItem, CursorMode mode)
{display("it's a cup");}

then go and click on the lightning bolt for the events manager ?

does it know to automatically associate what I typed before with the event?
(downloading the update so maybe there won't be any issues going forward haha)

Crimson Wizard

Quote from: zombard on Sun 07/09/2025 23:16:56Let's say I go into the global script and type
function iCup_Look(InventoryItem *theItem, CursorMode mode)
{display("it's a cup");}

then go and click on the lightning bolt for the events manager ?

does it know to automatically associate what I typed before with the event?

Oh, I see now.
It does not matter which order you typed here and there, what matters is whether the function name in the events fields matches the function name in script.
The "..." button is visible always. If you press it, and the function does not exist in script, then the editor should generate one. If it does exist, then the editor should go there.

SMF spam blocked by CleanTalk