Author Topic: Need a little help..  (Read 21559 times)

0 Members and 1 Guest are viewing this topic.

Offline Ron

Need a little help..
« 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.



Offline Oliver

Re:Need a little help..
« Reply #1 on: September 26, 2004, 12:14:04 PM »
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.
« Last Edit: September 26, 2004, 12:15:45 PM by Oliver »
You got it!
The New website of Extime is ready!
http://www.hot.ee/extime
Also, there is a message-board at:
http://www.zone.ee/eostuff/forum/index.php

Offline bokkers

Re:Need a little help..
« Reply #2 on: September 26, 2004, 12:36:07 PM »
Hi Ron,

first of all I would recommend moving the

Code: [Select]
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:

Code: [Select]
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:

Code: [Select]
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:

Code: [Select]
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:

Code: [Select]
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.

Offline Ron

Re:Need a little help..
« Reply #3 on: September 27, 2004, 06:52:43 AM »
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"...

Offline Ron

Re:Need a little help..
« Reply #4 on: September 27, 2004, 07:39:21 AM »
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..

Offline bokkers

Re:Need a little help..
« Reply #5 on: September 27, 2004, 08:06:45 AM »
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.

Offline Ron

Re:Need a little help..
« Reply #6 on: September 27, 2004, 08:14:07 AM »
HI, here is the fixed logic..
by the way, I was using the item tuturial..

Offline Ron

Re:Need a little help..
« Reply #7 on: September 27, 2004, 08:17:01 AM »
Hi, heres the fixed script...
BTW, i was using the item tuturial...

Offline bokkers

Re:Need a little help..
« Reply #8 on: September 28, 2004, 09:11:28 AM »
Hi,

try this version, it should work.
Greets,
b.o.k.

Offline Ron

Re:Need a little help..
« Reply #9 on: September 28, 2004, 09:23:40 AM »
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...

Offline Ron

Re:Need a little help..
« Reply #10 on: October 08, 2004, 07:40:55 AM »
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.

Offline Eigen

Re:Need a little help..
« Reply #11 on: October 08, 2004, 09:11:15 AM »
Replace the 128 and 125. It should be:

if(posn(o0, left edge x, top line y, right edge x, bottom line y)


-Eigen
Artificial Intelligence Competition

Offline Ron

Re:Need a little help..
« Reply #12 on: October 09, 2004, 03:40:26 PM »
thanks alot man!


SMF 2.0.19 | SMF © 2021, Simple Machines
Simple Audio Video Embedder

Page created in 0.082 seconds with 21 queries.