playMaker

Author Topic: Saving the position of Random Generation !!  (Read 1427 times)

raje150

  • Playmaker Newbie
  • *
  • Posts: 13
Saving the position of Random Generation !!
« on: November 14, 2016, 11:24:33 PM »
HI,

i am making a mobile game where there is ai keep searching the player and he has tokeep avoiding them and he can go in any direction. its top down 2d. i made a simple system where the player moves wherever i touch the screen and the camera moves with player and obstacles, house, hiding places are randomly placed as he moves.

i mostly used the m2h random game example to create the random generation. so now is there a way to save the position of random position of objects,  so when i go back to the previous position, it all stays the same and not a new random position. i kept a trigger outside the game view to despawn the prefabs . so any help here??

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Saving the position of Random Generation !!
« Reply #1 on: November 15, 2016, 01:11:00 AM »
Hi,

 if it only matters during runtime, save it into arrays ( or hashtables using ArrayMaker), if it matters that they persists between game sessions, you'll need to use PlayerPrefs.

 Bye,

 Jean

raje150

  • Playmaker Newbie
  • *
  • Posts: 13
Re: Saving the position of Random Generation !!
« Reply #2 on: November 15, 2016, 04:36:39 AM »
Hi Jean,

thanks for the reply. This is a single level only, there's no save option or other levels. if the players gets out, he has to restart again.

and yes as per u said, i tried the array maker. i made the random prefab to get inside the array list proxy after its created. now is there a way to deactivate the prefab that touches the trigger. and then reactivate it when again it comes to view. ?

i saw an event which activates or deactivates the total game objects in the array maker. but nothing as specific index from array maker.

or is there any good way to remove the game objects when its away from game view in array maker ?

thanks again

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Saving the position of Random Generation !!
« Reply #3 on: November 17, 2016, 02:43:45 AM »
Hi,

 you need to check for its visibility and take actions based on that. there is no built in system for ArrayMaker to do that, so you'll have to implemenbt the logic of when to delete a given gameobject from a list.


 Bye,

 Jean