Mission System

Hello. Do I want to know how can I tell to my players where they have to go? I have a little spaceship game that it needs to fly from planet to planet, so I want to tell the player that it needs to go to that specific planet. (Basically telling them that you need to go from Point A to Point B). How can I randomize this mission system? Like Saying, you are now on the earth, please Go to Neptune.

Thank you beforehand.

I’m unsure if this will fully answer your question, which at its core sounds like “How do I choose a random element from a collection?”.
From what you put forward as your example, with a list of possible locations, while you’re at one, you could remove/ignore that particular place, and choose a random integer to use as an index for the collection.

If your question has more to it, please explain. :slight_smile:

1 Like

Yeah! you are getting there : D. Well, think about this. You are in a spaceship in our solar system. And you have to go from Mercury to the Earth, well, you go there. Then the game tells you to go from the Earth to Neptune, you go there. How can I do this?

If you’re still asking about just getting a random element, you just need:

  1. a collection (of places).
  2. a random integer to index into the collection.

and how about if I just update the text after a certain amount of time passes? for example, Say, ‘Go to Mars’ after some time, it says, ‘Now, go to Neptune.’ How can I do that? I don’t know how to update the text after a certain amount of time passes.

Maybe just set a “nextUpdate” float variable which could be Time.time + a variable float for how many seconds you want until the next mission update. Time.time is the current time, so if you add ‘10’ for example, the nextUpdate variable would be 10 seconds in the future :wink:
Maybe from what you’ve shared, you’d want to set the next time to some amount after they arrive at their current destination.