Script appears in another Room!

Started by barefoot, Thu 28/10/2010 19:26:14

Previous topic - Next topic

barefoot

Hi

Im very curious to know why some script from a Room appears in a later Room!

The earlier Room used Hotspots that now reside in the later Room script!

Any ideas??

bareoot



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

Pumaman

You'll need to be much more specific about what exactly has happened and what you did...

barefoot

#2
Quote from: Pumaman on Thu 28/10/2010 23:08:38
You'll need to be much more specific about what exactly has happened and what you did...

This has appeared for some strange reason in Room 58, i don't even think I coded it originally as I used 'UseInv on mino' which is in room 53, Instead of below code!

Without deleting Hotspot(s) i am having to use new ones in Room 58.

Code: ags

function hHotspot1_UseInv()
{

   if (player.ActiveInventory == iacid) {
   Display("You throw the acid into the Minotaurs Face");
   cmino2.ChangeView(57);
   Display("You see a Key that has fallen from the Minotaur's pocket so you pick it up");
   cmino2.ChangeView(56);
   cindy_bones.AddInventory(iKey2);
   cmino2.FollowCharacter(null);
    cmino2.StopMoving();
  
  StopAmbientSound(1);
  Display("You need to finish the job and kill it!!!");
  cindy_bones.Say("I can't kill it, I'm not a murderer!! Professor! Come on we need to move on quick!!");
  cprof_plum.Say("I'm coming Indy!");
  
  cprof_plum.Transparency=0;
  cindy_bones.Say("Keep well away from him Professor, he may wake at any time!");
  cprof_plum.FollowCharacter(cindy_bones, 10, 90);
  
 }
 
 if (player.ActiveInventory == imatches) {
   Display("No good using matches!!");
   
}

 if (player.ActiveInventory == itorch2) {
   Display("No good using a torch!!");
   
}

 if (player.ActiveInventory == isword) {
   Display("You dare not go to close even with the sword!!");
 
}
}


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

SSH

Did you perhaps accidentally save the old room as a room template?

by the way, why is it OK to throw acid on someone's face but not to kill them! :)
12

Atelier

Barefoot, if there's just one line of code after the if statement, brackets aren't necessary. So

Code: ags
if (player.ActiveInventory == imatches) {
   Display("No good using matches!!");
   
}

 if (player.ActiveInventory == itorch2) {
   Display("No good using a torch!!");
   
}

 if (player.ActiveInventory == isword) {
   Display("You dare not go to close even with the sword!!");
 
}


can become

Code: ags

if (player.ActiveInventory == imatches) Display("No good using matches!!");
if (player.ActiveInventory == itorch2) Display("No good using a torch!!");
if (player.ActiveInventory == isword) Display("You dare not go to close even with the sword!!");


It doesn't make any difference to how it works in the long run, it just makes your script easier to read.

barefoot

Quote from: SSH on Fri 29/10/2010 10:40:35
Did you perhaps accidentally save the old room as a room template?

by the way, why is it OK to throw acid on someone's face but not to kill them! :)

Acid will injure but not nessessarily kill someone.. Room was saved as normal.

Yes, about the code, false of habit i need to change... lol

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

SMF spam blocked by CleanTalk