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 - metalmario991

#1
Thanks, that fixed it. I should use that Tidy fix more often, as it seems easy to make a mistake when you have a bunch of nested stuff like that.
Sorry about the code tags, I didn't know that's how you get it like that.
#2
OK, while messing around I figured out the twice problem.

The UseInv, Close, and all the Unhandled scripts aren't working at all.
#3
Beginners' Technical Questions / Script Issues
Fri 25/01/2019 03:37:09
I have two issues with the following script.
1) For some reason, the characters does some of the interactions, such as the look and open twice. I don't know why, but they keep doing that.
2) Some produce nothing at all, like Use.
2) The script for using the crowbar doesn't seem to work.

What's wrong here?

Code: ags
  if (MovePlayer(188, 79)) {
  player.FaceDirection(eDirectionUp);
  // LOOK AT
  if(UsedAction(eGA_LookAt)) {
  player.Say("These doors are our only obstacle in getting into the Stadium.");
  }
  // OPEN
  else if(UsedAction(eGA_Open)) {
      if (UsedCrowbar == false) {
       if (player == cMikePrologue) {
       player.ChangeView(33);
        player.Animate(3, 4, eOnce, eBlock, eForwards);
        player.ChangeView(32);
        player.Say("Hmmmm, this door appears to be locked.");
       }
       else {
        player.ChangeView(41);
        player.Animate(3, 4, eOnce, eBlock, eForwards);
        player.ChangeView(48);
        player.Say("Hmmmm, this door appears to be locked.");
       }
      }
      else {
      if (player == cMikePrologue) {
        player.ChangeView(33);
        player.Animate(3, 4, eOnce, eBlock, eForwards);
        aDoorOpe.Play(eAudioPriorityNormal);
        player.ChangeView(32);
        oDoors.Visible = false;
        oOpenDoors.Visible = true;
      }
      else {
        player.ChangeView(41);
        player.Animate(3, 4, eOnce, eBlock, eForwards);
        aDoorOpe.Play(eAudioPriorityNormal);
        player.ChangeView(48);
        oDoors.Visible = false;
        oOpenDoors.Visible = true;
      }
      }
  }
  }
     // CLOSE
  else if(UsedAction(eGA_Close)) {
    player.Say("It's already closed.");
  }
  // Push
  else if(UsedAction(eGA_Push)) {
  Unhandled();
  }
  
  // Pull
  else if(UsedAction(eGA_Pull)) {
  player.Say("It's a push door.");
  } 
  //USE INV
  else if(UsedAction(eGA_UseInv)) {
    if (player.ActiveInventory == iCrowbar) {
      if (UsedCrowbar == false) {
        if (player == cMikePrologue) {
          player.FaceDirection(eDirectionDown);
          player.Say("Normally, I don't advocate vandalisim.");
          player.FaceDirection(eDirectionUp);
          player.Say("But we can't find out what crashed in the stadium otherwise...");
          player.ChangeView(33);
          player.Animate(3, 4, eOnce, eBlock, eForwards);
          aBreak.Play(eAudioPriorityNormal);
          oDoors.Visible = false;
          oOpenDoors.Visible = true;
          player.ChangeView(32);
          player.Say("Whoops, I think I broke the lock.");  
        }
        else {
          player.FaceDirection(eDirectionDown);
          player.Say("I'm not sure forcing open the door with this old crowbar is a good idea...");
          player.FaceDirection(eDirectionUp);
          player.Say("HOWEVER, we need to get inside that Stadium!");
          player.ChangeView(33);
          player.Animate(3, 4, eOnce, eBlock, eForwards);
          aBreak.Play(eAudioPriorityNormal);
          oDoors.Visible = false;
          oOpenDoors.Visible = true;
          player.ChangeView(32);
          player.Say("Yikes, I broke the lock. I hope this isn't traced back to us...");  
        }
      }
      else {
      player.Say("I broke the lock, no need to use the crowbar anymore.");
      }
    }
    else {
    player.Say("I don't think that's gonna work.");
    }
  }
  else Unhandled();
}
#4
Beginners' Technical Questions / Layer Issue
Thu 24/01/2019 01:18:01
Hello. In my game, there is car that you open the trunk of.
You can walk behind this car and the player appears behind it.
I'm having a problem where the open trunk object keeps appearing in front of the player, and I can't seem figure out what about the baseline is causing this. Or if the walk-behind with the rest of the car is causing it.
#5
In my game, I use the 9-verb system. I have multiple characters, so I reduced the colums of inventory boxes from 3 to 4 to fit an icon to switch characters with.
While I changed the size of the inventory window to match the less space, the game only fills 2 of the 3 boxes in the row before going on to the next row.
How do I fix that?
#6
I guess another thing as well would be how to make them walk over to the character to give them the item.
#7
Quote from: Snarky on Wed 23/01/2019 07:19:42
1) if(player == cBob)
2) You mean transfer it from one playable character to another? Basically:

cBob.AddInventory(iFlute);
cAlice.LoseInventory(iFlute);


If you're going to do this a lot, you can make a function out of it, like this:

Code: ags
bool GiveInventory(this Character*, Character* recipient, InventoryItem* item)
{
  // This checks that you're not trying to give "nothing", or to "nobody", or give something you don't have
  if(!recipient || !item || !this.HasInventory(item))
    return false;
  recipient.AddInventory(item);
  this.LoseInventory(item);
  return true;
}


Now you can call it like cBob.GiveInventory(cAlice, iFlute); (Or more likely, rather than hardcoding it with values like this, you'll do something like player.GiveInventory(characterThatWasClicked, player.ActiveInventory);)

3) Up to you.

