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

Topics - Global Lint

#1
I found an error I'm not sure how to fix, because I don't know what it refers to.  While testing my game, upon entering room 10, the game crashes, and an AGS warning box pops up and says:

"An internal error has occurred... ACI version 3.12.1074...Error: prepare_script: error -18 (no such function found in script) trying to run '1'  (Room 10)"

I have no idea what this means...

// room script file
function on_call (int reason) {
  if (Parser.Said("look")) {
    Display("You're about a field away from Pidge's house. There's a phonebooth here. The path leads west to Tom Cusack's and east back to Pidge's house.");
  }
  else if (Parser.Said("[go] east")) {
    player.ChangeRoom(9);
  }
  else if (Parser.Said("look phone")) {
    Display("It's big and red.");
  }
  else if (Parser.Said("ask brigit phone")) {
    Display("'Are you going to make a call, Pidge?'");
  }
  else if (Parser.Said("talk brigit")) {
    Display("'We could go down to the stony field and pick hazel nuts,' Brigit says.[[Pidge shakes his head. 'They won't be ripe for a long time yet. It's only August, don't forget.'");
  }
  else if (Parser.Said("go [in] booth")) {
    object[0].Visible = false;
    object[2].Visible = true;
  }
  else if (Parser.Said("exit booth")) {
    object[2].Visible = false;
    object[0].Visible = true;
  }
  else if (Parser.Said("use phone")) {
    Display("What number should I dial?");
  }
  else if (Parser.Said("dial number")) {
    Display("What number should I dial?");
  }
  else if (Parser.Said("open door")) {
      object[0].Visible = false;
    object[2].Visible = true;
  }
  else if (Parser.Said("close door")) {
    Display("It's already closed");
  }
  else if (Parser.Said("HINT")) {
    Display("DIAL 7979");
  }

  else if (Parser.Said("dial 911")) {
    Display("There's no emergency!");
  }
 
    else if (Parser.Said("dial 7979")) {
          object[0].Visible = false;
    object[2].Visible = true;
      if (player.InventoryQuantity[iPhoneActv.ID] == 0) {
    Display("Pidge dialled the number of the second-hand bookshop.");
    Wait(25);
    Display("Ring...........Ring...........");
    Wait(25);
    Display("'Hallo!' the bookseller's gruff voice came down the line, sounding cross as ever.[['Hallo. Is that the bookseller?' he asked politely.[['It is!'");
        Wait(25);
    Display("'Could I speak to the assistant?' Pidge asked.[['What assistant?'[['The old one with the white moustache.'[['What? What nonsense is this?'[['Could I please speak to the old man with the white moustache-- the scholar?'");
    Wait(25);
Display("'What scholar? What are you talking about?'[['He was there yesterday. I saw him.'[['No one works for me as an assistant.'[['But he was there yesterday.'[['Must have been a customer. A scholar you say?'[['Yes.'[['What kind of scholar?'");
        Wait(25);
        Display("Pidge crossed his fingers.[['A Latin scholar,' he said hopefully.[['I'm a scholar of Latin myself.'[['Oh!' said Pidge. 'Could you translate something?'");
        Wait(25);
        Display("'I could.'[['Well, will you?'");
        Wait(25);
    Display("'You're a boy, aren't you?'[['Yes.'[['Don't they teach you Latin in school?'");
       Wait(25);
       Display("'Not yet. I'm not old enough.'[['Are you trying to fool me into doing your homework for you?'[['Honestly! It's the summer holidays. I haven't got any homework and I don't learn latin. Honestly!' Pidge said earnestly.");
      Wait(25);
      Display("'All right, so. Fire away!'");
      Wait(25);
      Display("'Right. Here it comes,' said Pidge. He opened up the old pages and read. 'O Serpens Vilissimus! Et hic signo et his verbis Te sic securo, in Saecula Saeculorum, Amen. Patricus.'");
      Wait(25);
      Display("'That's simple!' the bookseller said loftily. 'It means: ''O most vile serpent! By this sign and these words, thus I secure thee, forever and ever, Amen, Patrick.'' Or words to that effect. Ask me another one. Go on! I'm in the mood now.'");
     Wait(25);
     Display("'I haven't got any more to ask,' Pidge said politely. 'Thank you very much for your help.'");
      Wait(25);
      Display("'Your Latin pronunciation is atrocious-- don't know what the world's coming to,' said the bookseller.'");
    Wait(25);
    Display("'Is it?'[['Are you sure there isn't any more for me to do while I'm in the mood?'[['No.'[['That's it then!'");
       Wait(25);
       Display("'There was an old man serving in your shop,' Pidge said. 'You didn't see him because you ran outside to look at 'supersonic jets or similar rubbish.''");
        Wait(25);
        Display("'Don't be so cheeky!' the bookseller said and he hung up.");
    player.AddInventory(iPhoneActv);
    Wait(25);
        object[2].Visible = false;
    object[0].Visible = true;
      }
    else if (player.InventoryQuantity[iPhoneActv.ID] == 1) {
              object[2].Visible = false;
    object[0].Visible = true;
      Display("Better not. That bookseller sounded really cross.");
    }
    }
  //ELSE
    else { NoMatch(); }
}
 
 
function room_AfterFadeIn()
{
              object[2].Visible = false;
    object[0].Visible = true;
}
#2
-Scrolling point counter-

