tarek2's Recent Forum Activity

  • You cannot put a trigger in a subevent of another trigger, Construct doesn't allow that.

    The "on Key Pressed" is a trigger and "On collision" is another trigger.

    However, you can use "is overlapping" instead in a subevent.

  • It is better to save that type of data in one dictionary so you can load them all at once:

    -On level completed: Add Key "Level_Number" 
    -Save the dictionary.AsJSON into Local Storage
    

    Then at the level select layout:

    On start of layout: Load dictionary.AsJSON from Local storage
    ---------Loop check the levels Key if exist: If not then they are Not Complete yet.
    
  • Here is one possible idea:

    I linked them by instance variable but you can use any other method as long as you can pick the whole group at once to create the container.

    https://www.dropbox.com/s/o306qve8u7aj7g6/Drag%20Multiple%20Objects1.c3p?dl=0

  • There are many issues with this system:

    1-Passing Parameters is confusing

    2-You have to plan everything in advance

    Just planning everything in advance defeats the purpose of creating any "Function Maps" as for me calling by a string means freedom, as simple as:

    Give the Function Name, Parameters if any and done.

    runtime.callFunction("Function Name", Parameter0, Parameter1);
    

    Super simple.

    That's a true dynamic freedom for me at least. Where you dont have to plan anything in advance as everything comes naturally. Normally on most of the games you have to constantly redo the events to optimize, etc... So having to plan constantly "Function Maps" is just a waste of a lot of time in comparison to just:

    -Create a Function

    -Call: runtime.callFunction("Function Name", Parameter0, Parameter1)

    -Delete the function when not need it.

    Also, Dop Pool from one side and I heard many other users through the years that never use "Function Maps", so in true are more people than you think that dont use that. In the end, most of us will continue to use the Scripting just to cal functions and we will lose the advantage of:

    "function maps, you can rename a function and everything still works."

    Anyway.

    Maybe making some Analitycs to see who uses (Scripting Vs Function Maps) will give more accurate info on that probably.

    Or even an official Pool to see how many people use one or the other.

  • You can Clamp the Values:

    If you allow floats Numbers:

    clamp(float(Self.Text), 0, 99)

    If you dont allow floats Numbers:

    Use (Floor or Round) instead of Float

    https://www.dropbox.com/s/te2kpzvjryzn1q7/Clamp%20Value.c3p?dl=0

  • Hoh Sorry, I miss understood, I thought you said that It was not what you were looking for because once it reached (Opacity = 100) jumps to 0.

    No worries then)

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • > You don't need to use scripting to call a function from a string. The event system allows for this too with the function maps feature.

    It's easier to learn JavaScript than to use that, lol. I bet you wouldn't even use it on an actual project as well.

    Lol true))

    Since the new "Function Map" was introduced years ago I haven't seen anyone using it as sometimes this question comes randomly (Discord or Forum) and 99.9% say they use that trick using Scripting even if they dont know how to use JS or never use scripting including myself as at the moment I just use scripting when I need to call a Function by string. The few times that someone said they use it was a new user, so I guess because they never used the old Functions therefore they dont know the difference, so they wouldn't mind spending that much time trying to understand how the New "Function Maps" works which is quite complicate.

    The new "Function Map" could have a revisit to make it more useable in my opinion but if not it's fine the scripting trick is super easy, it's just every time that I use it I have to look at my examples as I keep forgetting the Script structure for the Functions but is not a big deal.

  • Its not what im looking for but solution is still good, because tween have ping pong option so once started fade to opacity 100 after that come back to 0.

    i use this, thank you kind game developers

    Works fine for me, here is an example:

    https://www.dropbox.com/s/y4vhvjel9pkbj7b/Fade_Layer.c3p?dl=0

    Make sure you set the tween Ease to something like Linear if you haven't done so, as the other tweens have different effects like bounce etc...

  • You can use the Tween behaviour:

    1-Add an invisible object outside the layout

    2-Add to that object the Tween behaviour

    Then you can do:

    Object Tween Value Start(100) End(0) Tag"Fade"

    Then for the layer:

    Object Tween is Tween Tag"Fade" playing: ---------Set Layer Opacity to Object.Tween.Value("Fade")

  • tarek2

    Thanks! I was able to fix it by disabling Default Controls and using Simulate Movement for each key instead. There must be something about the Default controls that don't like custom keys being used in tandem with them.

    It should work even with the default controller:

    I did a quick test to check it out and it works for me, here is the demo:

    https://www.dropbox.com/s/z3zgy86erpzpwfx/Platform%20Test.c3p?dl=0

    It must be something else in your project or a bug.

    Though glad you found a fix.

  • Create invisibly doors in all the entrances and add an instance variable "Door_Number" then set each door with its own unique number: 1,2,3, etc...

    Supposing that the Cave is in a separate layout:

    You need to repeat the same process and create all the invisible doors with the same "Door_Number" unique number: 1,2,3, etc...That you set it up above.

    1-Then on colliding with any door to enter the cave save the "Door_Number" in a global variable, Array, Dictionary, or whatever method you like.

    2-On Cave Layout:

    -At the start of the layout:

    ----------Door.Door_Number = Global Var "Door_Number": ---------Action:Set Character Position to DoorX,Y

tarek2's avatar

tarek2

Early Adopter

Member since 26 Jan, 2016

Twitter
tarek2 has 12 followers

Trophy Case

  • 8-Year Club
  • Forum Contributor Made 100 posts in the forums
  • Forum Patron Made 500 posts in the forums
  • Forum Hero Made 1,000 posts in the forums
  • Regular Visitor Visited Construct.net 7 days in a row
  • RTFM Read the fabulous manual
  • x5
    Great Comment One of your comments gets 3 upvotes
  • Email Verified

Progress

15/44
How to earn trophies