I'm a little confused in regards to the second point. I'm not too familar with coding. So where does it go in the script, do I need to apply a check like "This Character is selected", just to make sure I can actually GIVE stuff without adding it into an NPC's inventory etc.
#8
Hello, I am working on a game where you have multiple characters that you switch between.
My main questions are:
1) Best way to check what character you're using, for character-specific events/dialogue.
2) How to Give an item to another character and add it to their inventory.
3) Best way to switch between characters. I'm currently trying the DOTT way, with the character icons in the GUI.

As the last one implies, I'm using the Verb-style.
#9
In my game there is a map area, similar to the ones seen in Monkey Island. I want it so that when you hover over a location you can go to, text shows up above
the cursor telling you what the location is, just like Monkey Island. I was wondering how to do it because I can't find any other post or tutorial about it.
#10
I was editing around and changing some events. For example, on the map screen a cutscene would trigger that a mansion would explode and the game would make an object appear to make it seem like the mansion completely disappeared. Now, I don't know if it has anything to do with this glitch, but for some reason the character will not walk on a walkable area near the mansion so you get stuck at the mansion. I've tried walking through it from other parts of the map but they can't pass it either. What's wrong?
#11
I know how to stop a particular piece of audio but is there a universal command where I don't have to be specific? Also, is it possible to make audio eNoBlock so a voice clip will play when the music is going on? Finally, during my test, a weird screen glitch happened where it flashed back to the screen it was previously on. Here is my script:

function room_Load()
{
a106_goomba_village_theme.Stop();
a144_pG.Play(eAudioPriorityLow);
Wait(200);
a144_pG.Stop();
aMario16.Play(eAudioPriorityLow);
aMario15.Play(eAudioPriorityLow);
a3_52_G.Play(eAudioPriorityLow);
}

It happened when the voice clips started playing. It also doesn't seem to do the screen transition. I used the debug to get to the screen so is that what is wrong?
#12
I am creating a puzzle where you have to use an item on a tree in order to get something. I have it set up with the whole active inventory thing but what do I do to make it so you can do it only once. I know it has something to do with Game.DoOnlyOnce but I'm not sure what I should put in the (). If I put cTree2_UseInv() wouldn't it make it so I couldn't do anything else with the tree? I'm a little confused here.
#13
When I program a character to follow another how do I get that character to stop following?
#14
If my game is 320x200, how big should it be? Does it even matter how big it is?
#15
http://imgur.com/nQ4IYsR
As you can see, the black space is blocking the characters. How do you get rid of it and can you also move it to the top of the screen?
#16
[imgzoom]D;O.png[/imgzoom]
If I figured out how to post images correctly, you should see that the black space where the dialog tree is, is blocking the characters.

Nope, I can't figure out how to post images.

Edited by mod: Please do not double post in a short period of time. Just click the 'Modify' button and edit your post.
#17
When you have dialog trees, how do you get rid of the black space so that the text is on the screen? Do I have to create my own text to get rid of it?
#18
What does eagerness mean? Also how will calling look in the script
#19
In my game I want to do something like "Ben there, Dan that" and have a character that follows you around and you use to interact in certain puzzles. What I need to know are two things:
1) If I have the side character follow the main character how is that programmed?
2) When I use the side character icon to interact, do I use the User Modes 1 and 2 on objects? If so, how does that work?
#20
Beginners' Technical Questions / This Error...
Tue 28/07/2015 18:35:53
I am getting the following error but I don't know what is wrong: room2.asc(59): Error (line 59): buffer exceeded: you probably have a missing closing bracket on a previous line
What is wrong with it line 59? I don't see anything wrong with it. Here is my whole script;

Code: ags
// room script file

function hEND_WalkOn()
{
}

function oStatue_Interact()
{
cGuybrush.Walk(307, 173, eBlock, eWalkableAreas);
cGuybrush.FaceObject(oStatue, eBlock);
cGuybrush.Say("Even if I could get to it, it would be too heavy to pick up.");
}

function oStatue_Look()
{
cGuybrush.Walk(307, 173, eBlock, eWalkableAreas);
cGuybrush.FaceObject(oStatue, eBlock);
cGuybrush.Say("This SMG4 character must be really narcissistic to put a statue of himself in his own pool.");
}

function oStatue_Talk()
{
cGuybrush.Walk(307, 173, eBlock, eWalkableAreas);
cGuybrush.FaceObject(oStatue, eBlock);
cGuybrush.Say("Hi!");
cGuybrush.Say("Do you know where I can find SMG4?");
}

function hDoor_Look()
{
cGuybrush.Walk(337, 120, eBlock, eWalkableAreas);
cGuybrush.FaceLocation(146, 103, eBlock);
cGuybrush.Say("This door leads into SMG4's Mansion.");
}

function hDoor_Interact()
{
cGuybrush.Walk(337, 120, eBlock, eWalkableAreas);
cGuybrush.FaceLocation(146, 103, eBlock);
cGuybrush.Say("Hmm...this door appears to be locked.);
}

function hDoor_Talk()
{
cGuybrush.Walk(337, 120, eBlock, eWalkableAreas);
cGuybrush.FaceLocation(146, 103, eBlock);
cGuybrush.Say("That doesn't seem to talk.");
}

function hDoor_UseInv()
{
cGuybrush.Walk(337, 120, eBlock, eWalkableAreas);
cGuybrush.FaceLocation(146, 103, eBlock);
cGuybrush.Say("That doesn't seem to work.");
}
function oStatue_UseInv()
{
Guybrush.Walk(307, 173, eBlock, eWalkableAreas);
cGuybrush.FaceObject(oStatue, eBlock);
cGuybrush.Say("That doesn't seem to work.");
}
SMF spam blocked by CleanTalk