I would like to make a scrolling HP counter that loosely mimics the one used in Earthbound.  It definitely doesn't need to be as artistic or fancy as Earthbound's, just functional (but I'll gladly accept any advice on creating a counter that actually scrolls like an old digital clock.)

Let's say I wanted to create a point counter (used as an hp counter) where the numbers are subtracted or added slowly, instead of jumping instantly to the sum.  For instance, if the @SCORE@ begins at 10, and the player uses an item that restores 20 points, you would see the score go from 10 to 11 to 12 to 13 to 14... to 20, each number lasting on the screen for about half a second.

Any ideas?
#3
Hello all.

Imagine, if you will, a turn-based game with hit points as global int's.

The player has 60 hit points.
The enemy character performs an action that removes 100 hit points from the player's hp gauge.

If, in the script, the game was meant to 'end' (run a previously written 'game over' script) when the player's hp reached zero--

--would the global int become -40 or would it stop at zero to run the 'game over' script?

Just curious.
#4
Here's what happens: The "Drink wine" code runs, but the 'get staff' code won't-- the game ignores the "get staff" command by the player.
When I put the "Get staff" code before the "Drink wine" code, only the "get staff" code runs, and the game completely ignores player input command "drink wine."  So whichever one comes first is the one that works.
This is using Magintz's text parser template.

int staff = 0;

//"DRINK WINE" CODE
else if (Parser.Said("drink wine")) {
  if (staff==1) { Display("No more for me, thanks!");
    txtParser.SetText("");}
  else if (staff==0){
    cEgo.Walk(214, 149, eBlock);
    Display("Bravely, you take hold of the wine glass. You clink your glasses together and drink every last drop. The alcohol has a slightly dizzying effect...");
    Display("Moments pass...");
    Display("With a jolt, the guard realizes that he has taken the poisoned wine! He reaches out as if to choke you, but before he can reach you, he falls to the floor, immobilized!");
      Display("With the guard unable to move, you freely take the staff. You can feel a strange strength emanating from it!");
      staff+=1;
      character[EGO].AddInventory(istaff);
      object[2].Visible = false;
txtParser.SetText("");}
//END OF "DRINK WINE" CODE


//"GET STAFF" CODE
   else if (Parser.Said("take staff")) {
      if (staff==1) { Display("You already have it");
      txtParser.SetText("");}
      else if (staff==0 && Region.GetAtRoomXY(player.x, player.y) == region[0]){
    Display("You need to get closer");
      txtParser.SetText("");}
else if (staff==0 && Region.GetAtRoomXY(player.x,player.y) == region[2]){
Display("'Ah, ah, ah! First we drink, then we'll talk about the staff!'");
      txtParser.SetText("");}
//END OF "GET STAFF" CODE
#5
I'm working on a game very similar to an old DOS game called Hugo.

When the character dies, he falls over (change in view number) and stops moving.

Only problem is, even though he's fallen over, the player can still control him, which makes him slide around the room.  Hilarious, but not what I'm looking for.  Please tell me how to disable character movement for only one character. 
#6
Since this forum is for simple scripting questions...

The best way I can explain my Bible GUI is to compare it with the one in Captain Bible, if any of you have ever played it.  As you can see, though, it's not quite finished...

(I'll give you a little visual of how I'd like the game to function during the script below, since that might clear up some how's and to-what-end's:  When the player clicks on cD1 (char Demon 1), the demon says "Shall we...?"  The demon tells you a lie, and a GUI Bible pops up.  From one side of the Bible there is a list of buttons labeled "2 Corinthians 6:14-17", "Romans 7:18", and so forth.  On the right side are a bunch of labels, initially invisible, which become visible when a topic is chosen from the left side.  These labels are the actual verse, written out, such as "2 Corinthians 6:14-17: For what do righteousness and wickedness have in common..." When you think you have the right verse, button1, which says "Use", should be clicked, and then that should, for now, display whether you chose the right verse or not to counterattack the demon's lie.)

So IF button one is pressed WHILE label one is visible, the game should display "right answer, should be working".  But, well, when it comes to scripting, I'm a dunce.  The error message is "parse error in expr near 'int'." That would be the line that starts with 'if'.

Here's my flawed scripting.  My thanks to anyone who can tell me what I'm doing wrong:

function cD1_AnyClick()
{
cD1.Say("Shall we match wits, human?");
gBible.Visible = true;
if (function Button1_OnClick(GUIControl *control, MouseButton button) while Label1.Visible = true) {
Display("right answer, should be working.");
}
else {
  Display("wrong answer");
}
#7
How do you make a hotspot have a different response the second, third, fourth etc. time it is clicked?

Let's say you had a bookshelf hotspot.  Click it once and it will say, "The bookshelf contains many books."  Click it again and it will say, "There is a Harry Potter book."  Click it again and it will say, "There is also a horror novel." 

I have another question: How do you get it to display these messages in the same order after the third one ("There is also a horror novel") is clicked, skipping the first message? 
#8
How do you make a door that only opens when the player is in front of it?Ã,  Otherwise the door will open no matter where I am in the room, and that's not good.Ã, 

I was thinking I could make it so that if you're not near the door and you say 'open door' it will display 'You're not close enough!'Ã,  And if you're near, the door (an object) disappears.Ã, 

(By the way, remember the issue about the text parser?Ã,  It works now, so, thanks!Ã,  I was really happy about that.Ã,  My family [most of them anyway] likes games where you can just type away.... me too...)
#9
The manual said that I needed a GUI for the player's input, but I couldn't find anything else on the subject.  So I have a blank GUI sitting at the bottom of the screen, very useless.  How do I change it so it can be used for text input?

-Thanks!

Faith
SMF spam blocked by CleanTalk