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

#1
An object moves across the screen with eBlock to a location. It then animates with eNoBlock. When I click on the object nothing happens when it should add an inventory item then disappear. I have tried the codes below but they do otherthings to the heartstone. I thought this would be simple!!
//I have put this in the global script.
function repeatedly_execute_always ( )
{
Ã, 
Ã,  if (IsTimerExpired(1)==1)
Ã,  Ã,  Ã, oHeartstone1.Visible=false;
}

//Room script
if((answer.AsInt == Product)&&(Thrown==1))
{
Ã,  object[Thrown].Visible = false;
Ã,  GiveScore(5);
Ã,  PlaySound(3);
Ã,  object[0].Animate(1,6,eOnce,eNoBlock);
//The skeleton (object[0]) burns and the HEARTSTONE1 appears and moves
//across the screen. I want the player to click it before it disappears to place in the inventory.
Ã,  oHeartstone1.Visible=true;
Ã,  oHeartstone1.SetView(5);
Ã,  oHeartstone1.Animate(0, 1, eRepeat, eNoBlock, eForwards);
Ã,  oHeartstone1.Move(150, 200, 1, eBlock, eAnywhere);

//The oHeartstone1 stops here and allows the player to click it and an inventory item is added and the oheartstone1 disappears.NOT HAPPENING!! I think the script runs too fast.

Ã,  oHeartstone1.Animate(0, 1,eOnce, eNoBlock, eForwards);
Ã,  oHeartstone1.Animate(0, 1,eOnce, eNoBlock, eBackwards);
Ã,  oHeartstone1.Animate(0, 1,eOnce, eNoBlock, eForwards);
Ã,  SetTimer(1, 100);//if the player has not clicked the oHeartstone1 it will disappear when the timer runs out.
Ã,  //Maybe the script is running too fast to register the click?
Ã,  object[0].Visible=false;
Ã,  object[0].SetPosition(337, 269);
Ã,  PlaySound(1);
Ã,  PlaySound(4);
Ã,  object[0].Visible = true;
Ã,  object[0].SetView(3);
Ã,  object[0].Animate(2,6,eOnce,eBlock);
Ã,  object[0].Animate(0,6,eOnce,eNoBlock);
Ã,  object[0].Move(280,266,1,eNoBlock,eWalkableAreas);
Ã,  }
sectionstart object12_bÃ,  // DO NOT EDIT OR REMOVE THIS LINE
function object12_b() {
Ã,  // script for Object 12 (HEARTSTONE1): Any click on object
player.AddInventory(iheartstone1);Ã, 
}
#sectionend object12_bÃ,  // DO NOT EDIT OR REMOVE THIS LINE

#sectionstart object12_cÃ,  // DO NOT EDIT OR REMOVE THIS LINE
function object12_c() {
Ã,  // script for Object 12 (HEARTSTONE1): Any click on object
oHeartstone1.Visible=false;Ã, 
}
#2
An object I have got moving across the screen is not responding to a mouse click. The mouse cursor is a watch when it is moving. I want the object, when clicked to place an item in the inventory. Any ideas.

function on_call(int value){
Ã,  if(value == 1) {
Ã,  String answer = txtUserInput.Text;
Ã,  gTableanswer.Visible = false;
Ã, 
Ã,  // This is the code to check it the heartstone is activated!(Thrown 1 is the object that
// calls the Heartstone)
Ã,  if((answer.AsInt == Product)&&(Thrown==1)){
Ã,  object[Thrown].Visible = false;
Ã,  GiveScore(5);
Ã,  PlaySound(3);
Ã,  object[0].Animate(1,6,eOnce,eNoBlock);//The skeleton burns and the HEARTSTONE1 appears and moves
//across the screen. I want the player to click it before it disappears to place in the inventory.
//I have set the oject interaction to on any click. When the script runs there is a watch on the screen
//and the object does not respond to the mouse.
Ã,  Wait(40);
Ã,  oHeartstone1.Visible=true;oHeartstone1.Move(150, 200, 2, eNoBlock, eAnywhere);oHeartstone1.SetView(5);
Ã,  oHeartstone1.Animate(0, 1, eRepeat, eNoBlock, eForwards);
Ã,  object[0].Visible=false;
Ã,  object[0].SetPosition(337, 269);
Ã,  PlaySound(1);
Ã,  Wait(200);
Ã,  oHeartstone1.Visible=false;
Ã,  PlaySound(4);
Ã,  object[0].Visible = true;
Ã,  object[0].SetView(3);
Ã,  object[0].Animate(2,6,eOnce,eBlock);
Ã,  object[0].Animate(0,6,eOnce,eNoBlock);
Ã,  object[0].Move(280,266,1,eBlock,eWalkableAreas);

I now have this code and have placed it in the room script at the top before any regions.
function repeatedly_execute_always(){if (Mouse.IsButtonDown(eMouseLeft)&&Ã, 
Ã,  Ã,  (oHeartstone1.Visible)==1)
Ã,  Ã,  player.AddInventory(inventory[3]);
Ã,  Ã,  oHeartstone1.Visible=false;}
Ã,  }

Problem is now the heartstone1 does not appear at all and does not go into inventory! I use the wait command to time the appearance of objects with other animations.Ã,  I think this should remove the heartstone1 (If it worked!) but how do you code get it to actually be over the moving object like, if mouse down over object heart tone1 then......???
#3
I am trying to use the information a user has placed in a text box. I looked at the ags manual and it indicated thatÃ,  Ã,  Ã, UserInput.GetText(input); was the command I should use. When I run the script an error message says 'GetText' is not a public member of 'TextBox' ????????????
#4
 :)Thanks for the help Monkey and Khris. I have taken your advice and chucked the on_key_press idea as this became messy as you suggested. I am now trying text boxes. However I still need some assistance. When I enter '8' the object [1] disappears (as it should) but if I enter another number nothing happens.(I think my 'else ' command or logic is up the creek.) I want object [1]Ã,  to move if the player puts another number other than 8 into the text box . Also as soon as I enter 8 into the text box it deletes the object without me pressing enter! Hope you can help.

ifÃ,  ((object[1].Visible)&&(txtUserInput.Text.AsInt == 8))
Ã,  {object[1].Visible = false;}
else
{object[1].Move(50, 266, 2,eNoBlock,eWalkableAreas);}

SMF spam blocked by CleanTalk