Ambiera ForumDiscussions, Help and Support. |
|
|
|||||
|
Hello to everyone! I am making a game where the main character must collect, lets say, some "objects". But in order to win the game he must collect them in a certain order. For example first the blue one, then the red one etc... Is there a way to declare it in the game scenario? |
||||
|
Hey! It's possible if you work a lot with variables. In short, you have to define a variable every time somethings happends. Lets assume you have a player/camera walking around in a terraing and need to press a key in order to get an object on the ground when near it. So, start with the proximity behaviour: When player is near blue object, then variable "pick_up_blue"=1. This is a trigger that tells you that it is POSSIBLE to pick it up, otherwise its 0 and not able to be picked up. And then if the player picks up that blue object by pressing a key, you instruct another variable to be "blue=1", which means that you now have it. But lets say you need to have the red first: When key pressed (when the player wants to pick up the blue object), you first check if the varible "red"=1 and if so, variable "blue"=1, if NOT, then variable "pick_up_blue"=0, which makes it impossible to pick up the blue object. That's a basic version of how to do it. You also need to hide the triggers when the objects are picked up, and also make the triggers "pick-up-x"=0, when the player leaves the vicinity of the object, otherwise you are able to pick them up from miles away. Etc... |
||||
|
Thank you very much for your answer, i am giving it a try right now! Just 1 question: you said "But lets say you need to have the red first: When key pressed (when the player wants to pick up the blue object), you first check if the varible "red"=1 and if so, variable "blue"=1, if NOT, then variable "pick_up_blue"=0, which makes it impossible to pick up the blue object." why check if red = 1?? if it is 1 it means tha i have already picked it up. |
||||
|
Ok blackwater, I got it!!! thank you again! |
|