paxclara's Forum Posts

  • i was going for platforms you could jump up through and not fall down through, at least without a separate action or something to pass downward through them. i would be interested in having one-way solids that work in other directions--like solids you could pass downward through but not go back up through, and one way doors like in mario maker.

    i did try putting jumpthru and solid together on an object and switching between them, but i want the slopes to still be walkable for NPCs/enemies even if the player isn't on them--but actually, i do think this would work for bullets, which could have an exclusion list with every platform in the layout on it, so that they'd only interact with the jump-thru behavior and ignore the solid behavior of the objects. it would probably work for most of what i need from 8-direction behavior as well, since they're mostly just bouncing off of solids--i think the oddity of objects with platform behavior sliding through sloped jump-thrus is mostly from how gravity works with left/right movement. i think i have an idea of how to work this out so let me test it and see how the bullets end up working...

    edit: ah, so, the "bounce off solids" attribute of the bullet behavior, which i maybe should have predicted, only bounces off of... solids! it already does not bounce off of jump-thrus. i had apparently already ran into this because i had bullets checking if their angle was between 0 and 180 (ie downwards) and if so bouncing, which doesn't like *technically* work for sloped jump-thrus (an object traveling at an angle of -5 could collide with the top of a jump-thru at a slope of <-5--additionally many of my bullets are affected by gravity so they could arc inside of a jump-thru which might result in weird behaviors...) so i have to figure that one out still. anyway, i did give bullets an exclusion list by doing this, which they seem to obey:

    (note that my game has a "layoutMaster" object that's present on all layouts already, to hold information like whether the layout is "inside" or what angle it is at relative to compass directions, so it was easy to add the variable here--i imagine you could use a global string variable just as easily!)

  • weird thing to say tbh, it's my game so why shouldn't i try to make things work the way i want? and it's just an example of the step thing i was talking about, where a more complex shape is too time consuming. like this one i didn't finish:

    and then there's this part:

    ideally i want to be able to have "jump-thru" peaks of pointed houses or steeples of buildings. also hoping to have one-way horizontal platforms that block movement from one direction but allow it from the other, which seems to be an overlapping (lol) issue. maybe i can figure it out, but for now i'm just wondering if anyone else has any insights or experience on this

    i want to have long slopes that the player can walk up. like this:

    super mario world did sloped "jump-thrus" in 1991 so i don't see why it would be impossible or i should limit myself if i can get around it. actually kind of surprised i wasn't able to find anyone dealing with this

    anyway, more constructively, here's my best solution so far:

    it handles long angles pretty well like this, and since player collision and all the other stuff that uses platformer behavior already has an "on fall" section for animation i could add this to them pretty readily. for the points i think i'll have to use sprite objects with platforms trailing to the side to get the effect i want (i use platform objects (they're 9-patches) instead of tiles with collision so that it can play sound effects, make particles, and change the player's movement physics based on the surface material, but i imagine it would work if you used tiles.)

    the last problem is i'm not totally sure yet how to handle 8 direction or bullets, which i have a lot of both, and definitely want my thrown objects to bounce off of them at the correct angles. i guess i will update when i figure it out but i still wonder if anyone has dealt with this problem before

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • i see in the manual that jump-thru does not support slopes, which does seem to be the case from my testing. what i'm wondering is if anyone has found a good work-around for this--searching the forum doesn't make it sound like something people have attempted much, but it doesn't hurt to ask, and maybe someone else could see my thought process later when they were also trying to do this.

    so far my best work-around seems to be to make a collision box that looks like this:

    since it has no slopes, and the collision seems to usually handle 1-pixel "steps", but i have fallen through it a few times. the main downside is that it's time-consuming to set this up, especially for steeper slopes or more complex objects. the other downside is that once you get more than 16 points, construct keeps telling me using too many collision points could lead to performance issues, which i definitely buy, but haven't personally tested. i also tried stacking jump-thru platforms which worked similarly but is also time consuming

    i also tried using a solid behavior and then doing this:

    but obviously this doesn't work, because once you collide with the thing it changes you to be falling, so it's impossible to evaluate what you were doing just before the collision, without saving your vectors every frame in an array to check against later--and then everything with platform behavior would be saving its vectors every frame, which i guess is possible. using "overlaps at offsets" actually let me pass through as desired, but also feels like it's going to cause performance issues at scale, and this exact method here creates a kind of jarring visual where it pushes you upwards through the platform

    these are just first attempts, and later i would expand them to families that include the various types of platforms i would need. ideally i want to be able to have "jump-thru" peaks of pointed houses or steeples of buildings. also hoping to have one-way horizontal platforms that block movement from one direction but allow it from the other, which seems to be an overlapping (lol) issue. maybe i can figure it out, but for now i'm just wondering if anyone else has any insights or experience on this

  • I have a flower graphic I want visible only when it's over another specific object. I thought I could use source atop blend mode but that makes it visible as long as it's above anything else--I thought it would be selective of only things on its same layer, which is what I desired, but I see why it's the way it is now. The graphic is a UI component and so is currently on my highest layer.

    Another acceptable solution would be to occlude part of the graphic, like so it only drew the portion of it below a certain Y level. but I'm not sure how to do that either. I am pretty much a total amateur when it comes to shaders so I'm still trying to figure this stuff out; there's similar effects I want to do that this second solution wouldn't really work for.

    The graphic is the flower in the bottom left of this screenshot, but I want to put it at the top so it's centered on the nameplate, but only visible when it's in front of the backing graphic (and doesn't cover the gameplay area.)

    Tagged:

  • It would, but the other families the sprites are in couldn't refer to them (and I agree shouldn't be able to, that would be weird.)--platforms is a family that responds to wetness by changing its surface type variables, plants would want wetness to know they've been watered. Each object type could individually respond to the variables, but I already have like *checks stats* 1700 events so I'm trying to keep my code from getting too complex... or uh, trying to keep my code relatively lean anyway. Like platforms would be alright, but I'm expecting to have 3 dozen kinds of plants, probably similar amounts of animals, fungi, enemies, etc.

    I think what would best serve my purposes is like hierarchies of families, and then I could put every sprite that's like "in the world" under one family that would hold wetness, and then plants and talkables would be a subfamily of that, and carryables a subfamily of talkables (and groundPlants and treePlants subfamilies of plants, which would help with another similar problem, etc). I imagine that would be a significant rework of construct's code base, though? And I mean, if I'm the only one who would ever use it, I'm happy to do my workaround--it's not that annoying (though it's a bit confusing in some instances--like in the aforementioned thing with the cats, sometimes the carryable needs to inherit the type from the talkable's name, and sometimes the talkable needs to inherit the name from the carryable's type. i've already resolved this one, it's just an example)--I was just wondering.

    No, you cannot make truly universal instance variables in object-oriented programming.

    ok i got kinda heated at this one i won't lie, but seeing it could be ai generated cooled me off.

  • Alright, I'll take that as a no and keep doing the workaround. Though to be clear I wasn't asking why families can't refer to other families variables--I didn't think they could (or should) do this. I was asking if I could put a variable on say every single sprite object type so they could universally be referred to (again, the same way that sprites all have sprite.X, and a family of sprites can refer to it as familyName.X in conditions/actions/expressions--an individual object can have its X set by referring to its object or any family it's a part of, and every family can freely use its X to make conditions) or if there was some other way to do it maybe. Thanks!

  • Thanks but I was not looking for help about the cats and NPCs. It needs to know the cat's and NPC's names for drawing the correct cat or NPC, and for talking to them. Cats are both carryable and talkable; they're in both families. Object type name does not work for my purpose at all.

    They all use wetness for different things; animation, particles, figuring out the platform's surface type (for playing sound effects and affecting movement physics), behaviors related to freezing/burning, etc. I can give every family wetness but it gets annoying if something is in two families because they need different names. I'm only asking if there's a way to add instance variables to for instance every sprite, which the engine will know every sprite can have (similar to how every sprite has a sprite.X, sprite.Y, etc.) and so can be referred to under any family. I already have a workaround, but I'm just checking if I can avoid working around it.

  • I keep running into problems where I need multiple families to know about the same information.

    For instance, I have sprite objects for NPCs and for Cats, which both need to know their own names and types for drawing animations, and their names for talking to them. This is held in my "talkables" family's instance variables. However, I also need to know the Cat's name when you pick it up and carry it around, which is information held in the "carryables" family's instance variables. Right now I'm just setting carryable.name to match talkable.name, which works fine (though it's a bit ugly in code.)

    I just ran into another problem where objects need to model wetness, but I'm looking at lots of families (platforms, groundPlants, animals, etc) that all need to store wetness. I'm just curious if there's some way to set universal object variables that families and object types would always be able to refer to in expressions?

  • I wouldn't recommend taking legal advice from a public web forum. There very well could be a problem with what you're describing. I assume what you're describing would be considered a derivative work, which provides very minimal protections if someone were to pursue a lawsuit for say AI art derived from their style. Enforcement situations are fluid and subject to more complex interpretations of the law, which include previous case work and court rulings. This will continue to be the case even if copyright law referring to AI art is updated in your country.

    I would not recommend using AI art primarily (edit: from a legal perspective, for the reasons mentioned above. i don't recommend using it personally, either, but that part is up to you). If you're using it just to generate ideas and then drawing your own fireball sprites, that wouldn't be considered a derivative work under US copyright law--only if you use portions of other published works (for example, sampling a song, or downloading a png of say a film poster or screen, or art from someone's social media, and using a portion or the entirety of that art in your game, even with modifications.) The actual enforcement of derivative works depends largely on the decision of the person or persons whose work you are sampling. Again, I am not a lawyer and you should not seek legal advice on public forums.

  • I went through several different phases working on my game, so here are a few ideas and what I ultimately did:

    first, you could use multiple particle objects line up across the top of the screen. you can mess with the X and Y offsets on the particle object itself to do the effect you're looking for, I think.

    for keeping them outside, I was having the particles destroy themselves on collision with solids. you can use collision filters if you want them to go through certain things. this requires you to actually generate objects rather than particles, and ultimately it created a ton of slowdown.

    what I ended up doing was rather than destroying the rain, just have the raindrop teleport itself back to the top of the screen and start falling again. this fixed the processing speed, which I think was mostly just from rapidly destroying and creating new raindrops. randomizing the height it teleported to gave it enough variation to not look super organized, which was really important. I actually ditched the particles entirely and just spawned objects in a loop based on how heavily it was raining (using wait commands to ease the rain in, and randomness to destroy the drops when the rain was supposed to stop). this also meant I can make platforms wet and water plants with rain or have it do other effects. my rain is sprites with bullet behavior.

    I tried a lot of effects, and I think ultimately changing the angle too much looks weird and unnatural--rain mostly falls in a grain in a localized area. think of looking into a streetlight in the rain at night--you can see that the rain is mostly similarly angled, so minor variation is okay but major variations is not so good.

  • augh!! nevermind, I got it. there was a platform that wasn't making its own plants so it just kept grabbing the most recently created plant and repeatedly setting its values. not sure why it was happening for multiple platforms, but I fixed it anyway.

  • hello,

    I have this block of code. it's a loop on start of layout for a platform to generate all of the plants on it. the plants then are added as children to the platform, and they have their height set by the platform. for some reason, the last plant a platform generates does not inherit the height (certain platforms always have the problem, but others do not), and has height 0. this happens even if I set the default height to be 1, so I'm assuming it's returning 0, but I have no idea why it would--you can see in the comment I was having a similar problem referring to another variable on the same object. is it somehow unpicking platforms? but why would it be set as a child correctly then...? and why would it work for n plants but fail on the last one?

    the platform's plantHeight is 3 even after it's finished loading. t1h3w2 is the default animation for this plant. it also happens with other object types which are groundPlants family as well. if I replace the variable with a number it works fine. I can just set everything at the end of the loop by picking all of the platforms's children, but I think this is the same problem that's making me have to use the 20 value instead of referring to a variable on the object which I would greatly prefer, so I thought I should ask anyway.

  • sorry, my initial post was kind of irrelevant because i didn't understand your system.

    so, the first thing i would recommend is to read up on containers in the manual.

    i would make one object type to represent all of the equipment, and then give that object type a variable that holds what it is and one that holds where it can be equipped, as well as a variable that holds how big its inventory is.

    then i would put that object into a container with an inventory array, and set the inventory array's size to the item's size in an event.

    this will simplify your code base dramatically because you won't need to use families--all of the equipped inventory can be picked at once with your "on the player" variable

    once that's done, it seems like you already have the basic setup done: gear has an associated array that can hold N items. now you have to draw the items, which you can do with a (fairly complex, tbh) nested set of for loops, one for each equipped item, and one for each entry in the equipped items array.

    item is "on the player"

    for each item

    -----create itemIcon at x = loopindex*25, y = 300

    -----itemIcon set animation item.Type

    -----inventoryArray for each X element

    ----------create itemIcon at x = item.X+10, y=310+(loopIndex*10)

    ----------itemIcon set animation inventoryArray.At(inventoryArray.curX)

    this would draw all the items vertically below the equipped item, if you set up the itemIcon to hold 1 animation for each item name.

    i hope that helps you move forward!

    edit: sorry i don't know how to render the tabs correctly

  • That does seem to be the case yeah. Never would've even known.

  • thank you so much!!! I spent like 45 minutes looking for it before posting, never thought about checking other plugins! now I feel silly

    just for the record if someone needs in 4-5 years or whatever, what I was looking for specifically is PlatformInfo.CanvasCSSWidth