GameMaker: Studio

GameMaker: Studio

View Stats:
smill Apr 26, 2015 @ 10:06am
FNAF AI
I have been making a fan game of Five Nights at Freddy's (Five Nights at DuckTales) and I am stuck on the AI. I have an object called obj_gamecontroller which makes the louieposition = choose(0,1,2,3,ect,) and if it is equal to e.g. 1 the anamatronic would be in the hallway. There are 2 different rooms, the office and all of the cameras. But whenever I reload the camera, he is in a new position, I know why though, in the create event I said louieposition = choose(0,1,2,3,4) and everytime I reload the camera it finds the value of that variable. What can I do to fix this??? Is there anything I can set the variable to to make it so he is in the same place as when you looked at the camera last??? PLEASE HELP!
< >
Showing 1-3 of 3 comments
Thew Apr 26, 2015 @ 10:18am 
If you only want it's create event to run once, make sure you have "persistent" checked in the gamecontroller object.

You can always have the position change later (like with an alarm, for example).
Puppyguard Apr 26, 2015 @ 10:20am 
Originally posted by popcoo:
-snip- Is there anything I can set the variable to to make it so he is in the same place as when you looked at the camera last??? -snip-
random_set_seed([number])
I don't know if this will help you though...
Last edited by Puppyguard; Apr 26, 2015 @ 10:21am
smill Apr 26, 2015 @ 12:56pm 
Thanks so much guys, I really needed that help ! :D
< >
Showing 1-3 of 3 comments
Per page: 1530 50

Date Posted: Apr 26, 2015 @ 10:06am
Posts: 3