Cirque bug - SetActiveInventory

Started by Kinoko, Tue 25/05/2004 07:25:09

Previous topic - Next topic

Kinoko

I've been getting the occasional bug report role in but I don't know exactly what the problem is.

The error message points to this line:

/**/Ã,  Ã,  Ã,  Ã, else SetActiveInventory(GSlocid);

and says, "SetActiveInventory: player doesn't have any of that inventory". It happen when the player tries to give an object (unhandled event) to the bear character. I suspect it's to do with my placing of the unhandled event line in the script but I'm not sure where it should go if that's the case. Sorry if this has a ridiculously obvious answer. Here's the whole script:

Ã,  // script for character19: Use inventory on character
if ((character[EGO].activeinv == 5) && (GetGlobalInt(2) == 0) && (GetGlobalInt(3) == 0)) {
DisplaySpeech (EGO, "Nah, not yet.");

}

else if ((character[EGO].activeinv == 5) && (GetGlobalInt(2) == 1) && (GetGlobalInt(3) == 0)) {
DisplaySpeech (EGO, "Nah, not yet.");

}

else if ((character[EGO].activeinv == 5) && (GetGlobalInt(2) == 0) && (GetGlobalInt(3) == 1)) {
DisplaySpeech (EGO, "Nah, not yet.");

}

else if ((character[EGO].activeinv == 5) && (GetGlobalInt(2) == 1) && (GetGlobalInt(3) == 1) && (GetGlobalInt(10) == 0)) {

if (Go()==1) //Start going to the object and if the player
   {Ã,  Ã,  Ã,  // does not abort do the following:
FaceCharacter (EGO, BEAR);
DisplaySpeech (EGO, "Have a look at THIS!");
SetCharacterView (EGO, 20);
Wait(40);
DisplaySpeech (BEAR, "You got it! You got your circus!");
DisplaySpeech (EGO, "Just like I ALWAYS said I would.");
DisplaySpeech (BEAR, "Wow, so now I can come and be apart of your art?");
DisplaySpeech (EGO, "You sure can, Damien. You sure can.");
DisplaySpeech (EGO, "Just meet me at the circus this evening.");
DisplaySpeech (BEAR, "I'll be there!");
DisplaySpeech (BEAR, "Until then, I'm going to sit here and dream about my new life of freedom.");
SetGlobalInt (10, 1);
}
}

else ifÃ,  ((character[EGO].activeinv == 5) && (GetGlobalInt(2) == 1) && (GetGlobalInt(3) == 1) && (GetGlobalInt(10) == 1)) {
Ã, 
DisplaySpeech (EGO, "I don't need to do that.");Ã, 
}

else if ((character[EGO].activeinv == 22) && (GetGlobalInt(2) == 0)) {
Ã, 
DisplaySpeech (EGO, "Why would I do that?");

}

else if ((character[EGO].activeinv == 22) && (GetGlobalInt(2) == 1)) {
Ã, 
if (Go()==1) //Start going to the object and if the player
   {Ã,  Ã,  Ã,  // does not abort do the following:
FaceCharacter (EGO, BEAR);
SetCharacterView (EGO, 20);
Wait(30);
LoseInventory (22);
ReleaseCharacterView (EGO);
DisplaySpeech (BEAR, "Oh! A little bike!");
DisplaySpeech (BEAR, "And it's red!");
DisplaySpeech (EGO, "Have I ever done you wrong?");
DisplaySpeech (BEAR, "Well, I haven't known you for very long.");
DisplaySpeech (EGO, "Yeah, and we're already off to such a good start.");
DisplaySpeech (BEAR, "Well, thanks for that.");
DisplaySpeech (BEAR, "Now you just need to get a circus.");
SetGlobalInt (3, 1);

}
}

else Unhandled();Ã, 



Scorpiorus

The error message means the player doesn't have the inventory item number GSlocid in his inventory bag.

If it's not vital to make GSlocid be an active item then you could ignore the SetActiveInventory() call if the GSlocid holds an invalid value:

try replacing the line:

/**/Ã,  Ã,  Ã,  Ã, else SetActiveInventory(GSlocid);


with:
/** ORIGINAL*/ //else SetActiveInventory(GSlocid); //commented out
/** MODIFIED*/ else {
/** MODIFIED*/   if ((GSlocid>0) && (GSlocid<301)) {
/** MODIFIED*/   if (character[GetPlayerCharacter()].inv[GSlocid]>0) SetActiveInventory(GSlocid);
/** MODIFIED*/    }
/** MODIFIED*/ }

But still, let's also wait for Proskrito to check the thread.

Pumaman

Yeah, I think this is a problem with the MI template - I remember it being brought up before.

Kinoko

So I should just change the script as Scorpiorus suggested?

Scorpiorus

You could try it. After all, it won't affect the game in any way but just doesn't quit with the error message if there is no such item in the inventory.

SMF spam blocked by CleanTalk