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 - Global Lint

#1
Hints & Tips / Re: Patchwork
Sat 09/03/2013 03:45:02
Strangely enough, I can't combine items in the inventory. I left-click an inventory item and that makes it my cursor, but left-clicking another item in the inventory just updates the cursor again. I've tried right-clicking, but that just either examines the item or sets my cursor back to the standard arrow. Also, I can't figure out how to share inventory items between Daniel and Lin.

Running Windows 7, game in full screen, standard track pad.

Really beautiful game, I can't wait to play the rest of it.
#2
Right, I have that covered by now, but what's with being able to type something in the box next to the event button?  There's definitely not enough space to put code there.
#3
There was-- seems I put a '1' in the "Enters room after fade-in" tab on accident.

Thank you!  :D

But what are those empty tabs for?  What CAN you put in them?
#4
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;
}
#5
I think that's exactly it.  I'll edit this post tomorrow if it was useful.  Thank you :)

EDIT-

Thanks a ton!  This is exactly what I'm looking for!  

I might be back if I don't want the game to take away controls from the player while counting down or up, but for now it's fine.  :)
#6
-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?
#7
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.
#8
It works perfectly!  Thank you very, very much  :)
#9
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
#10
Thank you, I'll remember to disable the save option when the character dies. 

Thank you guys for spending some time on this!  I really appreciate it. 
#11
Hugo is just a regular adventure game, with only one character.  It's pretty basic: long mazes, the old newspaper-and-pencil trick, scaring gardeners away with your garlic breath, the works.  Hugo's text parser is sublime.  Also, the game isn't point-and-click; you move with the arrow keys.

You can't disable the 'this is the main character' button in the Views window.  That's in the character options, isn't it?

I'll try disabling the arrow keys with the variable idea.  My only worry about that is that once the player loads a game or quits, the keys will still be disabled.  I'm terrible with global things.  I'd better get on it.

It's just that I was almost certain there was a script function that disabled walking altogether.
#12
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. 
#13
I know double posting isn't a good idea.  I'm sorry.  But I'm trying to get some questions answered so I can move forward with this project.
#14


EDIT:

All right, everything was going pretty well until I tried to make the second demon in another room.  I used the same code, only I used it on demon2; but it gave me this:

GlobalScript.asc(270): Error (line 270): Variable 'Button1_OnClick' is already defined

Which I suppose means that it doesn't like the fact that 'Button1_Onclick' was used earlier in the global script.

#15
The labels are initially invisible already: I set them to begin as invisible in the global script.

I don't want the Use button to be unavailable if the label is the wrong answer, I want it to be available, but if it is pressed while the wrong label is on screen, it should display "wrong answer". 

I'll experiment a bit more with the code you gave me.

EDIT-  Okay, here is the code I've edited.  It's not giving me any error messages, but nothing is happening when I press the 'use' button while label 1 is visible.

Code: ags
function cD1_AnyClick()
{
  cD1.Say("Shall we match wits, human?");
  // * Code that turns all labels back to invisible:
  Label1.Visible = false;
Label2.Visible = false;
Label3.Visible = false;
Label4.Visible = false;
Label5.Visible = false;
Label6.Visible = false;
Label7.Visible = false;
Label8.Visible = false;
Label9.Visible = false;
Label10.Visible = false;
  
  gBible.Visible = true;
}

function Button1_OnClick(GUIControl *control, MouseButton button) {
  if (Label1.Visible) {
  gBible.Visible = false;
  Display("right answer, should be working.");
}
  else { Display("Wrong answer.");
}} 


And here's my rough GUI (I'm more concerned about making it work for now than making it pretty):

#16
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");
}
#17
Wow, I'm stuck.  I haven't met up with the Professor at 8 yet, and there doesn't seem to be anything to do.  I'm trying to get to the island depicted on the mural.  Help, please!   (:-\  I feel really stupid.  Everyone says these are so easy, but I can never even finish the  HerInteractive Nancy Drew games without help!)

EDIT:  Tsk.  Figures once I ask for help, I figure it out. 
#18
*cough* Me be voice actor! *cough*
#19
My God... Trevor Daison looks just like my science teacher, Mr. Windsor... o_O;

I'm downloading your game... it looketh so cool!

EDIT:  Just finished... loved it!  It was really cute!  ^.^
#20
Say, that's amazing!  Thanks a million!
SMF spam blocked by CleanTalk