Hi there,
I'm getting back into AGS after having last used it over 5 years ago (Yikes!) for a university project. Now I'm hoping to construct an actual game where the player is a judge in a court of law. See this thread for more information. (http://www.adventuregamestudio.co.uk/forums/index.php?topic=48593.0)
I'll stick to using this thread for any technical queries I have - any help is appreciated.
1. Dialog after entering a room. The first trial begins in the court room, here's the room script:
--
if (case1_start == true)
Ace_Attorney_Court_Suite.Play();
{Display("Welcome to the courtroom.");
SenJudge.ChangeRoom(2, 250, 650);
{Display("A Senior Judge approaches you.");
d1SenJudge.Start();
SenJudge.ChangeRoom(0, 250, 650);
{Display("You switch on the court's computer system.");}
Computer.ChangeRoom(2, 250, 650);
}
}
}
--
I'm moving the player to the main court room, playing some music (It's placeholder) and want to have a senior judge character appear (It's just a static image), he speaks his dialog script and then leaves. A computer 'character' will then appear for the player to interact with so they can do their research and the trial can begin.
However, at the moment the dialog is happening _after_ the other parts (The judge moves to another room, the display message about the computer appears). The dialog file is just a series of text displays followed by a 'stop'.
I've had a look through the help file and tried different functions but nothing works so far. I've now realised that with the dialog:
"NOTE: The conversation will not start immediately; instead, it will be run when the current script function finishes executing."
How can I get around that?
Nevermind, got it. I TRIED putting the script commands into the dialog, but didn't realise I had to do the single space indentation to set them up.
I'm sure I'll have more queries tomorrow, stay put...
Just a reminder. You may enclose codes between the [code=AGS][/code] tags to preserve the indentation of your codes so that they're more readable. This is especially useful when the code snippet is relatively long.
Like this:
if (a == b) {
Display("Hello");
if (c == d) {
e++;
d=d-1;
}
}
Quote from: Magic on Sun 14/07/2013 20:41:42if (case1_start == true)
Ace_Attorney_Court_Suite.Play();
{Display("Welcome to the courtroom.");
SenJudge.ChangeRoom(2, 250, 650);
{Display("A Senior Judge approaches you.");
d1SenJudge.Start();
SenJudge.ChangeRoom(0, 250, 650);
{Display("You switch on the court's computer system.");}
Computer.ChangeRoom(2, 250, 650);
}
}
}
Code indentation isn't just some "thing" that people do because they're weird either. The curly braces are used to denote separate blocks of code, such as a function, or code that is run conditionally based on an if-else statement. Indentation helps you see at a glance what logical code block any given line belongs to. Here's your code again:
if (case1_start == true) Ace_Attorney_Court_Suite.Play(); // single command run conditionally
{ // redundant opening brace, does nothing (1)
Display("Welcome to the courtroom.");
SenJudge.ChangeRoom(2, 250, 650);
{ // another redundant opening brace, also doing nothing (2)
Display("A Senior Judge approaches you.");
d1SenJudge.Start();
SenJudge.ChangeRoom(0, 250, 650);
{ // and another still, again, doing nothing (3)
Display("You switch on the court's computer system.");
} // not-quite-redundant closing brace, required by (3)
Computer.ChangeRoom(2, 250, 650);
} // closing brace, required by (2)
} // closing brace, required by (1)
} // ...erm... the closing brace of the function? for this given snippet, this is an (apparently) extra closing brace
With the redundant braces removed, let's look at that code one more time:
if (case1_start == true) Ace_Attorney_Court_Suite.Play(); // single command run conditionally
Display("Welcome to the courtroom.");
SenJudge.ChangeRoom(2, 250, 650);
Display("A Senior Judge approaches you.");
d1SenJudge.Start();
SenJudge.ChangeRoom(0, 250, 650);
Display("You switch on the court's computer system.");
Computer.ChangeRoom(2, 250, 650);
As we can now more clearly see, all of these commands except playing the audio command are to be run every time the enclosing function is called. What you probably want is something closer to this:
// room script
function room_Load() // or whichever function this belongs to...
{ // opening brace of function (1)
if (case1_start == true)
{ // opening brace for condition, creates separate block of code to be run conditionally (2)
Ace_Attorney_Court_Suite.Play();
Display("Welcome to the courtroom.");
SenJudge.ChangeRoom(2, 250, 650);
Display("A Senior Judge approaches you.");
d1SenJudge.Start();
} // closing brace for conditional block (2)
} // closing brace for function (1)
// dialog script for d1SenJudge
// upon exiting the dialog...
SenJudge.ChangeRoom(0, 250, 650); // indentation in a dialog script means it's a normal scripting command
Display("You switch on the court's computer system.");
Computer.ChangeRoom(2, 250, 650);
case1_start = false; // you may be updating this elsewhere, but this may be a good place for it
stop
This actually causes the entire scene to be run conditionally, based on the value of case1_start. Your original snippet was only playing the sound conditionally, which if that's what you wanted was correct, but it seemed as though this was the desired behavior. In either case, you should consider looking through the scripting tutorial in the manual, or maybe even a C++ tutorial online, if only to get a grasp on how braces should be used. Throwing them into your code at random points doesn't accomplish anything, and makes your code significantly less readable.
Also, welcome back from the hiatus. :)
Quote from: monkey_05_06 on Mon 15/07/2013 07:54:18
Code indentation isn't just some "thing" that people do because they're weird either.
You haven't thought that Magic probably
did indentation, but that was ignored because he did not put the code in [ code ] tags?
The forums don't clip spaces, and they actually replace tabs with spaces. So no, that code was never indented.
And you maybe should have tested that before speculating...
Hmm, I believed I saw how it removes preceding spaces. Sorry.
No, he's right, I didn't do indentation. I don't come from a programming background, but that doesn't excuse the habit. I'll try to keep it neat and tidy. Thanks guys. I'll be doing some more work on my prototype today, I'll post any other queries.
1. To clear up my last query: so as you've seen I'm moving the player to the court room, having a character talk to them and setting things up in the dialog script (because the dialog will appear last otherwise) so the player can then do stuff in the room such as reading over the case file and use the court computer.
Is that the best way to do it or should I set an integer to flag that the dialog is finished so I can return the code to the Room Script?
2. Can I safely edit the default GUI so to include icons which lead to two rooms? i.e. The Case File is a description of the current case while the Computer is used to select witness testimony. Rather than constantly put the sprites on the screen, I could take the player to another room and they can select information related to the current case.
I don't need full details on how to do this, just any of your thoughts. I need to work some things out on my own. ;)
Quote from: Crimson Wizard on Mon 15/07/2013 08:35:24Hmm, I believed I saw how it removes preceding spaces. Sorry.
No harm, no foul. No worries about it. AFAIK, the forums will truncate the
displayed text if there are multiple whitespaces, but the original text should still be preserved.
I'll test this now by indenting this line of text by six whitespaces. (
Edit: Seems like even the displayed text isn't truncated. That may have been a "feature" of the older SMF. I definitely recall a time when I had to use PRE tags to prevent the very behavior you were describing. Oh well! The more we both know!)
Quote from: Magic on Mon 15/07/2013 09:00:16No, he's right, I didn't do indentation. I don't come from a programming background, but that doesn't excuse the habit. I'll try to keep it neat and tidy. Thanks guys. I'll be doing some more work on my prototype today, I'll post any other queries.
I figured as much, and I haven't seen you posting slews of unindented code. That's why I figured I'd be nice and try and explain it. ;) But now that you've been warned, I'll just let you know I am somewhat of an indentation Nazi, and I've been known to refuse to help coders because of nonexistent or inconsistent indentation. You can Google code indentation styles and find one you like. So long as it's consistent then I won't get pissy about it. :P
Quote from: Magic on Mon 15/07/2013 13:37:201. To clear up my last query: so as you've seen I'm moving the player to the court room, having a character talk to them and setting things up in the dialog script (because the dialog will appear last otherwise) so the player can then do stuff in the room such as reading over the case file and use the court computer.
Is that the best way to do it or should I set an integer to flag that the dialog is finished so I can return the code to the Room Script?
This actually reminds me of when I first delved into scripting in AGS. I was creating my own flags and redirecting code all over the place. It was horrible. As far as I'm concerned now, unless you have a specific reason to handle the code elsewhere, just handle it where you'd be setting the flag at (in this case, the dialog script). If you feel like you'll forget where half the code is at, add a comment like "// remaining interactions in dialog script". Don't be afraid to put comments in your code. The more you comment, the better off you'll be when you come back to that script file three months, six months, or a year from now. They don't get compiled, so comments don't bloat your games file size, and they (ideally) help you remember what is going on in the code. Getting in the practice of commenting your code early on will only help
you in the long run. ;)
Quote from: Magic on Mon 15/07/2013 13:37:202. Can I safely edit the default GUI so to include icons which lead to two rooms? i.e. The Case File is a description of the current case while the Computer is used to select witness testimony. Rather than constantly put the sprites on the screen, I could take the player to another room and they can select information related to the current case.
You can safely do pretty much whatever you want. If you're worried about breaking the GUI scripts, you can always start a new project from the same template to go back to the original source. Better even than that, if you're not sure that your new code is going to work and want to have a back-up plan, you can use a block comment around the existing code:
function gInterface_OnClick
{
/* start a block comment with "/*"
any existing code here will be commented
*/ // end a block comment with "*/" (here we also used a line comment, because the block comment ends at the first "*/")
}
As for the GUI itself, you can export it before you make your changes. So my advice - don't be afraid to tinker! It's not like AGS is going to push your HDD's self-destruct button. I mean, it could try, but it doesn't even have hands! :-D Edit the GUIs to be whatever you need it to be. From what you describe though, you may even want to consider using another GUI rather than sending the player to another room. You can have GUIs that only pop-up when you tell them to, for menus or "selecting information".
Quote from: Magic on Mon 15/07/2013 13:37:20I don't need full details on how to do this, just any of your thoughts. I need to work some things out on my own. ;)
Check it out, and let us know if you need help putting it together! And your effort is duly noted and appreciated. That's the kind of member that myself and Khris like to see around the beginner's forum. :=
Thanks again monkey. I'd say I feel guilty for taking up this much of your time, but I can tell you're voluntarily doing so. ;)
I'm not naturally a tidy person, my hand writing is terrible (But I do have solid form when typing) and I don't keep my home especially tidy. I'm also someone who makes daft little mistakes in code so I can appreciate that keeping comments in my code will be worthwhile.
Inventory\GUI: I'll give that a try sometime. At the moment getting a prototype up and running is my priority. I could keep them as room objects or I could just make them inventory objects or I could customise the GUI. We'll see.
The first trial is about 75% done, I've somehow spent half of today on it (11AM to 5PM, wow) but a lot of that was experimenting and finding solutions to some parts.
I've got some more quick queries:
1. Is there an easy way to do line breaks in, say, a narrator's text box? I can't find a straight forward method on the forum so far.
In this instance I have a profile for the judge to read and I would like it displayed like this rather than separate boxes:
"Name: Person
Age: 22"
2. Is there a way to have a character speak one line of dialog within a room script? Not crucial, I can use the narrator (Old Sierra games did this - ' "Hey!" says the drunk "Leave me alone!" ').
3. Is there an easy way to call the user's own date into a conversation? Not crucial, I just think it would be neat to use the current date for a trial.
I may have something to show you guys tomorrow. :)
1. Use [
Display("Name: Person[Age: 22");
2. The Character.Say command:
player.Say("Hello there!");
cSomeguy.Say("Hello yourself!");
3. Check the manual's DateTime functions:
DateTime *dt = DateTime.Now;
Display("Current time: %02d:%02d", dt.Hour, dt.Minute);
I recommend reading though the manual's Scripting reference at least once. Not the entire text, just the lists of functions and properties, to get a feel for what AGS can do and where you need to look for a specific command.
Thanks for your help too, Kris.
1. Dialog Lists: Great, thank you.
2. Character.Say: That seems to work but the character doesn't appear.
At present I have single static images of a character portrait (Think Sierra) to show when each speaks. There's one frame for the view which is assigned to each character. Is there a way to show their portrait or will I need to move the character to the room each time they talk there? In the case of a bailiff character, I may have him commenting to the player at different times (In the court room, judge's chambers, etc).
If I have to move him between rooms, that's not a problem.
3. Date and Time:
I can't get that to work:
DateTime *dt = DateTime.Now;
Display("The date is %02d:%02d", dt.Hour, dt.Minute" for the case of McCarthy vs. Hargreaves.");
I've played around with the quotation marks but get error:
Failed to save room room5.crm; details below
room5.asc(15): Error (line 15): Parse error in expr near 'dt'
4. New: If Player has inventory during Dialog
If the player has an item in their inventory, I want to enable a new dialog option.
@5
EGO: Do you believe your workmanship was of a high standard?
C1Hargreaves: Of course, Your Honour. I did what I said I'd do - I put in those kitchen units.
if (EGO.HasInventory(C1_Photo1)) {
EGO.Say("You recall that you have photos of the kitchen following Hargreave's work and consider asking him about them.");
option-on 6
return RUN_DIALOG_RETURN;
}
return
I've tinkered with this and followed it from the AGS help file but get:
Dialog 4(27): Error (line 27): Parse error in expr near '0.'
Any ideas?
4.
I'm not familiar with dialogs but the problem seems to be you using the dialog command "dialog-on" within script code block. You should instead use the Dialog.SetOptionState() (http://www.adventuregamestudio.co.uk/manual/ags51.htm#dialog.setoptionstate) option.
So it should be something like:
@5
EGO: Do you believe your workmanship was of a high standard?
C1Hargreaves: Of course, Your Honour. I did what I said I'd do - I put in those kitchen units.
if (EGO.HasInventory(C1_Photo1)) {
EGO.Say("You recall that you have photos of the kitchen following Hargreave's work and consider asking him about them.");
dialog[5].SetOptionState(6, eOptionOn);
return RUN_DIALOG_RETURN;
}
return
Doh, makes perfect sense. I've modified it but I'm still getting that parse message:
@5
EGO: Do you believe your workmanship was of a high standard?
C1Hargreaves: Of course, Your Honour. I did what I said I'd do - I put in those kitchen units.
if (EGO.HasInventory(C1Photo1)) {
EGO.Say("You recall that you have photos of the kitchen following Hargreave's work and consider asking him about them.");
dialog[4].SetOptionState(6, eOptionOn);
return RUN_DIALOG_RETURN;
}
return
I've modified the inventory item to C1Photo1 as a test but it's the same. The item is a standard one as far as I'm aware, with an inventory image, the 'Description' and 'Name' are both the aforementioned 'C1Photo1'.
If I understand correctly, you can't do it like that in dialogs, it'd have to be something like:
@5
EGO: Do you believe your workmanship was of a high standard?
C1Hargreaves: blah
run-script 1
return
And in Global:
function dialog_request(int param)
{
if (param == 1) {
// put your conditions here
}
param = 1 being script 1. Hope that helps?
First of all: you need to work with the manual more.
If you're getting a parse error when using a command, look it up. In the manual entry for Display is a link to the string formatting section, which contains this at the very beginning:
QuoteThis means that you intersperse your text with special codes to insert a variable's value. These special codes begin with a percent sign, and then specify the variable type. The actual variables that you want to display are then listed afterwards.
Thus:
Display("The date is %02d:%02d for the case of McCarthy vs. Hargreaves.", dt.Hour, dt.Minute);
(Nevermind for now that you're still using the hour and minute, not month and day.)
Regarding your problem with the inventory item inside the dialog script:
As soon as you have typed the first three letters of any object or function or whatever, a window will pop up and suggest existing stuff from your game, like for instance inventory items.
I don't get how people do not use this, sorry. It's pretty much impossible to get the spelling of something wrong that way. The relevant entry is the script name, the one you entered in the inventory item's properties under Design/Name. The Appearance/Description one is the one the player is going to see. As an example: Name would be "iBlueCup" and Description would be "blue cup".
Also please ignore Sunny Penguin's reply since using dialog_request has been obsolete for years now.
Quote from: Khris on Tue 16/07/2013 17:51:56Also please ignore Sunny Penguin's reply since using dialog_request has been obsolete for years now.
Only since
2008, I mean...that was practically yesterday.
Quote from: Pumaman on Wed 24/12/2008 14:02:32On this merry Christmas Eve, it gives me great pleasure to announce the release of AGS 3.1.1.
Changes since v3.1 are as follows:
* Added support for running normal scripts as part of dialog scripts, and thus obsoleted the run-script, dialog_request business
As to the issue of calling "Dialog.SetOptionState", you could also use the dialog script command "option-on" but you have to remember that dialog script commands are not indented
in dialog scripts, normal scripting commands are. This is a special case where indentation
should be used for something other than separating blocks of code, but if you have conditionals or loops in a dialog script then normal indentation rules should still be applied.
And yes, Khris, I agree that a firm introduction to Artie Effim (best known by his initials, RTFM) is in order. Or maybe even, dare I say it... RTFHTRTFMM (http://www.adventuregamestudio.co.uk/forums/index.php?topic=35766.msg468782#msg468782). := (Just don't take it too personally Magic, it's the same process I tell everyone to follow :P)
Quote from: monkey_05_06 on Wed 17/07/2013 04:20:48
As to the issue of calling "Dialog.SetOptionState", you could also use the dialog script command "option-on" but you have to remember that dialog script commands are not indented in dialog scripts, normal scripting commands are.
I've never tried but that dialog-on line of the codes here was
inside a if-code block using AGSScripts, so dialog script commands shouldn't be used there right?
The parser correctly allows you to alternate back and forth, even inside of nested blocks. However, it's worth noting that the parser also treats @1 (where 1 is any option number) and return/stop/goto-dialog/goto-previous the same as a set of matching curly braces, so you can't put "return" (etc.) inside an if/else/while block (which is precisely why CJ implemented the special macros like RUN_DIALOG_RETURN, RUN_DIALOG_STOP, and RUN_DIALOG_GOTO_PREVIOUS).
// dialog script
@1
if (condition)
{
cEgo.Say("This is okay!");
EGO: And so is this!
//return // but NOT this! uncomment for error!
return RUN_DIALOG_RETURN; // this is the functional equivalent of the dialog command return, but you can put it inside of the braces here
}
stop // okay :)
Edit: I always forget about those special macro return values that CJ implemented. Although I'm curious, is Dialog.Start the correct functional equivalent of goto-dialog? That's something I feel like I've tested before, but I don't recall if that properly chains the dialogs in the same fashion.
Quote from: Khris on Tue 16/07/2013 17:51:56
First of all: you need to work with the manual more.
If you're getting a parse error when using a command, look it up. In the manual entry for Display is a link to the string formatting section, which contains this at the very beginning:
QuoteThis means that you intersperse your text with special codes to insert a variable's value. These special codes begin with a percent sign, and then specify the variable type. The actual variables that you want to display are then listed afterwards.
Thus:
Display("The date is %02d:%02d for the case of McCarthy vs. Hargreaves.", dt.Hour, dt.Minute);
(Nevermind for now that you're still using the hour and minute, not month and day.)
I'm gradually working my way the manual, but I did base it off what you told me in this thread, I assumed that would be enough.
QuoteRegarding your problem with the inventory item inside the dialog script:
As soon as you have typed the first three letters of any object or function or whatever, a window will pop up and suggest existing stuff from your game, like for instance inventory items.
I don't get how people do not use this, sorry. It's pretty much impossible to get the spelling of something wrong that way. The relevant entry is the script name, the one you entered in the inventory item's properties under Design/Name. The Appearance/Description one is the one the player is going to see. As an example: Name would be "iBlueCup" and Description would be "blue cup".
Yes, I've kept the inventory item name simple - in this instance I have 'C1Photo1' but I'm still getting the error. The spelling is not the issue here.
Quote from: monkey_05_06 on Wed 17/07/2013 04:20:48
Quote from: Khris on Tue 16/07/2013 17:51:56Also please ignore Sunny Penguin's reply since using dialog_request has been obsolete for years now.
Only since 2008, I mean...that was practically yesterday.
That actually was when I last used AGS. I actually have a stored version of it from back then in case I want to update my uni project... :D
Quote from: Pumaman on Wed 24/12/2008 14:02:32
As to the issue of calling "Dialog.SetOptionState", you could also use the dialog script command "option-on" but you have to remember that dialog script commands are not indented in dialog scripts, normal scripting commands are. This is a special case where indentation should be used for something other than separating blocks of code, but if you have conditionals or loops in a dialog script then normal indentation rules should still be applied.
And yes, Khris, I agree that a firm introduction to Artie Effim (best known by his initials, RTFM) is in order. Or maybe even, dare I say it... RTFHTRTFMM (http://www.adventuregamestudio.co.uk/forums/index.php?topic=35766.msg468782#msg468782). := (Just don't take it too personally Magic, it's the same process I tell everyone to follow :P)
I'm still getting back to speed on AGS so please excuse me. And hey, my original project was an IT Technician sim, complete with a poster with "RTFM" on it in the game's IT department.
I've read through the last few posts several times but I'm still at a loss here. The inventory item is correctly referenced. The return dialog is using aforementioned return macro. What do I need to do?
@5
EGO: Do you believe your workmanship was of a high standard?
C1Hargreaves: Of course, Your Honour. I did what I said I'd do - I put in those kitchen units.
if (EGO.HasInventory(C1Photo1)) {
EGO.Say("You recall that you have photos of the kitchen following Hargreave's work and consider asking him about them.");
dialog[4].SetOptionState(6, eOptionOn);
return RUN_DIALOG_RETURN;
}
return
Quote from: Magic on Tue 16/07/2013 14:52:364. New: If Player has inventory during Dialog
If the player has an item in their inventory, I want to enable a new dialog option.
@5
EGO: Do you believe your workmanship was of a high standard?
C1Hargreaves: Of course, Your Honour. I did what I said I'd do - I put in those kitchen units.
if (EGO.HasInventory(C1_Photo1)) {
EGO.Say("You recall that you have photos of the kitchen following Hargreave's work and consider asking him about them.");
option-on 6
return RUN_DIALOG_RETURN;
}
return
I've tinkered with this and followed it from the AGS help file but get:
Dialog 4(27): Error (line 27): Parse error in expr near '0.'
Any ideas?
I think myself and Khris got a bit caught up in our snarkiness and didn't catch the real issue here.
When you start a new game, by default the first character is assigned the script name
cEgo. For any Character whose script name starts with
c, AGS automatically (for legacy purposes) generates a macro with the remainder of the Character's name in all caps and the value of the Character's ID. So, for
cEgo AGS will generate a macro named
EGO with the value of 0 (zero, the first character's ID).
In
dialog scripts you use
either the macro-style name or the real script name:
// dialog script
@1
EGO: Hello // macro-style name
cEgo: World! // real script name
stop
In
normal scripts (including indented dialog scripts, which are parsed as normal scripting commands) the macro is evaluated by the preprocessor and replaced with the Character's ID. So if you use the macro name in a normal script:
// GlobalScript.asc, inside some function
EGO.Say("blah blah blah");
You will get an error:
QuoteError (line 27): Parse error in expr near '0.'
This is because what you're really doing by using the macro name is this:
// GlobalScript.asc, inside some function
0.Say("blah blah blah");
AGS doesn't treat integer-literals as objects, so you obviously can't call a Say function on one.
In normal scripts you should always use the real script name, not the macro name:
// GlobalScript.asc, inside some function
cEgo.Say("blah blah blah");
By extension, this applies to any indented lines in a dialog script. So, finally, your dialog script should now look something like this:
@5
EGO: Do you believe your workmanship was of a high standard?
C1Hargreaves: Of course, Your Honour. I did what I said I'd do - I put in those kitchen units.
if (cEgo.HasInventory(C1Photo1)) {
cEgo.Say("You recall that you have photos of the kitchen following Hargreave's work and consider asking him about them.");
dialog[4].SetOptionState(6, eOptionOn); // alternately undent and use "option-on 6", presuming this is dialog 4
return RUN_DIALOG_RETURN;
}
return
The defacto standard for script names of Characters in AGS is to prepend the name with a lower-case 'c'. From AGS 2.7 through 2.72 this was handled automatically. AGS 3.0 and onward have allowed you to specify the full script name of things, but it's still customary to have cCharactername vs just Charactername. To help prevent confusion though, I'd suggest avoiding the macro names altogether, even in dialog scripts, and just stick to using the script name.
On that note, though it's not required, some customary naming conventions for (
global) things in AGS (entirely preferential, so find what works best for you):
AudioClips:
aAudioclipname
Characters:
cCharactername
Dialogs:
dDialogname
Enumerated values:
eEnumvaluename
GUIs:
gGuiname
GUI Buttons:
btnButtonname
GUI InvWindows:
invInvwindowname
GUI Labels:
lblLabelname
GUI ListBoxes:
lstListboxname
GUI Sliders:
sldSlidername
GUI TextBoxes:
txtTextboxname
Hotspots:
hHotspotname
InventoryItems:
iInventoryitemname
Objects:
oObjectname
Again, you don't have to name things this way, but it helps keep things somewhat organized, as well as helping identify what the thing is by its name. ;)
Dang, I was looking through the script for a constant with value 0, but completely missed the "EGO" part of EGO.HasInventory().
Magic:
Quote from: Magic on Wed 17/07/2013 21:10:34I'm gradually working my way the manual, but I did base it off what you told me in this thread, I assumed that would be enough.
But, you got a specific parse error when you changed the Display() content, right? So it obviously
wasn't enough. You don't get to ask stuff like that while everybody else is referred to the manual, not even if you had coded AGS's game of the year in 2008. There is no excuse for not checking the manual first.
Quote from: monkey_05_06 on Wed 17/07/2013 21:41:07
Quote from: Magic on Tue 16/07/2013 14:52:364. New: If Player has inventory during Dialog
If the player has an item in their inventory, I want to enable a new dialog option.
@5
EGO: Do you believe your workmanship was of a high standard?
C1Hargreaves: Of course, Your Honour. I did what I said I'd do - I put in those kitchen units.
if (EGO.HasInventory(C1_Photo1)) {
EGO.Say("You recall that you have photos of the kitchen following Hargreave's work and consider asking him about them.");
option-on 6
return RUN_DIALOG_RETURN;
}
return
I've tinkered with this and followed it from the AGS help file but get:
Dialog 4(27): Error (line 27): Parse error in expr near '0.'
Any ideas?
I think myself and Khris got a bit caught up in our snarkiness and didn't catch the real issue here.
Ah, of course. Got it. It's the same mistake as the lack of indentation earlier for certain commands in the dialog script. It works now, thanks a lot! :)
That concludes my main queries - I should be able to finish off the prototype. The only other part I can think of is a in some dialog where each of the 4 answers from the player leads to the same result so rather than copy and paste the same dialog into each I'll try to re-direct them. I'll try to work that out myself though. Probably a variable or such.
Quote from: Khris on Thu 18/07/2013 09:35:16
Dang, I was looking through the script for a constant with value 0, but completely missed the "EGO" part of EGO.HasInventory().
Magic:Quote from: Magic on Wed 17/07/2013 21:10:34I'm gradually working my way the manual, but I did base it off what you told me in this thread, I assumed that would be enough.
But, you got a specific parse error when you changed the Display() content, right? So it obviously wasn't enough. You don't get to ask stuff like that while everybody else is referred to the manual, not even if you had coded AGS's game of the year in 2008. There is no excuse for not checking the manual first.
. . .
Yay, I FUCKING LOVE PASSIVE AGGRESSIVENESS!