move to??

starcat

  • Posts: 104
ok, ive been pouring over my knowledge gained so far, and Making a target "Move to" another target seems overly complicated. ive made tons and tons of attributes. tried all kinds of math. looked at every single "template" and none of them seems to work? is there a simple "move to" block that im missing somewhere?

if not can we please make one? i will litterally give you 10 dollars.

Blob

  • *
  • Posts: 722
It should look something like this screenshot. Fill in the [choose actor type] slot with the actor you want to be followed and attach the behavior to the actor that follows it. The 'Actor to Follow' attribute is an actor attribute. You can use math to change the coordinates to follow to your liking.

If you don't know where any of the blocks are then use the search bar.

~ Blob

sketchling

  • Posts: 17
I assume you mean move in the direction of the target... as in apply force to an actor so that it moves towards the actor? I did something like that in a recent experiment and I used atan to figure out the angle to the destination with triganometry, then I applied a force to the actor with that direction. I think there are other ways... im not at my home machine or i'd include a screenshot.

starcat

  • Posts: 104
yes. the above example didnt work.

there has to be an easier way to do this. i dont understand why a simple set velocity to players x and players Y do every .2 seconds wont work

btw, the behavior above teleports the enemy to me and no motion behavior makes him move twords me.

« Last Edit: September 21, 2011, 04:14:38 am by starcat »

coleislazy

  • *
  • Posts: 2607
Target is the actor to follow, and obviously you can set speed to whatever you want.

starcat

  • Posts: 104
thanks! i appriciate that and it does work. however for SOME reason it screws up the rest of my code, so now i cant fire bullets properly :(

ya ive tested it over and over. something in that math code messes up the logic for the rest of the game.. maybe jon can look at it? might be a glitch

« Last Edit: September 21, 2011, 05:38:55 am by starcat »

coleislazy

  • *
  • Posts: 2607
I can almost guarantee it is not a bug with SW. Can you post a screenshot of your behavior so we can figure out what's happening?

starcat

  • Posts: 104
the first one is my 8 way shooting which works perfectly before this math thing.

the second one works fine on its own. but screws up the bullet behavior.

« Last Edit: September 21, 2011, 07:37:33 am by starcat »

coleislazy

  • *
  • Posts: 2607
Can you describe what is happening and what should be happening? I don't see any obvious problems with your behaviors.

starcat

  • Posts: 104
here is the working firing.. WASD and up down left right

http://www.stencyl.com/game/play/7631


here is what happens after i enter the AI

http://www.stencyl.com/game/play/7632

coleislazy

  • *
  • Posts: 2607
It seems like your bullets are set to follow the player as well. Did you attach this behavior to them by mistake?

starcat

  • Posts: 104
hmm i dont think so. lemme check.. if they were set to follow the actor then why arent they doing it before the math ai?

starcat

  • Posts: 104
Ahahha yer a friggin genius. thanks man :)