lucid's Recent Forum Activity

  • k

    I've been having a problem where a cap I'm working on

    suddenly the Preview exe's crash immediately

    once it happens once, it's done, no undoing or removing of events will fix it.

    this coincides with the Cap being unloadable

    if I exit construct, and try to load the cap again, it just hangs.

    also, if I change the events back to a noncrashing config manually (not through undo),

    it does not fix the problem. Once it happens once, the cap is corrupt,

    or so it seems

    I will make a bug report if I can isolate what's causing it

    I'm using 99.3 and originally I thought this happened only when I attempted to load caps after changing the plugin in between saving and loading, but that isn't it, sometimes it's in the middle of editting the cap

    first, is this a known issue with 99.3?

    if not, could this be caused by not Serializing data?

    as I understand it, I only need to serialize data if it is something edited in properties, for instance.

    if all the plugin variables are set through events or conditions, it doesn't affect the edittime at all, so it need not be edittime serialized, correct?

  • (what do you win?)

    a coupon for a free small fries from McDonald's

  • oh!

    I thought when you said no new major features until 2.0

    online play was definitely out

    this is good news

  • Device name: NVIDIA GeForce 8800 GTS

    Pixel shader: 3

    Estimated VRAM: 2403 MB

    Motion blur: Yes

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • k

    this is tested, it returns the right value and everything

    forreal this time

    the exact code you just posted

    and this in getdata will return your param back to you

    :

    long ExtObject::GetData(int id, void* param)
    {
    	int* myint =(int*)param;
    	return *myint;
    }[/code:1nhqf3aj]
    
    sorry for all the wrong answers 
    
    and to be clear, this also works:
    [code:1nhqf3aj]long ExtObject::GetData(int id, void* param)
    {
    	
    	return *(int*)param;
    }[/code:1nhqf3aj]
    
    you are type casting the void pointer to a int pointer (      (int*)      )
    then you are dereferencing this pointer to get the value of what it's pointing to
    
    please post back to make sure this worked for you
  • 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">

  • 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
lucid's avatar

lucid

Member since 16 Jan, 2009

Twitter
lucid has 25 followers

Connect with lucid

Trophy Case

  • 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
  • Regular Visitor Visited Construct.net 7 days in a row
  • RTFM Read the fabulous manual
  • Email Verified

Progress

24/44
How to earn trophies