Community
AGI Programming => Mega Tokyo AGI Archive => Topic started by: Ron on September 26, 2004, 06:58:21 AM
-
Hey,I got couple of problems which I cant solve and i hoped you could help me out..
My first problem is:
it doesnt metter where i place ego it cant get the gum(o5) even on the specific coordent of the object(see logic) which is funny becaose it worked fine untill i restarted my machine..
my second problem is:
if i take the wallet and then type get gum it does nothing even not printing any messege..
and i got couple of questions as well..
what is the command to stop the motion of an npc after it get to it destination ?
i managed to get him to the point, it stops moving but the animation continue (walking on the spot)
hope you can help me. thanks, Ron.
-
and i got couple of questions as well..
what is the command to stop the motion of an npc after it get to it destination ?
i managed to get him to the point, it stops moving but the animation continue (walking on the spot)
hope you can help me. thanks, Ron.
It should be stop.cycling(o0); and when you want him to move on after standing there for a couple of moments then just put start.cycling(o0);
That's all I can help you with at the moment. The other code is just too messy to understand. You've made it too difficult for yourself. But I think that's the tutorials mistake number #1, if you used a tutoarial that is.
-
Hi Ron,
first of all I would recommend moving the
animate.obj(o2);
load.view(2);
set.view(o2,2);
set.loop(o2,0);
set.cel(o2,0);
position(o2,101,116);
set.priority(o2,8);
stop.cycling(o2);
v255 = 2;
-stuff into the first block of the room, so that it looks like this:
if (new_room) {
load.pic(room_no);
draw.pic(room_no);
discard.pic(room_no);
set.horizon(37);
if ((prev_room_no == 1 || // just come from intro screen
prev_room_no == 0)) { // or just started game
position(ego,58,121);
status.line.on();
accept.input();
}
animate.obj(o2);
load.view(2);
set.view(o2,2);
set.loop(o2,0);
set.cel(o2,0);
position(o2,101,116);
set.priority(o2,8);
stop.cycling(o2);
v255 = 2;
animate.obj(o5);
load.view(7);
set.view(o5,7);
set.loop(o5,0);
set.cel(o5,0);
position(o5,62,125);
set.priority(o5,8);
stop.cycling(o5);
draw(ego);
show.pic();
}
About the wallet and the gum:
The problem is that you've got two if-blocks contradicting each other.
Block1:
if ((said("get","wallet") ||
said("get","wallet"))) {
v255 = 2;
if (obj.in.room("wallet",v255)) {
if (posn(o0,88,124,92,130)) {
print("ok");
erase(o2);
get("wallet");
v3 += 1;
set(f255);
}
else {
print("you're not close enough");
}
}
}would produce a message for the player if left alone. But block 2:
if (said("get","wallet")) {
if (has ("wallet")) {
print ("you alredy have it");
}
else {
reset(input_parsed);
}
}checks the same situation (that the player has entered "get wallet" and tells the game to reset the input_parsed.
I suggest that you leave block 2 and add the "You already got it" to the end of block 1 so that it looks like this:
if ((said("get","wallet") ||
said("get","wallet"))) {
v255 = 2;
if (obj.in.room("wallet",v255)) {
if (posn(o0,88,124,92,130)) {
print("ok");
erase(o2);
get("wallet");
v3 += 1;
set(f255);
}
else {
print("you're not close enough");
}
}
else {
print ("you already took it, man. Don't you remember?");
}
}
Then it should work fine.
Greets,
b.o.k.
-
Thanks but It didnt fixed it....
now when i try to get the gum after i take the wallet i get the wallet has messege (you alredy have it)...
besides that i cant take the gum... it doesnt metter whats ego's position... "you're not close enough"...
-
ok hmm my mistake, i puted the wallet and the gum on the same group on the words.tok, silly me!
it all fixed but one problem...
it doesnt metter where i stand, even on the specifiec coords i cant get the "gum" it says im not close enough..
-
Post your script and I'll have a look at it. It's not completely wrong what you're doing, you just have some lines in there that create these unwanted results.
Greets,
b.o.k.
-
HI, here is the fixed logic..
by the way, I was using the item tuturial..
-
Hi, heres the fixed script...
BTW, i was using the item tuturial...
-
Hi,
try this version, it should work.
Greets,
b.o.k.
-
Hi! I managed to fix it (with your help of course!) i just had to do 1+1....
thanks alot !
but if can you just help me with the npc...
the stop.cycling(oX) stop the animation of all objects inclouding ego...
can you post the full code ? maybe im forgeting something..
i want to move an object like npc (with animation) from point x to y and when the object reach point y it stops its animation..
thanks...
-
Hi,
I need help with the ego's positions..
I can only mark a position on the same Y. example:
if (posn(o0,48,128,58,128)) {
set.cel(o10,1); } <- works
if (posn(o0,48,128,58,125)) {
set.cel(o10,1); } <- doesnt work :<
Please help me. Thanks, Ron.
-
Replace the 128 and 125. It should be:
if(posn(o0, left edge x, top line y, right edge x, bottom line y)
-Eigen
-
thanks alot man!