SOLVED: Declaring Objects in Global to change it's view scenerio..

Started by barefoot, Wed 16/03/2011 07:32:21

Previous topic - Next topic

barefoot

Hi

UPDATE: What an idiot.. id'e already declared player was in that room so objects must relate to that room.. i think... anyhow.. got it going..   sorry guys  :-\

Here is what I have in case you see something I don't:

Code: ags

function Button16_OnClick(GUIControl *control, MouseButton button)
{
   if (player.Room== 28) {
   if (Game.DoOnceOnly("Killed bird")) {

   SetTimer(1, 0);
   Display("You use levitation");
   cwizard.ChangeView(64);
   cwizard.Walk(259,30, eBlock, eAnywhere);
   cwizard.Walk(259,77, eBlock, eAnywhere);
   Display("You land on top of the bird and squash it!!");
   object[1].Visible = false;
   object[5].Visible = true;
   cwizard.Walk(229,137, eBlock, eAnywhere);
   cwizard.ChangeView(3);
   cwizard.Say("That's taken care of him!!!");

 }
  else Display("You don't need your levitation spell at the moment.");
   }
}  



Scenerio:

I'm in the global script and I have entered events for a button that causes the character to levitate on to an object (obird (object 1) )... The obird is then supposed to change view to a dead bird (possibly some blood) and the character levitates to another position and changes back to normal view..

I have an understanding that's it's not easy to dictate objects in the global...  what do you think would be the best way or doing it in the global in maybe in the Room script?

I'm thinking if character is at a certain x y position then run condition? (not quite sure how to script that).

The below script works but without the obird (object 1)  ChangeView which I have not included:

Code: ags

function Button16_OnClick(GUIControl *control, MouseButton button)
{
  if (player.Room== 28) {

   SetTimer(1, 0);
   Display("You use levitation");
   cwizard.ChangeView(64);
   cwizard.Walk(259,30, eBlock, eAnywhere);
   cwizard.Walk(259,77, eBlock, eAnywhere);
   Display("You land on top of the bird and squash it!!");
   // Here the obird (object 1) changes view
    
   cwizard.Walk(309,75, eBlock, eAnywhere);
   cwizard.ChangeView(3);
   
   
}
}


cheers if you can shove a bit of help this way..

barefoot







I May Not Be Perfect but I Have A Big Heart ..

SMF spam blocked by CleanTalk