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

#1
Hi, so I'm not sure what section this goes in, but what art program should I use for backgrounds? I tried to follow the background tutorial on the main ags site, but artgem isn't available anymore.
#2
In the MI-9 style, nothing activates when I do something with an item. This is the script for the items:

Code: ags
function iBook_AnyClick()
{
  if (UsedAction(eGA_LookAt)) {
    dBook.Start();
  }
}

function iSheet_AnyClick()
{
  if (UsedAction(eGA_LookAt)) {
    cRachel.Say("It's my bedsheet.");
  }
  if (UsedAction(eGA_UseInv)) {
    if (cRachel.ActiveInventory == iPants) {
      cRachel.AddInventory(iSPTT);
      cRachel.LoseInventory(iSheet);
      cRachel.LoseInventory(iPants);
      cRachel.Say("I tied my pants and sheet together. It looks like a rope now.");
    }
  }  
}

function iPants_AnyClick()
{
  if (UsedAction(eGA_LookAt)) {
    cRachel.Say("It's my pants.");
  }
  if (UsedAction(eGA_UseInv)) {
    if (cRachel.ActiveInventory == iSheet) {
      cRachel.AddInventory(iSPTT);
      cRachel.LoseInventory(iSheet);
      cRachel.LoseInventory(iPants);
      cRachel.Say("I tied my pants and sheet together. It looks like a rope now.");
    }
  }  
}


