linkman2004's Recent Forum Activity

  • I don't seem to have the problem. It could be your video drivers. Do you have the latest drivers for your graphics card installed?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • When I put that in, it claims that the vector isn't a member of CRunObject. If I change the code to this:

    vector<CRunObject*> ExtObject::sameBehavior;[/code:3rm47ee5]
    
    It doesn't complain, but I don't think it would work.  I did a simple test with a static integer, being sure to declare it in runtime.cpp using:
    
    [code:3rm47ee5]int ExtObject::integer;[/code:3rm47ee5]
    
    Then in OnCreate() I have the value increased by one.  I then set up an expression to return the value, but the value is always returned as 0.  Am I still doing something wrong here?
  • Okay, I put this in CRunObject:

    static vector<CRunObject*> sameBehavior;[/code:tbmhib2w]
    
    And this in OnCreate()
    
    [code:tbmhib2w]sameBehavior.push_back(this);[/code:tbmhib2w]
    
    But when trying to compile, I get this:
    [code:tbmhib2w]Runtime.obj : error LNK2001: unresolved external symbol "public: static class std::vector<class CRunObject *,class std::allocator<class CRunObject *> > ExtObject::sameBehavior" (?sameBehavior@ExtObject@@2V?$vector@PAVCRunObject@@V?$allocator@PAVCRunObject@@@std@@@std@@A)[/code:tbmhib2w]
    
    I think it has something to do with it being static, but I'm not sure.
  • So would I put something like this in CRunObject?

    static vector<Type> sameBehavior;[/code:jm9vetpa]
    
    And if so, what's the type supposed to be?
  • Is there a way to find and loop through objects that are using the same behavior? Basically, the behavior would be applied to different objects, and then each object with the behavior would be able to get the other objects' locations and stuff. Is this possible? A quick code snippet to illustrate would be handy.

  • Thanks for the comments, guys. By the way, I'm just wondering, would anybody rather see the speed in degrees-per-second?

    Oh comon this is negligible.

    For normal applications, yes, but it actually takes 50% more objects with the behavior to slow the game down to VSync rate. That's 4000 objects with events and 6000 objects with the behavior.

    Hm, how can I set the "Orbit to Object" object to another instance of the same sprite?

    I want:

    sprite with uid = 0

    to orbit around

    sprite with uid = 1

    You're on the right track, but it would best to use a private variable so each object can hold a sequential ID. Here's an example.

  • Orbiter Behavior

    :

    Version: 1.0

    Creator: Chris Hackmann(AKA, linkman2004)

    License: Freeware

    Download now!

    - 98KB

    NOTE: I suggest reading the below description/documentation before use. There are is also an example at the bottom.

    What does this plugin do? - This is a behavior which can be added to object to make them orbit another object. This usually takes a small bit of complex math, but the Orbiter behavior takes all the math out and provides speed improvements over doing it with events.

    What features does it have? - You can change many orbit options, including speed, maximum X distance, maximum Y distance, the angle of the orbit, and the step of the orbit. You can also retrieve all of these values at runtime, including the current distance between the orbiter and the orbited. See below for a complete list of parameters, actions, and expressions.

    Parameters:

    - Speed: Set the starting speed of the orbit in pixels-per-second.

    - X-Distance: Set the starting, maximum X distance of the orbit.

    - Y-Distance: Set the starting, maximum Y distance of the orbit.

    - Angle: Set the starting angle of the orbit.

    - Start step: Set the starting step in the orbit from 0-360. If the starting step is set to 90, the object will start out one quarter of the way through it's initial orbit.

    Actions:

    - Set Object to Orbit: Set the object that the orbiter will orbit. This only has to be set once.

    - Set Orbit Distance: Set the maximum X and Y orbit distances at the same time using ONE value, setting both settings to the same amount.

    Expressions:

    - Get Orbit Distance: Get the current distance from the orbiter to the orbited. If the maximum X and Y orbit distances are the same, this value will be constant.

    Shared Actions/Expressions:

    - Set/Get Orbit Speed: Set/get the current speed of the orbit.

    - Set/Get Max X-Distance: Set/get the maximum X distance of the orbit.

    - Set/Get Max y-Distance: Set/get the maximum Y distance of the orbit.

    - Set/Get Orbit Angle: Set/get the angle of the orbit.

    - Set/Get Orbit Step: Set/get the current step of the orbit.

    Installation: To install the plugin, simply extract the the contents of the ZIP file into the main Construct folder.

    Example(s):

    Orbiter Behavior - Example File

    So there you have it. I've actually been sitting on this plugin for a few days waiting for the finished plugins board to go up.

  • Thanks, man.

    I know this is offtopic, but could you fix this problem with your HUE plugin before releasing it?

    Basically if you try to use it in a family, and you select the "set hue" action, you can't set the hue.

    I'm willing to bet that's a problem in Construct. I'd check using another effect to make sure, then submit a bug report if it has the same problem.

  • Man, I almost forgot I made this. The performance hit really depends on how many objects you're using this method on and what the accuracy level is. An accuracy level of 256 has a minimum effect on performance even across 100 objects.

  • I've tried re-wording the error message about 3 times now and people still seem to get insanely confused about going to the Microsoft website and updating DirectX. If you've got any suggestions on how to better word this so people don't explode when they see it, I'm all ears

    Would it be possible to include the DirectX web setup file with compiled EXEs? I think that would solve most problems that people seem to have with this.

  • IK Solver 2

    :

    Version: 2.0.1

    Creator: Chris Hackmann(AKA, linkman2004)

    License: Freeware

    IK Solver 2

    Download Now(with example) - 113KB

    NOTE: I suggest reading the below description/documentation before use. There is also an example at the bottom.

    What's IK? - IK is a method for making a chain of bones bend in the correct way to reach a specific point.

    What does this plugin do? - This is a plugin that takes all of the fancy math out of solving 2-bone IK chains. It automatically rotates the bones to the correct angle to reach a specified control point. It also positions the second bone automatically to the end of the first.

    How does it work? - Very simply. The plugin consists of only one action: Solve IK. This action takes a few parameters:

    - Bone 1: This is the first bone in the chain.

    - Bone 2: This is the second bone in the chain. It will be positioned to the end of the first bone.

    - Relative distance: This is the relative distance from the end of the first bone where the second bone will be positioned. For example, a value of -5 would place it 5 pixels from the end of the first bone, while 5 will place it 5 pixels past the end of the first bone.

    - Control Point: This object represents the point that the IK-chain is attempting to reach.

    - Direction: This is the direction of the bend of the bones. With outward, the bend will point towards the right when the control point is below the first bone, while outward will point towards the left in the same circumstance(see the example for a better explanation).

    This action must be called every frame. The objects picked are the same as object picking everywhere else.

    Example(s)

    IK Solver 2 - Example File

    And that's about it. Be sure to leave your comments/questions. I'm calling this done for now, but if there's anything you want to see, let me know!

    NOTE: I HIGHLY recommend upgrading to this version if you are already using the original. It fixes two major flaws with the original. The actions will have to be swapped out by hand due to incompatibility between the two versions.

  • You could always create an event sheet with all your game code and include that in each layout. Event sheets that aren't tethered to a layout can access all objects.

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