tommyoliversays's Forum Posts

  • C3 should already be preventing this. It might be selecting on the parent page though (the Newgrounds page), in which case Newgrounds would need to prevent it.

    Weird. It also happens on GameJolt and itch, so whatever needs to be done isn't limited to just Newgrounds.

    Kinda strange :S

  • I made an endless runner style game, but on iPad tapping and holding to jump selects the entire game window, breaking the game.

    Is there some way to prevent this from happening, either within C3 itself, or with some HTML in the index file?

  • So a few days ago I published a simple 5-day game, Ninja Suffering, to the web. It should theoretically play on any platform, being keyboard and touch friendly. It works fine on Android and desktop, but on mobile Safari, it has some issues that I wasn't able to catch initially since I'm not a big iOS user.

    Apparently on iPad long presses tend to select the entire game window, which eventually causes taps to no longer work at all. On iPad, there is no sound at all, which I thought might be due to C3 compressing sound files to WebM, but on iPhones sound effects work, just not music.

    Also on iPhones, certain spritefonts don't disappear when they should (If you play the game, the "Speed Up" text in the bottom right doesn't disappear like it does on other platforms.)

    Are these things that I can address, or are they results of limitations of mobile Safari. I know Apple has their own way of doing things, so perhaps there's nothing I can really do on my end. But I figured I'd float the idea just in case.

    Tagged:

  • I was considering using the sine behavior, but I had the idea of syncing platform movements up with the game's music, so tweens give more control over the movement.

    Horziontal movement is fine, but vertical movment causes my character to enter the air state, and screws up the animations and stuff. Oddly, the same platform with sine movement works fine, so I'd assume that rules out my state machine as the culprit, unless there's something under the hood that treats the movement differently?

    I was just wondering if this was a common issue, and if there was a general way to resolve this. Moving platforms are a pretty common feature in 2D sidescrollers, after all.

  • Honestly, I'm not really sure what my issue is here. I've been trying to compartmentalize my game's damage and hit calculation in functions, since I initially built them before the new functions debuted, but I'm having lots of issues.

    Right now, if you kill a second enemy before another one dies, it breaks the entire hit collision of the game. Killing single enemies works, killing multiple enemies at the same time works, its just killing one then immediately another that not only messes up that enemy, but breaks hit detection for every other enemy in the game as well.

    Here's a link to the file. I'm new to using C3's new functions and calling via UIDs, so I'm sure I'm missing something obvious. But I've rebuilt the system four times now with no luck.

    dropbox.com/s/czh4fypus82fz0n/azumi_fullgame4.c3p

    Thanks

    Tagged:

  • You do not have permission to view this post

  • The UID option worked perfectly! Thank you!!!

    Awesome! Glad it worked!

  • Thanks for the in depth reply!

    The reason I only have the functions set up for Enemies is because the player reacts differently to hits. The player takes knockback and has a window of invulnerability, and on death, it triggers a custom series of animations to be more dramatic, for lack of a better word.

    I suppose all that functionality could be broken off into their own functions and called on top of the base damage stuff, but that seems more complicated than what's there now, but maybe I'm overthinking it. I'd be interested to hear your take on the matter!

    The issue I was having with the implementation right now is that, certain enemies would get stuck in either the death function or hit function, and never play the respective animation. They'd lock up and break the entire game, since the function never exits.

    Did you run into that at all? 🤔

  • Please share a sample c3p that we can work with together.

    I've rebuilt it a few times, but this is the latest attempt before letting it go and moving on to other things, if you can figure out what's wrong I'd be very appreciative.

    dropbox.com/s/qwjyve6prhkgsr2/azumi_fullgame3.c3p

  • I'd use the object's UID. Each instance of the door has it's own unique ID number. You can call that specific instance using the UID, then apply the door open logic to that instance.

  • While functions only support 3 primitive values (boolean, number and string) you can use a number parameter to pass the unique ID for an object instance.

    The event sheets use a selection/filtering technique for referring to an object. By default referring to "PlayerSprite" will affects all instances of "PlayerSprite", but some conditions can filter the selection down to some or one "PlayerSprite" instance. Conditions like collision triggers will only select the instance that collided for example. There's also some conditions that allow you to explicitly filter which ones you want, such as "compare instance variable" which allows you to choose instances with a certain value in an instance variable. One of the most useful it "Pick by UID" which allows you to filter to a single instance of an object, that matches a unique ID value. You can use this in combination with a function by adding a parameter for the UID ( which is a number ) then adding the "pick by UID" condition to the function itself. Like so:

    Yeah, I dunno what I'm doing wrong, but for the last 24 hours I've tried non-stop to implement UIDs like you've shown here in multiple different functions and setups, an each time it has completely broken my game. From breaking projectiles, to having attacks randomly start hitting every enemy on screen after working normally for awhile, to freezing the game entirely. This seems incredibly delicate for some reason. No clue what I'm doing wrong.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Piece of advice: Pass the object in concern's UID through the function as a parameter.

    This will allow you to always pick the correct object, no matter the family, conditions, etc.

    Example:

    Family "hittables"

    Members:

    Player Sprite

    Enemy Sprite

    Event:

    On bullet collides with "hittables" -->

    Call function "bullet hits something"

    Pass parameters: bullet.damage, hittables.uid

    On function "bullet hits something" -->

    Condition:

    Pick "hittables" by UID function parameter (1) (or function "bullet hits something" parameter hittables.uid") -->

    Substract parameter bullet.damage from hittables.health

    Destroy bullet

    I know this is an old post, but I got wrapped up in other things in the game and am just getting back to tackling this issue.

    I'll be honest, I have absolutely no clue how to call and object by UID like you're suggesting here. I understand what you're saying in terms of actual logic, but in terms of getting it to work in C3 I don't know what events would be used. Been banging my head against it for an hour now looking through the documentation with no luck.

    Could you post a quick screenshot using the events you're referring to just to give me a jumping off point?

  • It makes sense for something like a mouse click, but what about when a tween finishes? I have a series of graphics tweening in sequence that make up a stage intro. Ideally I'd like all of that to be a function, but because of all the triggered tweens I can't do that. I've worked around it but putting them all into a group and toggling it on and off as needed, but you have no way of passing parameters that way, so for my system I'm trying to build for calling dialog boxes, which I wanted to pass parameters to determine which text to pull from an array or dictionary, I'm kinda out of luck unless I make every triggered event it's own function, then have a master function that starts the chain of calling each one in sequence to make the entire thing work.

    I am probably just too new at traditional programming to understand the stupidity of what I'm asking, but just as a lay person, it is kinda frustrating to try and find ways to work around things like this, even if it makes sense that it wouldn't work considering the linear nature C3 reads event sheets.

    Is it possible to create a function with parameters, then have that function run a JS script that can reference those parameters? That was a method I was interested in trying next, mixing events with traditional scripting.

    Either way, thanks for the response and the patience with my limited understanding of how C3 works under the hood ^_^;;

  • The gif was just an example. My main issue is that I have systems that I'll be reusing constantly like the dialog boxes and a stage introduction that contain multiple Trigger conditions. These are the kinds of things most primed to be used as functions, but it seems to not be possible in C3 due to Trigger events conflicting with Functions.

  • So I'm trying to set up a text box / dialog system for my game. My initial idea was to use a function to pass the dictionary to load and the text to pull from it.

    However, Construct's functions seem unable to do this, as they prevent you from using even a single Trigger event in a function.

    This seems to kneecap the entire point of functions, being able to reuse your code. If the vast majority of useful logic that's the building blocks of making complex systems that you'd actually want to reuse at multiple points can't even be handled with C3's Functions, what's even the point?

    Am I missing something obvious here? Cuz it seems like I have to be. There's no way they can actually be this limited, right?