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

#1
Hi.

I've searched on the forums and have read a few posts on this as well as looking in the manual, but i still don't understand how to do it:

What i want is for one of my NPC characters to set a variable to 'false' when he stands on a particular region but what i don't understand is how to make AGS recognise the NPC as standing on said region.

As i've said i've read through a couple of other threads (http://www.adventuregamestudio.co.uk/yabb/index.php?topic=34472.0) on this but i still don't get it. could anyone take me through a solution, preferably in a way that a chimp would understand.

Any help would be greatly appreciated.
#2
Ive been trying to get this to work for quite a while, but i give up - could someone tell me where iv'e gone wrong. Bear in mind that i'm a TOTAL noobie at this and have probably approached this in completely the wrong way.

What i'm trying to do is have the room change after 3 switches have been triggered - which i have been able to do BUT, the following script i wanted to have the player say different things depending on how many of the switches have been triggered (in any order).

Iv'e managed to get the first two parts to work i.e. the MC says different things if 1 switch has been pulled when the second one is. After this however, it doesnt let me even select the third switch in game. I'm totally confused, any advice wouuld be appreciated. Sorry if my explanation isnt very clear but heres the script i'm having problems with:


Code: ags
function hHotspot9_UseInv()
  {
     if (player.ActiveInventory == iChairleg)
     if (switches == 0)
  {
      switches = 1;
      player.Walk(75, 103, eBlock, eWalkableAreas);
      player.FaceLocation(86, 45);
      trigger1 = true;
      oTorch1.Visible = true; 
      player.Say("Looks like there's some kind of mechanism behind the bracket...");
      Wait(25);
      oTorch1.Visible = false;
      oTorch1s.Visible = true;
      PlaySound(2);
      Wait(40);
      oTorch1s.Visible = false;
      Wait(15);
      player.Say("Nothing seems to have happened, maybe there's something more i have to do..."); 
    
     }
     else if (switches == 1)
          if (player.ActiveInventory == iChairleg)
     {
      switches = 2;
      player.Walk(75, 103, eBlock, eWalkableAreas);
      player.FaceLocation(86, 45);
      trigger1 = true;
      oTorch1.Visible = true; 
      player.Say("Looks like there's some kind of mechanism behind the bracket...");
      Wait(25);
      oTorch1.Visible = false;
      oTorch1s.Visible = true;
      PlaySound(2);
      Wait(40);
      oTorch1s.Visible = false;
      Wait(15);
      player.Say("Hasn't done the trick yet.");
     
     }
     else if (switches == 2)
          if (player.ActiveInventory == iChairleg)
    {
      player.Walk(75, 103, eBlock, eWalkableAreas);
      player.FaceLocation(86, 45);
      trigger1 = true;
      oTorch1.Visible = true; 
      player.Say("Looks like there's some kind of mechanism behind the bracket...");
      Wait(25);
      oTorch1.Visible = false;
      oTorch1s.Visible = true;
      PlaySound(2);
      Wait(40);
      oTorch1s.Visible = false;
      Wait(15);
      player.Say("That's got it!");
     }
    }
  

    // END OF FUNCTION //////////////////////////////////////////////
      
     function hHotspot10_UseInv()
  {
     if (player.ActiveInventory == iChairleg)
     if (switches == 0)
    {    
   switches = 1;
      player.Walk(138, 96, eBlock, eWalkableAreas);
      player.FaceLocation(144, 35);
      trigger2 = true;
      oTorch2.Visible = true; 
      player.Say("Looks like there's some kind of mechanism behind the bracket...");
      Wait(25);
      oTorch2.Visible = false;
      oTorch2s.Visible = true;
      PlaySound(2);
      Wait(40);
      oTorch2s.Visible = false;
      Wait(15);
      player.Say("Nothing seems to have happened, maybe there's something more i have to do...");
  }
     else if (switches == 1)
          if (player.ActiveInventory == iChairleg)
  {
      switches = 2;
      player.Walk(138, 96, eBlock, eWalkableAreas);
      player.FaceLocation (144, 35);
      trigger2 = true;
      oTorch2.Visible = true; 
      player.Say("Looks like there's some kind of mechanism behind the bracket...");
      Wait(25);
      oTorch2.Visible = false;
      oTorch2s.Visible = true;
      PlaySound(2);
      Wait(40);
      oTorch2s.Visible = false;
      Wait(15);
      player.Say("Hasn't done the trick yet.");
    }
     else if (switches == 2)
          if (player.ActiveInventory == iChairleg)
    {
      player.Walk(138, 96, eBlock, eWalkableAreas);
      player.FaceLocation(144, 35);
      trigger2 = true;
      oTorch2.Visible = true; 
      player.Say("Looks like there's some kind of mechanism behind the bracket...");
      Wait(25);
      oTorch2.Visible = false;
      oTorch2s.Visible = true;
      PlaySound(2);
      Wait(40);
      oTorch2s.Visible = false;
      Wait(15);
      player.Say("That's got it!");
    }
  
    } 
  
      // END OF FUNCTION /////////////////////////////////////////////
      
     function hHotspot11_UseInv()
  {   
      if (player.ActiveInventory == iChairleg)
      if (switches == 0)
      {    
      switches = 1;
      player.Walk(166, 95, eBlock, eWalkableAreas);
      player.FaceLocation(180, 32);
      trigger3 = true;
      oTorch3.Visible = true; 
      player.Say("Looks like there's some kind of mechanism behind the bracket...");
      Wait(25);
      oTorch3.Visible = false;
      oTorch3s.Visible = true;
      PlaySound(2);
      Wait(40);
      oTorch3s.Visible = false;
      Wait(15);
      player.Say("Nothing seems to have happened, maybe there's something more i have to do...");
  
     }
      else if (switches == 1)
           if (player.ActiveInventory == iChairleg)
     {
      switches = 2;
      player.Walk(166, 95, eBlock, eWalkableAreas);
      player.FaceLocation(180, 32);
      trigger3 = true;
      oTorch3.Visible = true; 
      player.Say("Looks like there's some kind of mechanism behind the bracket...");
      Wait(25);
      oTorch3.Visible = false;
      oTorch3s.Visible = true;
      PlaySound(2);
      Wait(40);
      oTorch3s.Visible = false;
      Wait(15);
      player.Say("Hasn't done the trick yet.");
     }
     else if (switches == 2)
          if (player.ActiveInventory == iChairleg)
     {
      player.Walk(166, 95, eBlock, eWalkableAreas);
      player.FaceLocation(180, 32);
      trigger3 = true;
      oTorch3.Visible = true; 
      player.Say("Looks like there's some kind of mechanism behind the bracket...");
      Wait(25);
      oTorch3.Visible = false;
      oTorch3s.Visible = true;
      PlaySound(2);
      Wait(40);
      oTorch3s.Visible = false;
      Wait(15);
      player.Say("That's got it!");
     }
  }
#3
Im at a loss TBH , what i want to do is use three switches to trigger a room change. i want it so the room changes only after all have been tripped (preferably in any order). Any advice on how i could do this would be great.
#4
First of all, 1st post so hi all.

I've looked about the forums but i couldn't find anything. Im having trouble getting sounds to work, ive put the footstep sound into the 'sounds' folder under the name sound1.wav and entered '1' into the sound option in the view editor. When i run the game, theres no sound - am i missing something?  ???

Any help would be great.
SMF spam blocked by CleanTalk