sgn15's Forum Posts

  • nimos100

    thanks. I have few questions:

    1. Can I use a key like this?

    "GameSave" & str(GameSave_Text.Array_X) & str(GameSave_Text.Array_Y)

    this is intended to add keys like

    GameSave00

    GameSave01

    GameSave02

    GameSave03

    GameSave10

    GameSave11

    GameSave12

    GameSave13

    and so on until GameSave43 (because my array size is 5,4,1)

    then set the values to their corresponding cells by retrieving from both the array and text objects.

    I used the first event in the pic (already working) for showing the values of array (GameSav_Array) into each text (GameSave_Text)'s instance variables called Array_X and Array_Y.

    Should the second event in the pic work?

    2. And since this is supposedly my solution for maintaining global variables's values even after closing, I can't really confirm if this all works without exporting it first before testing? or preview is enough to tell if it works?

  • nimos100

    ok thanks. I found dictionary and webstorage. I chose dictionary.

    Do I need to use "add key" action before using "Set key" action? or only "Set key" action?

  • In my game, after I close the game and open it again, the global variables reset to their initial values and arrays reset (to blank).

    I never used the "reset global variables" action in any event.

    Is this how it really works in C2?

  • I can't use "trigger once while true" because on collision is a trigger condition.

    I did try "trigger once while true" as a sub-event condition. I don't know why it still spawns 10 spark objects.

    I also tried adding (3rd level) sub-events under "trigger once while true" event like these:

    choose(1,2,3,4,5,6,7,8,9,10) = 1

    --> spawn at imagepoint 1

    choose(1,2,3,4,5,6,7,8,9,10) = 2

    --> spawn at imagepoint 2

    and so on

    still spawning 10 sparks

  • I have 10 imagepoints on the enemy (not including origin point) and I want to spawn a spark on a random imagepoint number from 1-10

    So I use an event like this

    Enemy on collision with player

    For Each Enemy

    -> Enemy spawns spark at layer 0 at imagepoint choose(1,2,3,4,5,6,7,8,9,10)

    but it spawns 10 sparks at the same time

    I tried this

    -> Enemy spawns spark at layer 0 at imagepoint floor(random(10))+1

    but it spawns 10 sparks the same.

    Is it not possible to use expressions (system expressions, that is) for imagepoint?

  • Zebbi

    the 2 sub-events should be same level.

    like this:

    Platform on landed

    ACTION ----> Set Bounce to 1 - Bounce

    --------sub-event: Bounce = 1

    --------ACTION ----> Set Vector Y to -600

    --------ACTION ----> Set Bounce to 0

    --------sub-event: Bounce = 0 (same level as sub-event above)

    --------ACTION ----> Set Bounce to 1

    technically, the way you do it in your screenshot is working only because you have the "set Bounce to 0" action before the sub-event with condition "Bounce = 0". Codes are read top to bottom.

    Just read the conditions from top to bottom, first check if landed, then Bounce = 1, then if Bounce = 0 ? The last 2 conditions are not possible to be true at the same time. So yeah the 2 sub-events should be same level

    if Bounce = 1,

    Bounce = 1 - Bounce

    Bounce = 1 - 1

    Bounce = 0

    if Bounce = 0

    Bounce = 1 - Bounce

    Bounce = 1 - 0

    Bounce = 1

    Let's just say you chose to use values that aren't 0 and 1, then you can't use that 1-Bounce expression/formula

    Quickly edited your screenshot here to match what I was saying

  • Platform on landed

    ACTION ----> Set Bounce to 1 - Bounce

    -sub-event: Bounce = 1

    ACTION ----> Set Vector Y to -600

    ACTION ----> Set Bounce to 0

    -sub-event: Bounce = 0

    ACTION ----> Set Bounce to 1

  • You do not have permission to view this post

  • Just a question about something I noticed.

    When a platform (which is in air) is overlapping with a moving platform (jumpthru with sine behavior), the platform tends to slow down on its vector y (both going up or going down) and fall through the jumpthru instead of falling on top of jumpthru (like how you fall on solid)?

    Is this how it really works?

  • You can use "Pick by comparison" to pick the first fire, then use a counter instance variable (of that first fire object)

    add1 spawn a 2nd fire,

    add 1 to counter of first fire object, 2nd fire spawns 3rd fire

    add 1 to counter of first fire object, 3rd fire spawns 4th fire

    and so on.

    Just check the value of the counter variable of first fire, you're not going to change anything in counter variables of 2nd to last fire objects. I assume all fire objects have the counter since I adviced instance var but you can use local or global var if you want. You only need to use 1 variable anyway. Then reset if necessary (depending on how you want the fire in your game).

    Pick by Comparison like this example

    Pick "fire object"

    which

    fire.uid (you can use other expressions like IID)

    =

    variable (save the uid of first fire into another variable (of player or global or local variable))

  • you can use a variable that acts as switch. Then add that variable as conditions for movement, so you can only use the right or left when the variable is a specific value. reset the variable's value when jumping/moving. For this, boolean-type variable can be good enough.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Based from how I understood the first post, sounds like you need the enemies behave independently from one another. Use "System: For Each"

  • You can try using a global variable. Set the global variable to a new value if you hit that specific monster. then at start of layout 1, create 2 sub-events checking the global variable's value. Do the actions you want to happen (start anew or resume) depending on the global variable (the 2 sub events). You might also want to read about Persist behavior (but I haven't used this behavior myself, so I don't know if it fits your problem)

  • There's no "pause all" action for audio so I guess that (using individual pause actions for each tag) is probably the solution.

    Also tried the audio time scale, seems there are some things missing to be done before it works?

    Use the sign with the username to send a notification to that user so he can remember this thread.

  • I just noticed my avatar changed by itself? Is that automatic based on posts or something?

    grigrizljac