dop2000's Forum Posts

  • pirx Using "On Created" is a clever idea, as it's triggered immediately. Anyway, at the moment I am quite happy with the current system. If in the future (very distant I hope), old functions stop working, I'm sure I'll find some replacement.

  • Ashley, and what will trigger those layout-specific functions?

    There is about a dozen different ways players can interact with items in the game. Besides, every scene is heavily scripted. All of this is currently handled by the MAIN event sheet (200+ events). I can't move this code to layout event sheets, this will not make any sense.

    .

    Anyway, I didn't mean to hijack this thread, sorry :)

    I am not trying to say that the old functions are better, only that in some cases they are more convenient.

  • Another approach would be to have unique functions on every layout

    This is not possible in my project. Like I said, all core mechanics is in the MAIN event sheet - it performs a bunch of different checks, gestures recognition, modifies instance variables, enables/disables behaviors etc. And only then it calls a custom function from layout event sheet for some finishing touches.

    The only way for me to use new functions here is to call them by string name from a script, as chadorireborn suggested. And I will still end up with a thousand function names in the list..

  • If you want the camera to follow the player smoothly, the most common way to do this is with lerp:

    Camera set x to lerp(self.x, player.x, dt)

    If you want to move the camera only when needed (for example, when player walks into another room), the easiest solution would be using MoveTo behavior.

  • C3 has Drawing Canvas object. Unfortunately, there are no other alternatives.

  • You start animations in some other events, you can run your code there, or call a function. For frame changes use "On frame changed" event, it's triggered only once for every frame per each object instance.

    I also use this little trick, where I define an image point on one frame in a long animation, to mark it as a "key" frame:

  • That makes sense, although what could I use as an alternative? If I wanted to run something only once when the animation starts, or only once when a frame starts what would I use instead of trigger once?

    You start animations in some events, use the same events to run your code, or call a function from there. For frames - you can use "On frame changed" event, it's triggered only once for each frame.

  • I would suggest using function maps instead.

    Ashley I know about function maps, but they are not very well suited for large projects like this. At the moment I have about 7 "shared" functions in 10 different layouts. This number will likely grow to 10-15 functions and there may be 50-100-150 layouts in the game. With new functions, imagine the list I will have to scroll through in the Call Function dialog, or in the dropdown box for Map Function dialog! And I will need 1000+ actions just to create this huge map.

    Old Functions are closer to triggered events, and there is nothing wrong in having the same event like "On Item clicked" in multiple event sheets. So it seems fine to me to have the same function "Item_Click" in multiple sheets. If this was a design mistake, it was a fortunate one.

  • Think of it as the same one function spread over multiple event sheets.

  • WackyToaster Yeah, I used this method too - calling functions by name from an instance variable. But if I have 100 scenes with 10 custom functions that I need to call from each scene, I will end up with 1000 different functions names! Re-using the same function name in every scene is so much more convenient.

  • Since the rope is made with Physics, you should only move it with Physics actions. And don't apply too much force. If you try to pull it with some other behavior (Platform, 8-direction), it will break.

  • Here is an example of a simple follower for 8-direction

    howtoconstructdemos.com/simple-follower-for-8-direction-behavior-capx

  • You forgot to assign a tag to the music in event 13.

    Also, you might want to add "Trigger once" to event 50.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You need to post your project file with the imported tileset.