And Khris, I did what you said in the last post. It worked temporarily but for some reason now it doesn't want to work...
#3
Hello everyone, this is a rather simple question. Anyone know how to play a sound in a dialog?
#4
Okay, so this might be a more simple question, but it is about MI-9 so I figured it would be best to post it here. This contains multiple script which could have the problem, so bear with me. I have created a dialog called dBook ((You can find it below)) and when you have the item "Large Marine Life" (iBook), it should play dBook. However, it plays nothing. I have no idea what part of the script this is a fault of, so I will give the global script, the gui script, and the dialog (although I don't think it's the dialog's fault). Here you go:

Global script book part:
Code: ags
function iBook_OtherClick()
{
  if (UsedAction(eGA_LookAt)) {
    dBook.Start();
  }
  else Unhandled();
}


The gui script (Part where I may have gone wrong):
Code: ags
function on_mouse_click(MouseButton button) {
  
  if (!is_gui_disabled()) {
    int mrx=mouse.x+GetViewportX();
    int mry=mouse.y+GetViewportY();
    int x=mouse.x;
    int y=mouse.y;
    // get location under mouse cursor
    GSloctype=GetLocationType(x, y);
    GSlocname=Game.GetLocationName(x, y);
    GSagsusedmode=Mouse.Mode;
    used_action=global_action;
    
    InventoryItem*ii = InventoryItem.GetAtScreenXY(x, y);
    if (GSloctype==eLocationHotspot) {
      Hotspot*h=Hotspot.GetAtScreenXY(x, y);
      GSlocid=h.ID;
      
    }
    else if (GSloctype==eLocationCharacter) {
      Character*c=Character.GetAtScreenXY(x, y);
      GSlocid=c.ID;
    }
    else if (GSloctype==eLocationObject) {
      Object*o=Object.GetAtScreenXY(x, y);
      GSlocid=o.ID;
    }
    else if (ii!=null) GSlocid=ii.ID;
    
    
    
    
    if (IsGamePaused()) {
      // Game is paused, so do nothing (ie. don't allow mouse click)
    }
    // Mousebutton Left
    else if (button==eMouseLeft) 
    {
        
      if (GlobalCondition(2) || GlobalCondition(3) || GlobalCondition(4)) {
        // Do nothing, if:
        // the mode is useinv and the mouse is over the active inv (like "use knife on knife")
        // or the mode is talk, or "Give", and the mouse isnt over a character
        // or its GIVE and the mouse isnt over a inv.item

      }
      else if (ExtensionEx(1, GSlocname)=='e') {
        UpdateActionBar();
        ActionLine.TextColor=ActionLabelColorHighlighted;
        WalkOffScreen();
      }
      // walk to
      else if (GSagsusedmode==eModeUsermode2) {
        ActionLine.TextColor=ActionLabelColorHighlighted;
        if (IsInteractionAvailable(x, y, GSagsusedmode)) ProcessClick (x, y, GSagsusedmode);
        else ProcessClick(x, y, eModeWalkto);
      }   
      // talkto
      else if (GSagsusedmode==eModeTalkto && IsInteractionAvailable(x, y, GSagsusedmode) && GSloctype==eLocationCharacter) {
        ActionLine.TextColor=ActionLabelColorHighlighted;
        if (GoToCharacter(character[GSlocid], eDir_None, NPC_facing_player, 1)) character[GSlocid].RunInteraction(GSagsusedmode);
        SetAction(eMA_Default);
      }
      // Giveto
      else if ((GSagsusedmode == eModeUseinv) && GSloctype==eLocationCharacter && isAction(eGA_GiveTo)) {
        ActionLine.TextColor=ActionLabelColorHighlighted;
        ItemGiven=player.ActiveInventory;
        
        if (GoToCharacter(character[GSlocid], eDir_None, NPC_facing_player, 2)) {
          if (IsInteractionAvailable (mrx - GetViewportX (), mry - GetViewportY (), eModeUseinv) == 1) {
            character[GSlocid].RunInteraction(eModeUseinv);        
          }
        }
        SetAction (eMA_Default);
      }     
      else {
        UpdateActionBar();
        ActionLine.TextColor=ActionLabelColorHighlighted;
        ProcessClick(x, y, GSagsusedmode);
        SetAction(eMA_Default);
        ItemGiven=null;
      }
    }
    // Mousebutton Right
    else if (button==eMouseRight) {
      if (alternative_action==eMA_Default) {
        SetAction(eMA_Default);
        ActionLine.TextColor=ActionLabelColorHighlighted;
        if (Mouse.Mode==eModeUsermode2) {
          if (ExtensionEx(1, GSlocname)=='e') {
            UpdateActionBar();
            ActionLine.TextColor=ActionLabelColorHighlighted;
            WalkOffScreen();
          }          
          else ProcessClick(x, y, eModeWalkto);
        }
        else ProcessClick(x, y, Mouse.Mode);
      }
      else
      {
        SetAction(alternative_action);
        used_action=global_action;
        UpdateActionBar();
        ActionLine.TextColor=ActionLabelColorHighlighted;
        GSagsusedmode=Mouse.Mode;
        if (GSagsusedmode==eModeTalkto && IsInteractionAvailable(x, y, GSagsusedmode) && GSloctype==eLocationCharacter) { //(GetCharacterAt (mouse.x, mouse.y) < 7))
          if (GoToCharacter(character[GSlocid], eDir_None, NPC_facing_player,2 )) character[GSlocid].RunInteraction(GSagsusedmode);
        }
        else ProcessClick(x, y, GSagsusedmode);
        SetAction(eMA_Default);
      }
    }
    //left click in inventory
    else if (button==eMouseLeftInv) {
      if (!isAction(eGA_GiveTo))ItemGiven= null;
   
      if (GlobalCondition (1)) {
        // if the mouse is in the inventory and modes Walk or pickup are selected
        SetAction (eGA_Use);
        location=GSinvloc;    
        if (Extension()=='u' && ii.IsInteractionAvailable(eModeInteract)) {
          // use it immediately (not with anything else)
          used_action=global_action;
          ii.RunInteraction(eModeInteract);
          SetAction(eMA_Default);
        }
        else {
          if (oldschool_inv_clicks) {
            SetAction (eGA_LookAt);
            used_action=global_action;
            ii.RunInteraction(eModeLookat);   
            SetAction(eMA_Default);
          }
          else player.ActiveInventory=ii;
        }
      } 
      else  if (GlobalCondition (2) == 1) {
        // if the mode is useinv and the mouse is over the active inv (like "use knife on knife")
        // so do nothing again
      }
      else {
        used_action=global_action;
        if (Mouse.Mode==eModeInteract) {
          if (isAction(eGA_Use) && ii.IsInteractionAvailable(eModeInteract)) {
            ActionLine.TextColor=ActionLabelColorHighlighted;
            ii.RunInteraction(eModeInteract);
            SetAction(eMA_Default);
          }
          else player.ActiveInventory=ii;
        }
        else {
          if ( (Mouse.Mode >0 && Mouse.Mode <10 )&& ii != null) {
                GSagsusedmode=Mouse.Mode;
                ActionLine.TextColor=ActionLabelColorHighlighted;
                ii.RunInteraction(Mouse.Mode);
                SetAction(eMA_Default);
          }
        }
      }
    }
    //right click in inventory
    else if (button==eMouseRightInv) {
      if (alternative_action==eMA_Default) {
        SetAction(eMA_Default);
      }
      else {
        SetAction(alternative_action);
        used_action=global_action;
        GSagsusedmode=Mouse.Mode;
        if (Mouse.Mode==eModeInteract) {
          if (isAction(eGA_Use) && ii.IsInteractionAvailable(eModeInteract)) {
            UpdateActionBar();
            ActionLine.TextColor=ActionLabelColorHighlighted;
            ii.RunInteraction(eModeInteract);
            SetAction(eMA_Default);
          }
          else player.ActiveInventory=ii;
        }
        else {
          UpdateActionBar();
          ActionLine.TextColor=ActionLabelColorHighlighted;
          SetAction(eMA_Default);
        }
      }
    }
  }
}

function repeatedly_execute_always() {
  // Doubleclick Timer
  if (!IsGamePaused() && !is_gui_disabled()) {
    if (timer_run == true)
    {
      timer_click++;
      if (timer_click >= dc_speed){
        timer_click = 0;
        timer_run = false;
      }
    }
  }
}


The dialog (Yes, it's strange):

// Dialog script file
@S 
Rachel: It's a book on Large Marine Life.// Dialog startup entry point
return
@1
Book: Whales are the largest mammals that inhabit the Earth, however, all of them are vastly different. The whale meat industry is large in Asia and brings them to the brink of extinction.
Rachel: That's what I do. Prevent them from becoming extinct by gathering data.
goto-dialog 1
@2
Book: Sharks are misunderstood carnivores which are at the top of the food chain in the ocean. However, poaching threatens to drive them to death.
Rachel: I don't much like sharks. Whales are more my thing.
goto-dialog 2
@3
Rachel: There doesn't appear to be anything else worth reading here.
stop
#5
Hey, I have been searching and looking for an answer to my problem. I found I post that outlines the problem, which seems to be a missing quotation mark, however I have vigorously scanned through my entire script and I have not found anything wrong. In case you need it, the error:

room1.asc(115): Error (line 115): buffer exceeded: you probably have a missing closing bracket on a previous line

And here is my script so far:

Code: ags
//room script file

function hTv_Look()
{
    cRachel.Walk(280, 170, eBlock, eWalkableAreas);
    cRachel.FaceLocation(318, 128);
    cRachel.Say("It's my television. Alright! Yes, I know it's old fashioned. You don't have to rub it in...");
}

function hTv_Interact()
{
    cRachel.Walk(280, 170, eBlock, eWalkableAreas);
    cRachel.FaceLocation(318, 128);
    cRachel.Say("I have no time to watch television now. I should try and find my key.");
}

function hTv_Talk()
{
    cRachel.Walk(280, 170, eBlock, eWalkableAreas);
    cRachel.FaceLocation(318, 128);
    cRachel.Say("Wow. I really am going insane, talking to inanimate objects."); 
}

function hLamp_Interact()
{
    cRachel.Walk(360, 160, eBlock, eWalkableAreas);
    cRachel.FaceLocation(373, 122);
    cRachel.Say("Fine, I'll turn it off.");
}

function hLamp_Look()
{
    cRachel.Walk(360, 160, eBlock, eWalkableAreas);
    cRachel.FaceLocation(373, 122);
    cRachel.Say("It's my bedside lamp.");
}

function hLamp_Talk()
{
    cRachel.Walk(360, 160, eBlock, eWalkableAreas);
    cRachel.FaceLocation(373, 122);
    cRachel.Say("Wow. I really am going insane, talking to inanimate objects."); 
}

function hBed_Interact()
{
    cRachel.Walk(325, 200, eBlock, eWalkableAreas);
    cRachel.FaceLocation(343, 167);
    cRachel.Say("Is my key under here? No.");
}

function hBed_Look()
{
    cRachel.Walk(325, 200, eBlock, eWalkableAreas);
    cRachel.FaceLocation(343, 167);
    cRachel.Say("It's my bed. I'm kind of sleepy...");
}

function hBed_Talk()
{
    cRachel.Walk(325, 200, eBlock, eWalkableAreas);
    cRachel.FaceLocation(343, 167);
    cRachel.Say("Wow. I really am going insane, talking to inanimate objects.");
}

function hPainting_Interact()
{
    cRachel.Walk(263, 168, eBlock, eWalkableAreas);
    cRachel.FaceLocation(262, 118);
    cRachel.Say("I'm pretty sure my key's not there.");
}

function hPainting_Look()
{
    cRachel.Walk(263, 168, eBlock, eWalkableAreas);
    cRachel.FaceLocation(262, 118);
    cRachel.Say("It's some random painting my mom gave me.");
}

function hPainting_Talk()
{
    cRachel.Walk(263, 168, eBlock, eWalkableAreas);
    cRachel.FaceLocation(262, 118);
    cRachel.Say("Wow. I really am going insane, talking to inanimate objects.");
}

function hLampb_Interact()
{
    cRachel.Walk(80, 170, eBlock, eWalkableAreas);
    cRachel.FaceLocation(80, 64);
    cRachel.Say("Fine, I'll turn it off.");
}

function hLampb_Look()
{
    cRachel.Walk(80, 170, eBlock, eWalkableAreas;
    cRachel.FaceLocation(80, 64);
    cRachel.Say("It's my big lamp. Can you believe this place came without a light?");
}

function hLampb_Talk()
{
    cRachel.Walk(80, 170, eBlock, eWalkableAreas);
    cRachel.FaceLocation(80, 64);
    cRachel.Say("Wow. I really am going insane, talking to inanimate objects."); 
}

function oPants_Look()
{
    cRachel.Walk(276, 188, eBlock, eWalkableAreas);
    cRachel.FaceLocation(274, 177);
    cRachel.Say("PANTS ON THE GROUND! PANTS ON THE GROUND! LOOKIN' LIKE A FOOL WITH YOUR PANTS ON THE GROUND!");
}

function oPants_Interact()
{
    cRachel.Walk(276, 188, eBlock, eWalkableAreas);
    cRachel.FaceLocation(274, 177);
    cRachel.AddInventory(iPants);
    oPants.Visible = false;
    cRachel.Say("My keys aren't in them. Might as well keep it.");
}

function room_AfterFadeIn()
{
    dDialog0.Start();
}

function oShirt_Interact()
{
    cRachel.Walk(172, 172, eBlock, eWalkableAreas);
    cRachel.FaceLocation(130, 190);
    cRachel.AddInventory(iShirt);
    oShirt.Visible = false;
    cRachel.Say("My keys aren't under it. Who knows. A shirt could come in handy some day.");
}

function oShirt_Look()
{
    cRachel.Walk(172, 172, eBlock, eWalkableAreas);
    cRachel.FaceLocation(130, 190);
    cRachel.Say("A shirt with a smiley face on it. Honestly I don't know where I get half my clothes.");
}

function oShirt_Talk()
{
    cRachel.Walk(172, 172, eBlock, eWalkableAreas);
    cRachel.FaceLocation(130, 190);
    cRachel.Say("Wow. I really am going insane, talking to inanimate objects.");
}

function oSock_Interact()
{
    cRachel.Walk(225, 185, eBlock, eWalkableAreas);
    cRachel.FaceLocation(207, 181);
    cRachel.AddInventory(iSock);
    oSock.Visible = false;
    cRachel.Say("Yes! Found my key! What it was doing in my sock I have no idea. I should get my other things before I leave.");
    cRachel.AddInventory(iKey);
}

function oSock_Look()
{
    cRachel.Walk(225, 185, eBlock, eWalkableAreas);
    cRachel.FaceLocation(207, 181);
    cRachel.Say("It's a neon pink sock. Eww what a disgusting color.");
}

function oSock_Talk()
{
    cRachel.Walk(225, 185, eBlock, eWalkableAreas);
    cRachel.FaceLocation(207, 181);
    cRachel.Say("Wow. I really am going insane, talking to inanimate objects.");
}    

function oDoor_Interact()
{
    cRachel.Walk(34, 168, eBlock, eWalkableAreas);
    cRachel.FaceLocation(32, 48);
    cRachel.Say("It's locked. Yup, I don't have my key!");
}

function oDoor_Look()
{
    cRachel.Walk(34, 168, eBlock, eWalkableAreas);
    cRachel.FaceLocation(32, 48);
    cRachel.Say("It's a door that's blocking my way.");
}

function oDoor_Talk()
{
    cRachel.Walk(34, 168, eBlock, eWalkableAreas);
    cRachel.FaceLocation(32, 48);
    cRachel.Say("Wow. I really am going insane, talking to inanimate objects.");
}

function oDoor2_Interact()
{
    cRachel.Walk(34, 168, eBlock, eWalkableAreas);
    cRachel.FaceLocation(32, 48);
    cRachel.Say("It's open, no need to do anything with it now.");
}

function oDoor2_Look()
{
    cRachel.Walk(34, 168, eBlock, eWalkableAreas);
    cRachel.FaceLocation(32, 48);
    cRachel.Say("It's a door that I just opened.");
}

function oDoor2_Talk()
{
    cRachel.Walk(34, 168, eBlock, eWalkableAreas);
    cRachel.FaceLocation(32, 48);
    cRachel.Say("Wow. I really am going insane, talking to inanimate objects.");
}

function oDoor_UseInv()
{
  if (cRachel.ActiveInventory == iKey) {
    cRachel.Walk(34, 168, eBlock, eWalkableAreas);
    cRachel.FaceLocation(32, 48);
    oDoor.Visible = false;
    oDoor2.Visible = true;
    cRachel.Say("Finally the door is opened. Well, before I go I should get all my stuff.");
  }
}
SMF spam blocked by CleanTalk