GetData() is nothing more than a general-purpose plugin-defined function that other plugins can call to get data or perform actions specific to that plugin. 'id' is intended to determine what to do, and the void* param is simply four bytes of data to pass as a parameter. The return value is so the callee can get data back from the call (or it can write out to the pointer 'param').
If the basic syntax is confusing you, you might want to go over a C++ tutorial or book again some time.
Oh, its not... humm... well hopefully you can work it out from those functions!
Develop games in your browser. Powerful, performant & highly capable.
Look at the Physics object source on CVS. At edittime you can use SetGlobalKey/SetLayoutKey to store named global data (a four byte void*). If the 'save' parameter is true, the data is saved to the .cap and also exported to the runtime when previewing. VRuntime also has set/get global/layout key functions, which can then retrieve the data.
Very gory... why do you need to cut to shreds what appear to be civilians standing around?
I think you'll just have to download them all. Unfortunately Construct requires the components Microsoft call "optional", which is probably poor naming on their part.
Have you checked the Sprite object source to see how it sets animation frames and speeds? Are you missing a call to update the animations or something similar?
Oops, yeah the correct syntax is ExtObject. It should work OK with a static member variable declared like that. I'm not sure why it wouldn't, a couple of other behaviors already use this method to access other behavior's data
Did you install the DirectX optional components with the Construct installer? If you skipped that dialog and didn't install the DirectX components, you may be missing the legacy shader compiler, which could cause effect errors.
Suffice to say, yes or no
If it has to be a yes or no answer, then no.
In C++, static class member declerations also need to be declared in a .cpp file so the linker knows about them. The following line in runtime.cpp should fix it:
vector<CRunObject*> CRunObject::sameBehavior;[/code:2nr3odo6] This is not an SDK specific thing, you need to do this any time in C++ you declare a static member.
That's right, and you would do something like:
sameBehaviors.push_back(this); // in OnCreate()
sameBehaviors.erase(find(sameBehaviors.begin(), sameBehaviors.end(), this)); // in destructor
You'll need to include <algorithm> for std::find.
They'll still work in older versions too, because they're binary compatible. But any features which have changed (the renderer, filter etc) won't work in older versions, but I don't know of any plugins this would affect.
Member since 21 May, 2007 Last online 15 Oct, 2026
The official blog for all things Construct and Scirra run by our employees!
Wider technology issues from Ashley's perspective.