SOLVED: Stop NPC from changing rooms after reset

Started by steptoe, Sat 14/04/2012 22:40:40

Previous topic - Next topic

steptoe

Hi


Edit:

These scripts seem to do the trick.. at least for the time being.. more tests needed.  Fingers double crossed!


To change button from Arrest to Arrested!

Code: ags

function Button28_OnClick(GUIControl *control, MouseButton button)
{
  if (Button28.Text=="Arrest")
  {
  Button28.Text="Arrested!";
  }
  }


To reset Button 28 to "Arrest"

Code: ags

function Button35_OnClick(GUIControl *control, MouseButton button)
{
  
  if (Button28.Text=="Arrested"")
  {
  Button28.Text="Arrest";
  }
  }


When the "Go to court" button is clicked

Code: ags

 if (Button28.Text=="Arrested!")
   {
    Murderer=cHarrington;
    cHarrington.ChangeRoom(6, 170, 310);
   }




Original post
----------------------------------

I have one button (Arrested) that takes an NPC to room 6 when the 'Go to court' button is pressed..

Button that changes the button text to "Arrested!"
Code: ags

function Button28_OnClick(GUIControl *control, MouseButton button)
{
 Button28.Text="Arrested!";
 Murderer=cHarrington;
}


If NPC is selected and 'Go to court' button is pressed

Code: ags

if (Murderer==cHarrington)
   {
      cHarrington.ChangeRoom(6, 170, 310)
   }


Button that Resets NPC to stay inRoom3 and reset button text back to "Arrest" before the 'Go to court' button is pressed
Code: ags

{
  
 if (Button28.Text=="Arrested!")
 {
   Button28.Text="Arrest";
   cHarrington.ChangeRoom(3);
 }


In short... how can you stop a NPC from changing rooms once selected and wish to deselect it?

cheers

steptoe





SMF spam blocked by CleanTalk