mongoose665's Forum Posts

  • You didn't mention anything about setting a position, you said you had an issue where set scale wasnt working. You can have an event on family created > set scale to x. For the position, you could use a function and pass a parameter through it for location. For your game it sounds like you need to use a container though, where you create an object made up of smaller objects that is premade.

    You know, I've just done a different method, where upon Creating an object, it creates another object. But, again, that secondary object's animation cannot be changed unless there's a wait before! I have no idea why this is happening on such a large scale on my project now, I literally have no idea what to do because if I create anything it needs a Wait before anything is repositioned, changed size, changed animation etc...

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • [quote:eygdpm07]There must be some easy way to change a family's properties after creation without some kind of break for the code to register it?

    It's on family created. What do you mean by 'every scenario'? This one event covers every creation scenario.

    So if I use On Family Created> set position to X, then every time I create the family, it will be at that position. But I want to be able to change the position, it won't always be X, it will vary every time I create the family, I want that control. I'm finding it very hard to explain.

    Let me put it another way, I've got a set of sprites that are all individual parts, but are parts of the same object, how would you go about spawning that object, along with all the parts in the right positions, and then scaling and positioning that object in its entirety once it's created? As you can see on that image, I made a function that creates all the individual parts and scales them. But if I call that function and then try and re-position it without a Wait in between the calling and re-positioning, it just stays in the original position.

    So if I did On Family Created > set at this position, every time I create it it's going to be there, when in reality I want to be able to change the position afterwards to whatever I want, not just the same one every time it's created. Hopefully this somewhat makes sense.

  • Why do you need a pause? Why isn't the scale working? Try on family created > set scale.

    I'm not sure, it won't let me reposition the family or rescale it unless I leave a gap of some kind, it just defaults to the normal one. And I want to be able to change the scale on the fly in the same event sheet, so making a "on family created" for every scenario would be hell.

    There must be some easy way to change a family's properties after creation without some kind of break for the code to register it?

  • Hi everybody, my problem lies in the fact that I've made a Family, which is basically making a sprite visible, but if I create the family and then set the family scale to say 2, the scaling doesn't work, the only way I can get it to work is to make a wait time of 0.001 seconds between creating the family and scaling the family for the scaling to take effect. Unfortunately this leaves a single frame where the family is scaled wrong and it's glaringly obvious.

    https://imgur.com/PX1LbVY

    Any workaround to this? I've tried putting the scale family as a sub-event to make a break without using the Wait, but it doesn't work, I can only get the scaling to work when I use a Wait event in between.

  • There are lots of ways to optimize your code.

    You can add TextChoice1 and TextChoice2 to a family and bam - you already can combine those 2 conditions into one.

    > Mouse On clicked on TextChoicesFamily
    Rubix is visible
    Text is not visible
    TextChoicesFamily is clickable
       TextChoicesFamily text is "Sure..."
       or 
       TextChoicesFamily text is "Uhm..."
    [/code:2ho3ykzk]
    
    I'm sure you it's possible to compress all this even further with functions, but I need more examples of your code.
    Could you share the capx?
    
    Also, you might want to check the FAQ on this forum - there are a few good examples of how to build a dialogue system in games.
    

    Hi there, thanks for responding. My problem is basically I don't want to be making hundreds of families for each dialogue branch. And I have actually looked at (and bought a plugin) for dialogue choices but, my coding knowledge is super limited, and this works best for me right now unfortunately Can't seem to find any simple enough for me.

  • Hi everyone, so basically I'm trying to find an easier way to do this than just making a unique function to call every single time.

    I basically have 2 groups of conditions I want to do the same set of actions, so as an example: (click object 1 + sprite visible) and (click object 2 + sprite visible) both lead to (object 3 visible). The only way I can think is to make it so when Function "X" is called, object 3 becomes visible, and then put call Function X as the only action for both sets of conditions. But I am doing this on a huge scale, so as opposed to making an entirely new function every time, is there an easier way to do this?

    I mean, right now, I'm just copying and pasting the same thing twice for both, because it feels less messy than having a thousand functions, somehow:

    https://imgur.com/9wwpEOM

    Many thanks in return!

    Josh

  • mongoose665

    Function can return a value:

    Thank you! I'll look into implementing this. Appreciate it.

  • The conditions will go inside the function. If you share a capx or tell me exactly what you need to be done, I can help you better.

    https://drive.google.com/open?id=0Bxak1NjIAUQEVjRyRFVEcHh3RE0

    Okay so here's an example I made, I want to basically amalgamate the conditions "Sprite 2 is visible" AND "Sprite 3 is visible" into one function, so I wouldn't have to copy and paste both of those, just one thing, into every event I wanted doing the same thing,

  • Yes. Just add the Function object to your capx file. You do that the same way you add a Sprite or any other object, just go and select the Function one...

    I understand how to use a Function to call event actions, but not conditions. I can do call function > make sprite visible. But I have no idea how to make a function that says "Is sprite visible", like a condition, not an action.

  • Might be a dumb question, but basically I've got a list of conditions that I want to group together so I can refer back to them for multiple events, as opposed to copying and pasting all the individual same conditions into all the events that will use them.

    So for example, I want (Image 1 visible + Image 2 visible) on two separate events, can I compress them into a function somehow so it's just (images visible) and I can refer back to that each time?

    Thanks everyone,

    Josh

  • There is no way to use a bullet for this purpose. Switch to rays instead. I used jcw_trace (raycast) plugin and it works just fine.

    You can find some ideas in this topic:

    Thank you, I'll take a look!

  • This is a repost because I did have a reply to the original post, but I have absolutely no idea how to implement the technique told to me.

    I'm looking to make my player jump forward using the Bullet Behavior (he goes at 1000 speed for 0.6 seconds), but basically I want him to be able to pass through certain thin walls, and not be able to pass through other thin walls.

    Obviously checking bounce on solids means he cannot get through either of the walls, but even making it so that the bullet stops, or the player stops, when colliding with one wall, he keeps going.

    I read this is because the game checks once per tick, and if a bullet is too fast it can pass through thin objects. Is there a way I can do this without making one of my walls super thick?

    This is the original solution provided but looking for something a little simpler... http://imgur.com/a/BQRXJ

  • Use C3, with its improved steps.

    Or, code you own steps in C2 :

    https://www.dropbox.com/s/odkpatpbpu3mi ... .capx?dl=0

    That bullet is going so fast that you barely see it.

    I've been looking over that project, I'm pretty new and wow that looks complicated to me, I'm trying to replicate it but I don't really understand what it's doing.

  • Hi there, I'm looking to make my player jump forward using the Bullet Behavior (he goes at 1000 speed for 0.6 seconds), but basically I want him to be able to pass through certain thin walls, and not be able to pass through other thin walls.

    Obviously checking bounce on solids means he cannot get through either of the walls, but even making it so that the bullet stops, or the player stops, when colliding with one wall, he keeps going.

    I read this is because the game checks once per tick, and if a bullet is too fast it can pass through thin objects. Is there a way I can do this without making one of my walls super thick?

    Thanks!

  • You can't check acceleration with mouse but you can with touch and that should give you the same number.

    Add touch to your layout.

    You need a global variable to use for the touch speed on the Y axis.

    I used DoubleTap for my variable.

    You can check speed with and without gravity or you can check angle of motion of touch.

    I haven't trued it but should work.

    That would work, but then I'd have to find a way to make a simulation of the touch and pin it to the movement of the mouse?