linkman2004's Recent Forum Activity

  • This really wouldn't be possible without 3D geometry and there's no effective - or efficient - way to simulate it.

  • There's an "Edit grid" button next to the toggle grid button. This brings up a little window where you can change the distance between grid points.

  • I think it would be sweet to have the ability to change the physics collision mask at runtime. For example, there could be an action to add a point. Using that, you could add all of the points for the shape, then there could be another action to convert the just added points into the custom shape.

    Or perhaps it could be done differently, but this could be really useful, especially when it comes to externally loaded images for the purpose of customization/expandability.

  • Any more information on how the Serialize() function works? For example, how do I set it up in the struct. Something like this?

    struct c_T
    {
        float a;
        float b;
        float c;
    
        void Serialize(bin& ar);
    };
    [/code:yuo7j083]
    Or is it different?
    
    Also, how do I use the function in the actual serialization file?  It takes an argument, but I don't know what said argument should be.
  • Well, I attempted something like that, but I really don't know how it would work. What's really complicating this is the fact that it's a vector that contains different instances of a struct I created. It's something like this:

    struct c_T
    {
        crapload of variables...
    };
    
    vector<c_T> cV;
    [/code:q8e6qass]
    Whenever I need another instance of this struct, I increase the size of the vector, so I'm not really adding an object to it.  Is there some way to serialize everything inside the struct and then put it all back in again?
  • I have a vector and I don't know how to set it up for runtime serialization. I need this so that quicksave and quickload can be used without emptying the vector in the process. Any way to do this?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • No. It would be quite a large undertaking, so I don't think it's likely to happen.

  • This places the sprite in the same starting position. How do you figure the angle to start for its current position?

    How do you mean? The angle to start is specified when you first grapple on. Those first two values are simply added to the 'angle' and 'speed' values every tick. The first expression increases the speed proportionately to the steepness of the 'angle' value, while the second expression increases the 'angle' value by the 'speed' value.

  • I don't think qarp is necessary, but it does use a small bit of math. For a basic grapple hook all you really need are three variables; 'distance', 'angle', and 'speed'. When your grapple first latches on you set the 'angle' value to the angle between the grapple point and the character and set 'distance' to the distance between these two points.

    Every tick that the character is latched, add something like this to 'speed':

    180 * cos(GUY('angle')) * TimeDelta[/code:2twkufci]
    Then, add this to your angle value: 
    
    [code:2twkufci]GUY('speed') * TimeDelta[/code:2twkufci]
    After that, it's a simple matter of setting the position of the grappling object to:
    
    [code:2twkufci]X: GrapplePoint.X + cos(GUY('angle')) * GUY('distance')
    Y: GrapplePoint.Y + sin(GUY('angle')) * GUY('distance')[/code:2twkufci]
    
    If your character first grappled onto something at a 45 degree angle from the grapple point, he would swing endlessly between 45 and 135 degrees; at 10 degrees, between 10 and 170 degrees; etc...
    
    [url=http://dl.getdropbox.com/u/917406/grappleHOOK.cap]Simple pendulum example[/url]
    
    I hope this helps with the basic concept to some degree.
  • It depends on how complex you want it. For example, if you want your current speed to be transferred to your swing speed upon grappling, it takes a bit of complex math. However, a simple going back and forth is rather simple. I'm currently working on an example of the former.

    EDIT: Also, just thought I'd mention; I don't think I have my original example anymore, but it was kind of crappy anyways, so it needed to be redone.

  • It may look like it's returning values all over the place, but when used to move stuff it works just as well as using the FPS average.

    Example CAP

    NOTE: If your refresh rate isn't 60, just change the value in the second action to whatever your refresh rate is. I didn't feel like making an FPS counter thingy.

    EDIT: Of course, if you plan on doing something other than consistent movement with this, feel free to ignore me.

  • If you think that TimeDelta is inaccurate, you should post a CAP file demonstrating this.

    The difference in accuracy between multiplying by TimeDelta and multiplying by (1 / FPS) is incredibly small.

linkman2004's avatar

linkman2004

Member since 15 Jan, 2008

Twitter
linkman2004 has 1 followers

Trophy Case

  • 16-Year Club
  • Coach One of your tutorials has over 1,000 readers
  • Email Verified

Progress

18/44
How to earn trophies