Author Topic: Problems...  (Read 2974 times)

0 Members and 1 Guest are viewing this topic.

Offline Martin

Problems...
« on: February 17, 2004, 10:39:51 AM »
I have two problems... The first is that the object that ego is picking up in my game doesn



Joey

  • Guest
Re:Problems...
« Reply #1 on: February 17, 2004, 02:33:50 PM »
instead of erase(o1);
try erase(gun);
if that doesnt work, try erase("gun");

im not sure if that will work. i forget how i made it so you wont walk over an object. i changed some lines in the tutorial and ego didnt walk over it. ill try and post the code later.

MagickPoultry

  • Guest
Re:Problems...
« Reply #2 on: February 17, 2004, 06:06:47 PM »
Where in the logic do you have "draw(o1)"?  Make sure it isn't drawing it again after it erases it.

Offline Martin

Re:Problems...
« Reply #3 on: February 18, 2004, 09:19:29 AM »
This is the end of the logic:

     erase(o1);
      get("gun");
    }
    else {
      print("You're not close enough.");
    }
  }
  else {
    reset(input_parsed);    // let logic 90 take care of it
  }
}

return();

I tried to write both "gun" and gun, but it came up an error that said that it should be an object, and when I write o1, it says "compile successful".

MagickPoultry

  • Guest
Re:Problems...
« Reply #4 on: February 18, 2004, 10:46:05 AM »
I'm sorry.  I should've been more specific.  Is there a "draw(o1)" command somewhere in the logic that gets executed every cycle?  For example, is it outside of the "if (new_room)" block?  If it is somewhere outside of any "if" statement, it will get executed every cycle, and the gun will look like it never got erased.  Or, if it is inside of an "if" statement that is still true during the next cycle, the same thing will happen.  So, probably, unless there is a reason to do otherwise, you should put the draw command inside the "if (new_room)" section.  If that's where it is already, then I don't know what the problem is off-hand.

Offline Chris Cromer

Re:Problems...
« Reply #5 on: February 18, 2004, 11:55:03 AM »
Joey is completley wrong so don't worry about doing those things because they will not work.

It would only have worked if he had defined the o1 as gun somewhere else, which most likely he didn't. I don't even define my objects when I work with AGI. I use o1, o2, o3, etc... instead of giving them defined names. And you don't have to define a name either.
« Last Edit: February 18, 2004, 11:56:44 AM by Chris Cromer »
Chris Cromer

It's all fun and games until someone get's hurt then it's just fun. ;)

Offline Martin

Re:Problems...
« Reply #6 on: February 18, 2004, 02:46:52 PM »
Thanks Jimmy! That was the problem.
Anyone knows anything about my other problem?

MagickPoultry

  • Guest
Re:Problems...
« Reply #7 on: February 18, 2004, 07:44:09 PM »
I'm not quite sure of what you mean by your second problem.  Is it "observe.objs(o1)" that you want, as opposed to "ignore.objs(o1)"?  That would make it so the ego can't walk through the bottom line of the object.  Is that what you want?

Offline Martin

Re:Problems...
« Reply #8 on: February 19, 2004, 09:45:37 AM »
Hmm... It is hard to explaine. Just so ego can`t walk over an object, I mean so that he stops when he reaches it.

MagickPoultry

  • Guest
Re:Problems...
« Reply #9 on: February 19, 2004, 11:36:51 AM »
I'm still not sure exactly what you mean, but how about doing the following:

distance(ego,o1,v255);

if (v255 < 5) {
  if (!isset(f255)) {
    set(f255);
    ego_dir = 0;
  }
}
else {
  reset(f255);
}

You can replace v255 with another variable and f255 with another flag, and you can replace 5 with whatever distance away from the object that you want the ego to stop walking.  What this ought to do is when the ego is walking and gets within a certain distance from the object, he'll stop, and then if the player presses an arrow, he should start walking again.  If he gets back within the distance again, he'll stop again.
If it's an object that you can pick up, once it gets erased, the distance between it and the ego should always be 255, so the ego shouldn't stop anymore.

There are other ways of doing the same thing.



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

Page created in 0.04 seconds with 21 queries.