Dialog Issue?[SOLVED]

Started by Axelord1942, Thu 09/04/2020 06:10:03

Previous topic - Next topic

Axelord1942

I guess? Not sure how to label this one. If I'm in the wring place please let me know. Yesterday I loaded up the editor and put in some work, tested the game and everything ran fine.

Today I open up the editor and hit F5 and it's telling me

Dialog 4(1): Error (line 1): Nested functions not supported (you may have forgotten a closing brace)

Dialog in question (nvm that line one has the default ags stuff in it and not mine)

Code: ags

 // Dialog script file
@S  // Dialog startup entry point
  Display("Hobo: 'I know what yer lookin fer!  I've seen it, yes I have.  Seen the stink coming off of them who pray to the unclean one!' ");
  Wait(20);
  Display("Hobo: 'If only I had a way to quench my terrible thirst...' ");
  
return
@1
  int ran=Random(100);
  
  if (ran <= 50)
  {
    Display("He chuckles raggedly.");
    Display("Hobo: 'It's the OIL COMPANIES!  They've been digging their dirty claws into our most sacred Mother Earth!  The very air is unclean!' ");
    Display("He rambles on as you realize your time and money have been wasted.");
    Funds -= 50;
  }
  else if (ran > 50)
  {
    Display("Hobo: 'I thank you, strangers.  Truly, these are worrisome times.  There's a junkyard I seen...I watch em shuffling in and out of there, late in the night when nothing stirs.  They are the UNCLEAN!' ");
    Display("GAINED INTEL.");
    object[3].Visible = true;
    Funds -= 50;
  }
  ListBox1.AddItem("-Hobo Encountered.");
stop
@2
  int ran=Random(100);
  
  if (ran <= 80)
  {
    Display("Hobo: 'I thank you, strangers.  Truly, these are worrisome times.  There's a junkyard I seen...I watch em shuffling in and out of there, late in the night when nothing stirs.  They are the UNCLEAN!' ");
    Funds -=100;
    object[3].Visible = true;
    Display("GAINED INTEL.");
  }
  
  else if (ran > 80)
  {
    Display("The man cackles gleefully as he runs off with your money.");
    Display("Finances won't be pleased.");
    Funds -=100;
  }
  ListBox1.AddItem("-Hobo Encountered."); 
stop
@3
  aRadiochirp.Play(eAudioPriorityLow,eOnce);
  cParty.SayBubble("Interrogation tactics authorized.");
  int ran=Random(100);
  
  if (ran <= 60)
  {
    Display("After a few moments, he cries out.");
    Display("Hobo: 'Okay! Okay!  I'll talk!  Please, spare this unworthy acolyte!  I have seen them moving in and out of a nearby junkyard.  I will tell you where it is!  Harm me no more!' ");
    object[3].Visible = true;
    Display("GAINED INTEL.");
  }
  else if (ran > 60)
  {
    Display("Despite continued aggression, the man only rambles incoherently.  Perhaps he doesn't know anything after all.");
    Agents += 1;
  }
  ListBox1.AddItem("-Hobo Encountered.");
  
stop
@4
  Display("One of your agents shoos the man off as your team continues on it's way.");
  ListBox1.AddItem("-Hobo Encountered.");
stop


Most of my dialogs have similar structure. I've gone through them and can't see what's different about this one.  Furthermore, I'd like to point out that I've made NO changes to this dialog in about a week.

Is my editor freaking out?  Or am I missing something obvious?  Using AGS 3.5.  I started this project on 3.4.1 I think? It updated fine and I've had no issues until now.
You have been eaten by a Gru

Cassiebsg

Problem is not necessarily on this one script. When AGS compiles the game it writes all functions in order, and if in the script that comes before this one (in the compile order) you forgot to close a bracket then you will get the error on the next script when AGS tried to add this new function to the list.

So my suggestion is to try locate the script that comes before and start from the bottom up and check for a function that might not be closed. Or just do that to the latest scripts you changed, since it's more likely for the culprit to be there.
There are those who believe that life here began out there...

Khris

The first place I'd look is Dialog 3's script, that's most likely directly above the posted one and missing a } at the end.

Crimson Wizard

Quote from: Cassiebsg on Thu 09/04/2020 09:36:13
Problem is not necessarily on this one script. When AGS compiles the game it writes all functions in order, and if in the script that comes before this one (in the compile order) you forgot to close a bracket then you will get the error on the next script when AGS tried to add this new function to the list.

Clarification: above refers only to the dialog scripts. All the dialogs are converted into regular script and merged for compilation (this is done internally in the editor, and cannot be seen by user).

Laura Hunt

QuoteDisplay("One of your agents shoos the man off as your team continues on it's way.");

its*

Axelord1942

Quote from: Cassiebsg on Thu 09/04/2020 09:36:13
Problem is not necessarily on this one script. When AGS compiles the game it writes all functions in order, and if in the script that comes before this one (in the compile order) you forgot to close a bracket then you will get the error on the next script when AGS tried to add this new function to the list.

So my suggestion is to try locate the script that comes before and start from the bottom up and check for a function that might not be closed. Or just do that to the latest scripts you changed, since it's more likely for the culprit to be there.

Ohhhhh....this actually makes a lot more sense.  I'll get right on it!

Quote from: Laura Hunt on Thu 09/04/2020 11:54:46
its*
Thank you!  English isn't my native tongue and i get those two mixed up still!
You have been eaten by a Gru

Laura Hunt

Quote from: Axelord1942 on Thu 09/04/2020 13:08:14
Quote from: Laura Hunt on Thu 09/04/2020 11:54:46
its*
Thank you!  English isn't my native tongue and i get those two mixed up still!

lol no worries, most native English speakers don't seem to know the difference either :-D

TheManInBoots

#7
Remembers me of good old high school times...

Maybe instead of
"Please, spare this unworthy acolyte!"

a better version would be
"Please, spare me unworthy acolyte!"

Since acolyte is already not a word used everyday, people will better understand from context what you mean this way.

SMF spam blocked by CleanTalk