Bug/help in move to action

Non-platform specific questions.

Bug/help in move to action

Postby Freddy » Sat Oct 20, 2007 12:34 pm

I think there is a bug in the draw actor -> move_to function. When you use another event such as keydown, the move to works fine, but with draw actor, the actor that needs to move stays still, at least when there are obsticales. Is there a way that I can have an actor move to another actor, and dodge obsticales? Here is a screenshot to help explain. The red dot represents a zombie. The blue dot represents you. I want the red dot to move towards the blue dot, while avoiding the buildings. And of course the player would be moving around too, so it would be nice if the zombie could keep renewing the targeted location. Please reply if there is a way to do this, it is crucial to my new game. :)
Attachments
Inferi.png
Hola
User avatar
Freddy
 
Posts: 548
Joined: Sat Jun 02, 2007 3:42 pm
Location: Why do you want to know?
Score: 14 Give a positive score

Re: Bug/help in move to action

Postby Fuzzy » Sun Oct 21, 2007 6:55 am

There are two move-to functions. one is for draw, and the other is to move actors. You want to use MoveTo and not moveto
Mortal Enemy of IF....THEN(and Inspector Gadget)

Still ThreeFingerPete to tekdino
User avatar
Fuzzy
 
Posts: 1068
Joined: Thu Mar 03, 2005 9:32 am
Location: Plymostic Programmer
Score: 95 Give a positive score

Re: Bug/help in move to action

Postby Freddy » Sun Oct 21, 2007 3:11 pm

Yes, I did that, but if you put obsticales in the way, it wont move at all. :(
Hola
User avatar
Freddy
 
Posts: 548
Joined: Sat Jun 02, 2007 3:42 pm
Location: Why do you want to know?
Score: 14 Give a positive score

Re: Bug/help in move to action

Postby Fuzzy » Mon Oct 22, 2007 3:15 am

Oh I see. you are looking for path-finding. Google A* and or pathfinding. its been done to death. Lots of information out there
Mortal Enemy of IF....THEN(and Inspector Gadget)

Still ThreeFingerPete to tekdino
User avatar
Fuzzy
 
Posts: 1068
Joined: Thu Mar 03, 2005 9:32 am
Location: Plymostic Programmer
Score: 95 Give a positive score

Re: Bug/help in move to action

Postby DilloDude » Mon Oct 22, 2007 8:14 am

Does the avoid with MoveTo work properly when used with another event?
Image
User avatar
DilloDude
 
Posts: 866
Joined: Tue Jan 24, 2006 9:51 am
Location: Nyerellion
Score: 58 Give a positive score

Re: Bug/help in move to action

Postby makslane » Mon Oct 22, 2007 1:26 pm

The avoid option of the Move To action uses the A* algorithm.
The action calculates the path only when is called. If you want to update the path, you can call the Move To action in a Draw Actor event.
Game Editor is an open source game creator software that's wants to pay it's developers to keep evolving.
If you like Game Editor, make a review!
makslane
Site Admin
 
Posts: 3947
Joined: Sat Apr 05, 2003 6:47 pm
Score: 182 Give a positive score

Re: Bug/help in move to action

Postby Freddy » Tue Oct 23, 2007 11:34 pm

I already made the draw actor MoveTo event, but when I made it avoid an obsticale, it would not move. I have a question about the A* for Fuzzy though: How on earth am I supposed to apply the concept to GE? I also dont get a word of it, but I only made one search, so I will keep trying :D .
Hola
User avatar
Freddy
 
Posts: 548
Joined: Sat Jun 02, 2007 3:42 pm
Location: Why do you want to know?
Score: 14 Give a positive score

Re: Bug/help in move to action

Postby Kalladdolf » Wed Oct 24, 2007 9:21 am

I got another question.
can u also make an actor avoid others without moving to something?
for example: I got a spaceship an asteroids are flying towards it and it has to avoid them automatically.
how?
User avatar
Kalladdolf
 
Posts: 2427
Joined: Sat Sep 08, 2007 8:22 am
Location: Germany
Score: 120 Give a positive score

Re: Bug/help in move to action

Postby Bee-Ant » Wed Oct 24, 2007 1:26 pm

Ship>DrawActor>ScriptEditor>
Code: Select all
if(y==asteroid.y+25) //if the asteroids are moving down
{
    avoid=rand(10);
    if(avoid<5)
    {
         x=x+5;
    }
    if(avoid>5)
    {
         x=x-5;
    }
}

maybe it could works...
User avatar
Bee-Ant
 
Posts: 3723
Joined: Wed Apr 11, 2007 12:05 pm
Location: http://www.instagram.com/bee_ant
Score: 210 Give a positive score

Re: Bug/help in move to action

Postby Kalladdolf » Wed Oct 24, 2007 1:36 pm

There's actually a function called "avoid"?
Why didn't I see it???
and in your code it seems like avoid is horizontal... :?
User avatar
Kalladdolf
 
Posts: 2427
Joined: Sat Sep 08, 2007 8:22 am
Location: Germany
Score: 120 Give a positive score

Re: Bug/help in move to action

Postby Bee-Ant » Wed Oct 24, 2007 1:51 pm

No, it's an actor variable...
Uh huh... :D
User avatar
Bee-Ant
 
Posts: 3723
Joined: Wed Apr 11, 2007 12:05 pm
Location: http://www.instagram.com/bee_ant
Score: 210 Give a positive score

Re: Bug/help in move to action

Postby Kalladdolf » Wed Oct 24, 2007 1:54 pm

AH, I get what u mean!
that's too easy!
why didn't I think of that?
*sniff*
buhuuuuuuuuuuu!
do you know where ma brains is?
User avatar
Kalladdolf
 
Posts: 2427
Joined: Sat Sep 08, 2007 8:22 am
Location: Germany
Score: 120 Give a positive score

Re: Bug/help in move to action

Postby Bee-Ant » Wed Oct 24, 2007 1:59 pm

In your knee :P nonono...don't hear me
User avatar
Bee-Ant
 
Posts: 3723
Joined: Wed Apr 11, 2007 12:05 pm
Location: http://www.instagram.com/bee_ant
Score: 210 Give a positive score

Re: Bug/help in move to action

Postby Kalladdolf » Wed Oct 24, 2007 5:21 pm

I ate it for breakfast :D
Now, I'm tired.
G'night!
User avatar
Kalladdolf
 
Posts: 2427
Joined: Sat Sep 08, 2007 8:22 am
Location: Germany
Score: 120 Give a positive score

Re: Bug/help in move to action

Postby Bee-Ant » Thu Oct 25, 2007 1:48 pm

I realy fun could online together with you Kall... :D
But you can't stay here longer... :(
User avatar
Bee-Ant
 
Posts: 3723
Joined: Wed Apr 11, 2007 12:05 pm
Location: http://www.instagram.com/bee_ant
Score: 210 Give a positive score

Next

Return to General

Who is online

Users browsing this forum: No registered users and 1 guest

cron