Help needed with experience triggered events

  • Hello all,

    I am still very new to C2 and have a question.

    I have a layout representing a planet and for the player to leave this planet he needs a flying skill of 5. I have a global variable called "Flying"

    In the layout is a flightschool button ("LearnToFlyButton") with the following event:

    Mouse->On left button clicked LearnToFlyButton->

    Followed by the following two actions:

    System->Add 1 to Flying

    FlyingText-> Set text to "Flying skill: " & Flying

    And I have a Textbutton "Depart planet" ("DepartButton") with the following (incomplete) event:

    Mouse->on left button clicked DepartButton ->System-> go to Galaxy Layout***

    *** Now the player should only be able to depart the planet once his flying skills reach 5 and only then "Go to Galaxy Layout" action should happen. But I'm lost at the monent...

    QUESTIONS:

    1) What does my Event sheet need to make this happen? What I would like is that, when clicking on the 'Depart Planet" button and the player's flying skills are LESS than 5, it should give like an error-message aswell.

    2) I would like to add triggers that set off when the player reaches e.g. flying skill 50, 100, 200 enabling him to do new things due to increasing experience. What do I need for this?

    Thanks you very much for your time and help, Regards from the Netherlands.

    Rizzo

  • Events can have more than one condition. So the value of Flying becomes an additional condition required to trigger the event... and then you can have an "Else" that gives a "your flying is too low" message if their skill isn't high enough.

  • Thank you for replying Televangelist.

    Could you please clarify that with an example?

    Thank you so much,

    Rizo

  • Mark the event "Mouse->on left button clicked DepartButton ->System-> go to Galaxy Layout***" and press C on your keyboard to add another Condition. Go to System, campare variable "flying skills > 5"

    Then mark that event and press X on your keyboard to make an else event and do whatever you want to there

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Thanks for clarifying Detteman,

    I was able to add the" flying skill greater/equal to 5" condition which enables the player to leave the planet

    but after that it won't let me add an else event

    I tried to come up with an alternative and made a second event but now with a "flying skill lower than 5" condition attached. In the attached action I show a text-message saying that 'flying skills are too low'. Problem now is that this message won't dissapear once I hit a flying skill of 5.

    Any idea why it wouldn't let me add an 'else'? Again here is the event:

    Mouse-> On left button clicked BUTTON-> Go to Galacy Layout

    System-> Flying >5 (=Second condition in same event)

  • I think I got it working, but I'm not sure if it's 'pretty';

    Event #1:

    System-> Flying <5 -> BUTTON-> set text to "To depart planet, first raise your flying skills to 5"

    Event #2:

    System-> else -> BUTTON -> Set text to "Click to visit another planet"

    Event #3:

    Mouse-> On left button clicked on BUTTON -> System -> Go to Galaxy Layout

    System -> Flying (Greater equal then) 5 -> (= this is the second condition of event #3)

    Am I on the right track?

  • Sorry! Of course you cant add an else to that condition. What you should do is create an event with sub-events. Something like this:

    Condition - Button pressed

    sub-event - flying skill >= 5 - Do this

    sub-event - flying skill < 5 - Do that (or you can make THIS an 'else')

    All this will be in one event.

    To add a sub-event just mark the event and press S. Or right click on the event and choose sub-event.

  • Got it working, thanks!

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)