I have two issues with the following script.
1) For some reason, the characters does some of the interactions, such as the look and open twice. I don't know why, but they keep doing that.
2) Some produce nothing at all, like Use.
2) The script for using the crowbar doesn't seem to work.
What's wrong here?
Code: ags
1) For some reason, the characters does some of the interactions, such as the look and open twice. I don't know why, but they keep doing that.
2) Some produce nothing at all, like Use.
2) The script for using the crowbar doesn't seem to work.
What's wrong here?
if (MovePlayer(188, 79)) {
player.FaceDirection(eDirectionUp);
// LOOK AT
if(UsedAction(eGA_LookAt)) {
player.Say("These doors are our only obstacle in getting into the Stadium.");
}
// OPEN
else if(UsedAction(eGA_Open)) {
if (UsedCrowbar == false) {
if (player == cMikePrologue) {
player.ChangeView(33);
player.Animate(3, 4, eOnce, eBlock, eForwards);
player.ChangeView(32);
player.Say("Hmmmm, this door appears to be locked.");
}
else {
player.ChangeView(41);
player.Animate(3, 4, eOnce, eBlock, eForwards);
player.ChangeView(48);
player.Say("Hmmmm, this door appears to be locked.");
}
}
else {
if (player == cMikePrologue) {
player.ChangeView(33);
player.Animate(3, 4, eOnce, eBlock, eForwards);
aDoorOpe.Play(eAudioPriorityNormal);
player.ChangeView(32);
oDoors.Visible = false;
oOpenDoors.Visible = true;
}
else {
player.ChangeView(41);
player.Animate(3, 4, eOnce, eBlock, eForwards);
aDoorOpe.Play(eAudioPriorityNormal);
player.ChangeView(48);
oDoors.Visible = false;
oOpenDoors.Visible = true;
}
}
}
}
// CLOSE
else if(UsedAction(eGA_Close)) {
player.Say("It's already closed.");
}
// Push
else if(UsedAction(eGA_Push)) {
Unhandled();
}
// Pull
else if(UsedAction(eGA_Pull)) {
player.Say("It's a push door.");
}
//USE INV
else if(UsedAction(eGA_UseInv)) {
if (player.ActiveInventory == iCrowbar) {
if (UsedCrowbar == false) {
if (player == cMikePrologue) {
player.FaceDirection(eDirectionDown);
player.Say("Normally, I don't advocate vandalisim.");
player.FaceDirection(eDirectionUp);
player.Say("But we can't find out what crashed in the stadium otherwise...");
player.ChangeView(33);
player.Animate(3, 4, eOnce, eBlock, eForwards);
aBreak.Play(eAudioPriorityNormal);
oDoors.Visible = false;
oOpenDoors.Visible = true;
player.ChangeView(32);
player.Say("Whoops, I think I broke the lock.");
}
else {
player.FaceDirection(eDirectionDown);
player.Say("I'm not sure forcing open the door with this old crowbar is a good idea...");
player.FaceDirection(eDirectionUp);
player.Say("HOWEVER, we need to get inside that Stadium!");
player.ChangeView(33);
player.Animate(3, 4, eOnce, eBlock, eForwards);
aBreak.Play(eAudioPriorityNormal);
oDoors.Visible = false;
oOpenDoors.Visible = true;
player.ChangeView(32);
player.Say("Yikes, I broke the lock. I hope this isn't traced back to us...");
}
}
else {
player.Say("I broke the lock, no need to use the crowbar anymore.");
}
}
else {
player.Say("I don't think that's gonna work.");
}
}
else Unhandled();
}