lucid's Recent Forum Activity

  • no

    I bet I said something wrong

    gimme a few minutes

    I'm going to start from an empty sdk

    and tell you exactly

  • ok

    simple example

    long ExtObject::GetData(int id, void* param)
    {
    	//this would just return the second parameter as an integer....sorry no asterisk needed
    	return (int)param;
    }[/code:2x70bejr]
    
    sorry, you don't need any asterisks there, I just compiled an example to make sure this works
    
    [code:2x70bejr]int* MyIntPointer;  // a pointer to an integer
    
    YourObject->CallFunction(1,MyIntPointer);[/code:2x70bejr]
    
    not sure if it was my confusion that confused you, 
    or if you're not clear on pointers themselves
    
    but the way they work is like so:
    
    int* MyIntPointer; // a pointer to an integer, holds the memory address of an integer
    int MyInt; // I'm pretty sure you know what this is   
    
    MyIntPointer = &MyInt   // Now MyIntPointer points to the Address of MyInt(& is the address of operator) 
    
    [code:2x70bejr]MyInt = 3;[/code:2x70bejr]
    
    now
    
    *MyIntPointer  is equal to 3
    if I say
    [code:2x70bejr]*MyIntPointer = 5;[/code:2x70bejr]
    then 
    MyInt is now equal to 5
    
    the asterisk before a pointer is called the dereference operator, and makes it so you're basically operating directly on the thing pointed to
    
    MyIntPointer without the asterisk, is still equal to &MyInt
    
    hope this made some sense
    Edit:: if you read this before my last edit, read the first part again
    it's (int)param, not int(param)
  • <img src="http://upload.wikimedia.org/wikipedia/commons/a/a1/ZX_Rebelstar_2.png">

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • using the splitup technique you wouldn't need crouching animations for the torso or the head if they were set to 'always' 'set position to' imagepoints that were placed at the connecting points

  • I'm just comparing private variables so it's easy to see the flow and logic, replace those conditions with what you'd need to know to know if your character was doing each of those things:

    <img src="http://files.getdropbox.com/u/1013446/New%20Folder/CustomKeys/New%20folder/Runtime/Capture3.PNG">

  • yeah, that's gonna be a crazy amount of vram

  • other way around

    in GetData(): if you need param for something that's where you cast it

    long ExtObject::GetData(int id, void* param)
    {
    	switch (id)
    	{
    		case 1:
    			return MASS+(int*)param;// for instance, 
    	}
    	return 0;
    }[/code:2tctjxno]
    This is where you would retrieve something:
    
    [code:2tctjxno]stuff += (*i)->GetData(1, *MyInt);[/code:2tctjxno]
    
    I may have messed up the asterisks in the return MASS line in order for it to add correctly
    I'm pretty new to pointer notation, but the basic idea is
    that void* is a pointer to [i]something[/i]
    you have to cast it so it knows what it is
    this way, you can make param any type you want
  • you can pass anything for the void parameter, so

    you have to cast the void* parameter to whatever you need it to be

    like (int)param

    or (string)param

    GetData() and CallFunction() are exactly the same as far as I can tell. There are two of them for logic and readablility

    pretty straightforward so far,

    however,

    if you happen to need more than one parameter there are three ways I thought of that would work

    I never tried it but I believe you should be able to make a struct in both the calling function and in the body of GetData(), and cast it to that if you need multiple parameters

    alternatively, you can pass the parameter (this)

    and cast it to *CRunObject

    then you can do param->GetData(whatever) and have GetData functions in the calling object that will return the parameters you need one by one

    and lastly, you can just set up multiple functions that append all the needed parameters

    like

    long ExtObject::GetData(int id, void* param)
    {
       int param1;
       string param2;
    
       switch (id)
       {
          case 1:
          {
             param1 = (int)param;
             return 0;
             break;
          }
    
          case 2:
          {
             param2 = (string)param;
             return 0;
             break;
          }
          case 3:
          {
             return param1 + param2;
             break;
          }
    }[/code:1pl9i59i]
    
    btw, if you're on right now, you should go to chat
    we can be plugin code buddies
    
    edit:: and if it's not top secret, may I ask what type of plugin you're developing?
  • Very gory... why do you need to cut to shreds what appear to be civilians standing around?

    you don't need to,

    you're just allowed to.

    what fun!

  • k

    Ash, I tried copying line by line the code from the sprite stop animation, and set animation frame actions, and I can't get the bug to stop happening

    there may be a mistake I'm making somewhere

    but it would help if I knew what CurAnim->Updated is for

    it doesn't seem to make a difference in anything I try

    I'm sure it serves a purpose, I'm just not sure what it is.

  • I only suggest vectical scrolling if that's not already done/planned.

    thank you for the suggestion, and yes that one is planned

    All right figured out a bit more. I think importing 1 single file would be the best way to go. That way you can crop the frames in Constructs editor, or leave them for a bounding box

    oops

    thanks again newt

    I think when the plugin is up and working I'm going to make an exe font cutterupper tool, if canvas and image manipulator are up and running well in the latest version

    it's a little bit of a pain to cut up tiles if they aren't evenly spaced, or if they are in vertical order instead of horizontal, whether you're using construct or photoshop or whatever. I don't know of anything that really makes it not a pain

  • I'll have to check that later ash

    I'm going to be out the most of the day,

    also, and perhaps if I am missing a call, it would be the solution to this as well,

    but when I ->info.HotSpotX, it returns the hotspot for frame 0, and not the current frame

    EDIT: info.HotSpotX returns the current hotspot, there was a simple logic error I had made

lucid's avatar

lucid

Member since 16 Jan, 2009

Twitter
lucid has 22 followers

Connect with lucid

Trophy Case

  • 15-Year Club
  • Entrepreneur Sold something in the asset store
  • Forum Contributor Made 100 posts in the forums
  • Forum Patron Made 500 posts in the forums
  • Forum Hero Made 1,000 posts in the forums
  • Coach One of your tutorials has over 1,000 readers
  • RTFM Read the fabulous manual
  • Email Verified

Progress

22/44
How to earn trophies