Whats wrong here?

CaptFinnCaptFinn Member Posts: 1,828
edited June 2012 in Working with GS (Mac)
I have a actor. Its setting at a xy point when the scene start. When it starts it says if he is at that xy point to move right. But he doesnt move. And if he did move.... when he gets to 384/512 look at random and go where random tells him to. Seems to me the code is correct.. obviously its not. What am I doing wrong. I see it in my head. but its not working.

https://dl.dropbox.com/u/33589453/Untitled 2.zip


Im trying to duplicate the ghosts in Pacman. And using random to create a fake AI effect. Saying at intersection ( if X/Y is this) decide 1-4 to move up left right or down. which will take them to another crossroads that checks random each time.

Answers

  • AsymptoteellAsymptoteell Member Posts: 1,362
    It looks to me like in your code since the move is in a rule based on actor location, as soon as your actor starts to move, it can't anymore. You'll probably need to make an attribute switching on and off to set this part off.

    It's been a while since I've used randoms, but if I remember correctly, it's very hard to make a random work within repeating timer. I could be remembering wrong. I might be thinking of using a random amount of time, but you might have to change up how you're doing random so it's being done manually. I can't remember how to do that, but somebody here probably does, if you can't find it through searching.

    I hope some of that was helpful/not too rambly.

    Asymptoteell
  • CaptFinnCaptFinn Member Posts: 1,828
    Im sure there a demo or tutorial. But videos that are focused on 1 topic actually covers 3-4 but isnt titled as such. So some see a video as this tutorial and others see it as another. So searching tutorials and demos by keyword isnt up to par.

    I wonder if tables could be used to make this effect? Im still not full aware of what tables actually do. I get lost when watching a tables tutorial.
  • AsymptoteellAsymptoteell Member Posts: 1,362
    I'm not entirely sure on tables, but I'm pretty sure the basic idea is that a table is just another way of representing data where each box in the table is basically an attribute in your project. This new organization doesn't make a whole lot more physically possible, but makes projects with massive amounts of variables a reasonable feat for a human.

    On a more related note, now that I'm thinking about it, I think replacing your move with an Interpolate of your X and Y positions just might work. If I remember correctly, Interpolates always run to completion which I think is what you want here.

    I'm not sure if it will solve all your problems regarding randoms, etc., but that might at least make your actor move.
  • CaptFinnCaptFinn Member Posts: 1,828
    ill try that
Sign In or Register to comment.