dop2000's Forum Posts

  • Save the file to your computer.

    Launch Construct 3. In Construct 3 menu select Project -> Open Local File. Or click "File" button on the start screen.

  • Why would you actually need duplicate functions? That doesn‘t sound that great. What‘s the exact use case you have? Just curious :)

    I'm making a point-and-click adventure game with lots of layouts (scenes) and hundreds of different items. There is a single MAIN event sheet included into all layout event sheets, which handles all the core mechanics in the game - clicking items, dragging items, combining, destroying, gestures, tasks etc. So far so good, right?

    But sometimes I need to run custom events and actions, for example, in "Save the princess" scene when a sword is dropped on a dragon I want to spawn blood particles. I can't do this in the MAIN sheet, obviously. That's why I am calling a function "Item_Arrived" from the MAIN event sheet whenever any object on the scene has arrived to its destination. And I have duplicates of "Item_Arrived" function in every small event sheet for every scene.

    So in the princess scene inside this function I can check if the item_code=sword and spawn blood. In another scene in the same function I can do something else.

    I have several such functions ("Item_Clicked", "Item_Arrived", "Task_Completed" etc.), with duplicates for every scene.

    If I had to create the same system with new functions, I would either have to make a very complex function map, or use a huge single function with hundreds of sub-events.

  • Open this file with Construct 3.

  • It doesn't matter what you use, dictionary or array. But since you have 1000 levels, array is preferable.

  • Whoa, that's a very cool game!

    I didn't notice you have two very similar looking variables Control_ID and Control_AI.. But I still think the mistake is in the first condition - D_Fighter_Ruleset Key "Animation_Name"=Fighter_Control.Control_ID

    When you have two Fighter_Control objects with different Control_ID values, this condition will pick only one D_Fighter_Ruleset instance, belonging to the first instance of Fighter_Control. If you need to check the dictionary for both fighters, you need to add For Each above the condition.

    .

    The rest of the event looks ok to me, although I would strongly recommend removing Trigger Once from sub-events. Trigger Once doesn't work "per instance", so in case of multiple instances it will almost certainly cause bugs and problems.

  • It's hard to tell from the screenshot what are you trying to do there. If these events are located at the top level (not nested under a function or something) and executed on every tick, then the problem must be with the condition where you pick dictionary instance - D_Fighter Key "Animation_Name"=Fighter_Control.Control_ID.

    If you don't pick the correct Fighter_Control instance first, then this condition will use Control_ID value of the first instance. And will probably pick only the first dictionary instance also. So if you need to process all Fighter_Controls in this event, you should add "For each" at the top.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Your enemies can't walk because there are no actions telling them to walk. Yes, you are setting variables, but it isn't enough. You need to run actions like "Simulate control" or "Set vector".

    Also, in events 13-16 replace Enemy_bases with enemy_direction. If you pick an object in the event, you should use the same object in actions. If you pick a family in events, you should use the family in actions. If you mix them like you did, your code will not work correctly with multiple instances.

  • So, the main object is Fighter_Control, it's in a container with a Dictionary. And you also have Fighter_Images family, which should be linked with each Fighter_Control. Is this correct?

    Is the Control_AI variable unique for each Fighter_Control instance? If it is, then it should be enough to associate Fighter_Images instances with their corresponding Fighter_Control, and to pick them in any events.

    But from your screenshot it looks like Control_AI is not unique, for example can it be -1 for both Fighter_Control?

    If Control_AI is not unique, or if its value can change during the game, then you should add another instance variable Fighter_Control_UID on the Fighter_Images family, and use it to link images with the control instance.

  • Check out this demo:

    howtoconstructdemos.com/create-a-realistic-chain-or-rope-with-physics

    Don't use Pin with Physics objects. If you need to fix it in place, set it immovable.

  • You are just guessing, you need to read about arrays.

    construct.net/en/make-games/manuals/construct-3/plugin-reference/array

    freecodecamp.org/news/data-structures-101-arrays-a-visual-introduction-for-beginners-7f013bcc355a

    You now have a 2-dimentional array. X index is the level (character or object). In Y=0 index you have XP requirement for the character leveling up, in Y=1 index you have have char_level requirement for the object upgrading. So you need to lookup the correct Y index.

    In my opinion this array structure is confusing, especially for a beginner. I suggest making two separate arrays - one for character leveling up, another for your object upgrading.

  • Set Position will "teleport" the object instantly. If you need to move it over time to that position, use MoveTo behavior.

  • Add this action immediately after "Array Push Back":

    BursLevel Set at XY

    X=self.width-1

    Y=1

    Value=int(tokenat(tokenat(s, loopindex, newline), 2, ","))

  • Old functions are working in C3 runtime. And I hope will be supported for a long time (since they are used in many games).

    I actually had to add old Function object into a project recently, because I really needed duplicate functions with the same name in multiple event sheets. And I couldn't find a simple substitute for this with the new functions.