linkman2004's Recent Forum Activity

  • I've fiddled around with it the way you show, changing the asterisks and stuff, but I can't get it to work. That, and i don't know what's up with *MyInt. Do you have a working example of the code I could look at? I have trouble grasping this stuff alot of the time.

  • I'm still not entirely sure I get this. This is what I have in GetData():

    long ExtObject::GetData(int id, void* param)
    {
    	switch (id)
    	{
    		case 1:
    			return MASS;
    	}
    	return 0;
    }[/code:vw3xcad2]
    This is where I try and retrieve something:
    
    [code:vw3xcad2]stuff += (*i)->GetData(1, (float)param);[/code:vw3xcad2]
    Thing is, it throws a fit about how "param" is undeclared, and how it can't convert from "void *" to "float" and stuff.  I'm not exactly sure what you were getting out, so I'm getting kind of confused here.
    
    The plugin I'm working on is a gravitation behavior.  You put it on objects and you can set weather objects are attractors and/or satellites.  Kind of like a much more advanced version of my orbiter behavior.
  • Bleh, I'll try.

    By the way, I have another question and I'm sicking of making new threads, so I'm going to ask it here. How does the GetData() function work? I know lucid asked about it, then he figured it out, and then he didn't tell anybody what he did. I know you have to specify the values to return inside the function and assign what seems to amount to an access number to it.

    Thing is, I don't know what the second parameter when calling it is supposed to be. So, how would I use this to access a value from one of the objects that my vector(from the other threads) is pointing to?

  • There are no limits on anything like this as far as I'm aware. The real question is why you'd want that many.

  • I don't see the physics object on the CVS.

  • I lied, here's another question. How would I go about making a universal setting for a behavior, for example, something like the physics behavior where the gravity parameter is universal across all objects with physics?

  • Just thought I'd mention this for anybody else doing something similar to this. If you're making a behavior and want to share the properties of the objects they're linked to, you should use this:

    sameBehavior.push_back(pLink);[/code:ncps86ui]
    Not this:
    
    [code:ncps86ui]sameBehavior.push_back(this);[/code:ncps86ui]
  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Don't be afraid to ask questions - this is what the forum is for. Each question you ask gets answered and stays here, readable by everyone who decides to dabble with SDK. So, yeah, you're in fact helping form a FAQ

    Blah, you're probably right.

    An iterator is defined as what it is you are iterating.

    vector<CRunObject*>::iterator i = sameBehavior.begin();

    Then continue as you were with the loop. Because you're iterating pointers, you access the data of the CRunObject like so: (*i)->.

    Sweet! It works! I was doing something very similar to this before, but this actually worked.

  • Lookin' really good, lucid. Can't wait to see a beta of this.

  • I swear, this is my last question for a while. Okay, now that I know how to set up a static vector for storing pointers to other objects with the behavior, I need to know how to iterate through the pointers in the vector and retrieve data. I know it involves something similar to this:

    for (i = sameBehavior.begin(); i != sameBehavior.end(); i++)
    {
    
    }[/code:h8yfsghd]
    But I don't know how to properly setup the iterator or retrieve data from the current instance.
    
    Sorry if this is more general C++ than SDK specific, but I can't seem to find what I need anywhere else.  Any help would be greatly appreciated.
  • Okay, thanks for all the help.

  • I made this for somebody else a little while back, maybe you can find it of use as well.

    Lines Without Breaks

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