Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - Jessiekah

#1
Ah ha! Thank you very much, just tested and works perfectly, Much appreciated and thanks very much for the swift reply =]

I re-checked the tutorial as soon as you said to see if i had missed this coz its not something i would usually miss... and after rechecking it does not state that you need the extra pair... Iether that or it deffinatly does not state it clearly

Thanks again ^.^

Jess
#2
Hio all

I am a new user to AGS, i started about 1 week ago and have slowly made my way through the beinners tutorial throughout the past week. I finished the tutorial earlyer today and have gone onto reading everything inthe help section in order, i have just started on the "Scripting" section on "Scripting Tutorial Part 1".

I have followed the instructions and what its said and checked + re-checked, and also experimented with the code myself. However i can not figure out what is going wrong

Any help with this would be much appreciated. Details of the problem below

------------------------------------------------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------------------------------------------------
My hand written script
================
// room script file
int vDoor1Look ;

function hDoor1_Look()
//Displays messege when using the "look" tool on the specified hotspot

if (vDoor1Look == 0)
{
  Display("You see a door.") ;
}

if (vDoor1Look == 1)
{
  Display("On closer inspection you see a small keyhole on the large and omnouse door.") ;
}
if (vDoor1Look == 2)
{
  Display("You try to open the door only to find that it is locked.") ;
}
if (vDoor1Look == 3)
{
  Display("There is nothing left of interest") ;
}
if (vDoor1Look <3)
{
  vDoor1Look += 1 ;
}
----------------------------------------------------
Error Given By Consol On F5 Run Attempt
=============================
Failed to save room room1.crm; details below
room1.asc(4): Error (line 4): Expected '{'

------------------------------------------------------
Relevant sections given by Scripting tutorial
==============================
1.) "So, to declare a variable for use by one of the room interaction scripts, you need to place the definition above the main function body.  So, it should look something like this:
// room script file
int myCounter;

(other event scripts)

function hDoor_Look()
{
  Display("It's quite a large, ominous looking door.");   
}     

(rest of file follows)"

2.) "You can add to and subtract from a variable using the += and -= operators. So, to add 3 to the current value of myCounter, do the following:

  myCounter += 3;"

3.) " if (myCounter == 0)
  {
    Display("You see a bookshelf.");
  }
  if (myCounter == 1)
  {
    Display("Looking closer, you see a book called Hamlet."); 
  }
  if (myCounter == 2)
  {
    Display("There is also a book called Harry Potter.");
  }
  if (myCounter == 3)
  {
    Display("There is nothing else of interest on the shelf."); 
  }
  if (myCounter < 3)
  {
    myCounter += 1;
  }


myCounter starts off set to 0, so the first time this script is called it will run the first Display command, but not the others. Then, since 0 is less than 3, it will increase myCounter by 1, and since 0+1 = 1 it now holds the value 1.
Once the player has seen all the messages (myCounter == 3), it no longer increases the value so if they click again they will keep getting the final message."
------------------------------------------------------------------------------------------------------------------------------------------------------
===================================================================================

As previously stated i HAVE read all the relevant sections in the tutorial but i cannot figure out what is wrong with my syntax. I'm thinking im missing something due to the layout that the tutorial presents the code. This post is lengthy, but i pasted the relevant sections to save time for those who want to read the tutorial i am doing without having to go load it up themselves.

Thanks very much in advance

Jess
SMF spam blocked by CleanTalk