Hi I haven't been making a game for very long, most problems I've had I've worked out on my own but there are some that I cant work out because I don't know enough about the interpreter yet.
What I'm stuck with at the moment is the use of animations, my logic seems to be fine but as soon as i apply the logic for the animation, the normal logic doesn't work properly.
For example I'm trying to make an animation for the ego to use a key to open a chest, but the ego has to be in a certain position with possession of the key & has already done the action of moving a box from the top of the chest so it can be opened. Heres what I've done so far :-
if (said("use","key","chest")) {
if (posn(o0,27,77,57,104)) {
if (v253 == 4) { // boxes removed from top of chest
if (has("key")) {
v253 = 6; // ego opening chest animation
}
else {
print("You don't have a key");
}
}
else {
if (v253 == 1) { // chest already open
print("You already opened the chest");
}
else {
if (v253 == 5) { // chest has been closed before & is currently closed
print("You open the chest again");
v253 = 1; // open's the chest without using the animation
}
else {
print("There is a box on top of the chest, you must move it first");
}
}
}
}
else {
print("Your not close enough");
}
}
The above code works fine, but as soon as I add the animation logic below :-
if (v253 == 6) {
get.posn(o0,v253,v254);
erase (o0);
load.view(40);
set.view(o10,40);
position(o10,38,81);
cycle_delay = 6;
animate.obj(o10);
draw(o10);
end.of.loop(o10,f50); // animation of ego opening chest
}
if (isset(f50)) { // animation of ego opening chest
erase(o10);
load.view(0);
set.view(o0,0);
position.v(o0,v253,v254);
animate.obj(o0);
draw(o0);
erase(o1);
load.view(2);
set.view(o2,2);
position(o2,32,99);
animate.obj(o2);
draw(o2);
cycle_delay = 1;
stop.motion(o0);
player.control();
reset(f50);
}
When you use the command 'use key chest' after you have opened the chest with the key, instead of saying getting the reply "you've already opened the chest", you get "There is a box on top of the chest, you must move it first". Has anyone any idea why this is happening?