santiagoestrade's Forum Posts

  • I'm not pretty sure whether I could be talking nonsense, but I think the issue is you are making player the object condition for the zombie animation.

    If you say compare if player is X then zombie do something, runtime doesn't know which zombie to pick. If there is just one zombie at a time it doesn't matter, yet if there are more... That would be why it doesn't recognize right or left, for it gets confuses about which zombie to reference. The main event where the check sub-event comes from is even an everytick.

    The expression for checking distance/position in the expression box is just a system comparison, either true or false. It is not picking the zombie from the expression, but the player. Be the condition referenced to the zombie object and then into the expression box, distance from zombie to the player, the right one would be picked. As to say:

    - System Compare Zombie (expression: distance to player, position...) >

    > Zombie set animation to Zombie.Animation

    Forgive me in advanced if I am unnecessarily messing and you already took that into notice or solved by other means of picking. I only say becaise recently I had the same issue regarding path lines which didn't properly aim to their own troop for they were not correctly picked and was creating a domino-like chain effect from a fore event. After using line objects to check the events, rather than troop object, it all started to work right away.

  • I even found a more elegant solution than sub-events with Else. Given there are just two options, a ternary operator does the job with just one line of code:

    - On double tap gesture on Troop >

    > Call function ( Troop.UID = ActiveTroop ? "DropTroop" : "PickTroop" ) (Troop.UID)

    I eventually managed to find the post from the forum I read it from and then ended up here:

    construct.net/en/make-games/manuals/construct-3/project-primitives/events/expressions

  • I am up to a board strategy game. The way I want its controls to be is- when I double tap a troop that is not active, it gets enabled. When I double tap an already active troop, it gets disabled.

    But it's giving me some trouble and I can't figure it out, for the manner I have handled it, at double tapping troop, it gets first activated and them deactivaed. Or viceversa. It all depends on the order of the events.

    If I place first the activate event, it triggers for a non active troop, thus it being active for the time the next deactivate event takes place. So it recognizes it as active and disables it.

    If I swap the order, it deactivates and then recognizes it being non active and activates it. So it is always a loop.

    I need it to check the first event (troop being active or inactive, doesn't matter), and be it true, trigger skipping the next event-block. Only when being false the first event-block, it would step on to the next event-block. Otherwise, doesn't take it into account.

    1drv.ms/u/s!AojCIgmN1VlPgYVKToDc8b5aVFaRkQ

    I must be missing something pretty basic. Remember vaguely having read something about it somewhere around 'if, else, run once...', 'how events work' or maybe on the loops section, but I cannot find any reference now there nor the forum.

    edit- nevermind, it was 'else' that I tried but had put it on the main triggering condition. Now in the sub-event is properly working as expected. Rookie fail...

  • Anyway, my issue was not being able to calculate distance. I had indeed on the event sheet to demonstrate it started recognizing dragging the very moment you touch the object. The problem was that it worked that way. But with your tip, it's simple enough. You saved my day!

  • Oh God! Why I didn't come to that by myself? You're right. As simple as per scrolling (touchEnd against touchStart). Checking distance between touches. Comparing arrow position with troop position for triggering might fit as well.

    I have just fixed the sample capx with both options. I'll work with them on my full project to see which takes less code to make stable.

    Refering to touch position implies using at least 4 variables, 2 of them being updated every tick while dragging. Refering to arrow&troop may create some conflict at picking among all troops and arrows around though. Yet simple to work around with sub-events and function parameters.

  • I am developing a board strategy game, where turn by turn, each player chooses a troop and aims to a tile. Then an arrow shows up towards that tile.

    My issue is I want to make the aiming by drag. But, if I use condition 'on drag start', as the manual says, it is triggered by a tap or touch, without actually comparing whether the object moves or not. The point is that I have also tried with 'is dragging' and surprisingly, it neither compares movement. So I have no way of making a condition that triggers if one drags the object at least some pixels, but doesn't trigger if one just tap it.

    Has anyone some clue of how to work around that?

    1drv.ms/u/s!AojCIgmN1VlPgYVGFDQ-kKJxZ9TKwQ

    I have an example capx where you can see the starting position of the sprite and the 'triggering' position of it until runtime recognizes it being dragged. Distance before dragging triggers is always 0!!! So 'on drag start' is exactly the same as 'os dragging', for they both get triggered with just a touch or tap. I know one is a trigger by itself and the other is a cpntinuous condition. But, is there a way to triggere something after the dragging has been of at least a few pixels, so a tap wouldn't trigger it as well?

    must add-

    when aiming to a tile, the line of the arrow repositions and changes width and angle according too the troop while dragging, so I need a work around that fits both for one-time triggering and continuously comparing.

    I need to make a 'repeat once' event that triggers at start of drag to activate the troop and reveal the arrow, and another event that keeps repositioning and widening the arrow while dragging.

    1drv.ms/u/s!AojCIgmN1VlPgYVHm4cdRPpOH6ACKA

    Here is a capx more similar to what I intend to do. Actually, the real one has a tilemap with every position value being translated to tiles, lots of functions passing objects as parameters and a simple boolean-toggling turn system to make each player is allowed to aim with only one troop at a given turn. At the end of the round -when each player has aimed or skipped every troop- they move, shoot and fight all at once.

  • Bug reported

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You are right. On previous releases it keeps working on mobile. The point is I cannot load now my entire project for I saved it and now it says it is a future C3 release project and cannot be opened with previous versions any more!!!!!

    I hope this is being repaired soon, since it could mean losing months of work...

    Did you already post the bug? I'll do this very day if not. Tried even with an empty project to avoid been told it is because some addons or some setup or things alike. So now I can tell it is totally a bug.

  • I've been struggling with the same issue. Tried on Huawei Nova, Samsung Galaxy S6, Samsung Galaxy S9, Samsung Tab A, Sony Xperia ZX and neither reacted to touch. Indeed, it's quite strange, because nothing ibside the layout can be tapped, but outside it lets you double tap for adding an object. Though one cannot select the object once the instance is onto the layout. It is not possible even to scroll the screen.

    Jean-PaulL

    Did you manage to post the bug report? Did you get some feedback?

  • Sorry if this has been dealed with before, but couldn't find.

    My game is a battle board game. Each player may choose among different troops to make its army. Each troop has its own stats.

    So after much reading around here, mainstream opinion is that DB should be online to prevent cheaters modifying their local files. So I now have a JSON hosted online.

    I am learning how to work with JSON object, load it into an array, pull only paths, send back, etc. But now I am stuck.

    I can't learn which steps I am doing wrong for I cannot see whether the data is being correctly parsed or updated.

    I have read that is not possible to sync data to an online DB while on prev. So, can't I monitor data being saved/loaded correctly until game is compiled?

    Debugging is not helping me either.

  • Is it possible that you include your C3 ported Rex MoveTo addon among the game collection?

    I am interested whether you plan to update it to be compatible with the new R125 feature- the one that enables instances to be created at runtime even if there is none added to any layout.

  • Sumyjkl

    Thanks for the response. So, for every array or dictionary that I create in the editor as a project file, there must be an array object related to it.

    I wasn't getting the point of having array/dictionary instances. Forgive if it is a nonsense question. They are supposed to be data storage objects, which don't are visually settled onto the layout. And the way their values are 'called' is by actions or expressions, so I thought instances didn't matter here.

    But if I understand you correctly, I can attach an array/dictionary to a sprite (player, enemy, ...) through a container, so having just one array/dictionary object, esch instance has its unique values stored separatedly in its own array/dictionary, just like instance variables. That sounds way better.

    I was approaching this by making an array where every character (player/enemy) was included. X being each different character and Y storing the diffetent 'stat' values.

    Now I am not pretty sure about my method.

  • I have a basic question that couldn't locate on the forum. Maybe the most obvious of the answers, so apologies in advance. I guess- Arrays, xml, json and dictionaries are allowed to be added more than once to the project. A text box says they are available for the entire project, but other plugins like input controls, web, etc.. don't show up again after been added. And also those files can be created in the editor without having previously added the object to the project. So I am a bit confused.

    Does it mean that for each one of those project files that I have to be requested, I must add one object of the kind? I mean, if I have 3 dictionaries, would be 3 dictionary objects with 3 project files or just 1 dictionary object for the three files would serve?

    So, e.g.- a string key is unique for each dictionary JSON project file or for each dictionary object?

    Given JSON, arrays, dictionaries and XML have different ways of calling their values through actions or expressions and some return values as strings and others as numbers, I am mixing things up at figuring out the best way to manage dB for users, players/enemies stats, leaderboards, ... and need some enlightening.

    But I will not expand any more, just that simple doubt- one object per file or just one object and all the files?

  • You do not have permission to view this post

  • dop2000

    That's great!!! So, as you say, it's a rather simple, elegant and clean method. Even helps organizing sprites and clearing the layout up.

    You are my savior, man! To be honest, several of the ways I am managing my project come from your tips on different posts around the forum. I'll stop bothering you straight forward and reading more your words to others.