Vallar's Forum Posts

  • Hello,

    Perhaps adding the "Character > On collision with spellBook" beneath Touch > On any touch end as a sub event and adding an else (else to the Character on collision with spellBook) to run the shoot.

    It would look like this:

    Touch > On any touch end

    .... Charachter > On collision with spellBook -- Destroy and Set animation to "characterStarAnim"

    .... Else -- -- Set animation to "shoot"

    I think that should do the trick for you.

    Hope that helps.

  • Glad it worked ^_^ and good luck!

  • Hello,

    I didn't know that... glad you mentioned it. Still you can do the same thing, all you need to do is just cast the number as a string at the getter and set it as text with the setter.

    So when you set the key, instead of setting it to the number 1, you set it to the text "1".

    When you however do the random code from the example above; it should be like below:

    Textname > Set Text = "I'm a " & Professions.Get(str(round(random(1,3)))) & " from the " & Cities.Get(str(round(random(1,3)))) & "."

    That bold bit would change the number to text so it would match the key you entered.

    Hope that helps.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hello,

    I don't know if this is the best way, but it should work: you can create a Dictionary for all "professions" for example and the keys would be using numbers so it would look like the below:

    key:1 value:carpenter

    key:2 value:smith

    key:3 value:doctor

    Then you can create another dictionary for cities and call it Cities perhaps

    Then you'd have an event to set the text:

    Textname > Set Text = "I'm a " & Professions.Get(round(random(1,3))) & " from the " & Cities.Get(round(random(1,3))) & "."

    Hope that helps.

  • Thank you very much, that did the trick. ^_^

  • Still looking for the solution of multiple layouts using 1 event sheet... any idea how this is resolved?

  • I hope that works, if so, I am glad it did

  • Bump... still looking for a solution to this problem. Anyone know how to get around this?

  • Well, using the same logic and almost the same action from your other thread:

    How do I change layout at certain score?

    You can do it like this:

    System > Compare Variable Value (Score = 50) -- System Go to Layout (name of layout)

    System > Compare Variable Value (either create a variable that checks the death of player or have a health variable for example to check that) -- System Go to Layout (the starting layout).

    The above will send you to the start if you die or if you get 50 score, you get the next layout on the list

    If however you want that the score will keep on loading the next layout automatically without you having to enter the Layout name after the score is 50. I think something along the below would work:

    For the sake of the example, I'll assume that you have your levels named as "Level1", "Level2", "Level3", etc... and that you will load "Level5" if the score reaches 50

    Create a global variable called LevelNumber (for example) and set the default value to 5.

    System > Compare Variable Value (Score = 50) -- System > Go to Layout ("Level" & LevelNumber)

    -- System > Add to Variable (LevelNumber) 1

    System > Compare Variable Value (Score = 50)

    AND

    System > Compare Variable Value (LevelNumber > 5) -- System Go to Layout ("Level" & LevelNumber)

    -- System > Add to Variable (LevelNumber) 1

    Hope the above makes sense.

  • Yoi can create an event like below:

    System > Compare variable (score = 100) -- System > Go to Layout (whatever layout).

    Hope that helps.

  • Hello,

    Since C2 free version is limited by 100 events, I am using 1 Event Sheet for more than 1 layout to try and work within the 100 events boundary. However, some of the levels in my game are a bit different in mechanics than the rest.

    I would like to do something along the lines of "If a certain Layout is currently running, do X, Y and Z."

    How can I do that?

    Also (since the question text field wasn't enough to include this) I have this object that acts as a wall. I imported 3 different types of these walls and tweaked each as a separate object (instead of combining them into 1 object with different animations). The problem is, I need to run events for the 3 types now and I am running out of events in my game so is there a way to merge three sprites instead of recreating them?

    I understand I can redo everything -- that is the point of asking this, I don't want to redo all the work I did for the 3 types again.

    Thank you very much in advance,

    Vallar.

  • I think if you set Fade Out to 0 and set the time for Fade In in the Fade behavior properties that would do the trick.

  • You do not have permission to view this post

  • Right, I see... wow... that is pretty stupid. Sorry about that and thank you very much :O

  • Hello,

    I know this sounds really easy and basic; but for some reason it doesn't work. I have this sprite that I added the "Scroll To" effect and the camera won't move with it. For some reason at one point while moving upwards through the game, it will stop and won't move further. I tried doing a lot of things but nothing is working, any idea what I am doing wrong?

    Thank you very much.