lucid's Recent Forum Activity

  • thanks ash. I actually didn't know how to use the debugger, until I mentioned to david in chat that I didn't know how to use the debugger, and then he started to tell me, and then disappeared, so I messed around until I got it

    and the problem was actually pretty stupid

    I was returning a value before my object was created. I got used to the construct functions where you can do that

    anyway, as far as the object names and such. yeah. it's all going to be one huge initialize action at the beginning when it's final. it's separated into these actions as I go along, because I want to be able to test all these individual pieces out using triggers and events. so these smaller events are really just for debugging purposes until they work perfectly, and then it will only operate on the internal version

    on a side note though:

    it really is just initializing pointers. I have one main object that's going to contain pointers to everything in an index. all creation and destruction related to each of the plugins in the engine will go through the main object. when you run the initialize action, the dialog tells you what object type to choose for each parameter, this is how it gets pointers to all the object types it will be able to create.

  • hi again, k, having trouble creating an object

    I'll show what I've done, maybe you can catch a mistake, or tell me what I'm missing

    there's some other less related stuff in there, but it involves extracting parameters or some other likely problem spot:

    ADDPARAM(PARAM_OBJECT, "TypeA", "Choose the a TypeA object to initialize the pointer.");
    ADDACT("InitPointer", "Initialization", "Initialize Pointer(%o)", &ExtObject::aInitializePointer, "InitializePointer", 0);
    
    ////////////////////////////////////
    
    long ExtObject::aInitializePointer(LPVAL params)
    {
    	pTypeAPointer = params[0].GetObjectParam(pRuntime);
    	return 0;
    }
    //////////////////////////////////////////////////////////////
    
    ADDPARAM(PARAM_VALUE, "Object Type", "Choose which object to create");
    ADDPARAMDEF(PARAM_VALUE, "Layer", "Layer name or number, to create the object on.", "1");
    ADDACT("Create Object", "Creation", "CreateObject", &ExtObject::aCreateObject,"hh",0);
    
    /////////////////////////////////////////////////////////////////////
    
    long ExtObject::aCreateObject(LPVAL params)//returns object pointer
    {
    CRunLayer* pLayer = params[1].GetLayerParam(pRuntime, pLayout);
    if (params[0].GetInt() == 0)
    	{ObjectIndex[index]=pRuntime->CreateObject(pTypeAPointer,pLayer->number, pLayout);}
    }[/code:rqvp7l0h]
    
    EDIT, sorry, this may help:
    [code:rqvp7l0h]	CRunObject* ObjectIndex[500];
    	int index;
    	CRunObjType* pTypeAPointer;[/code:rqvp7l0h]
  • simple one

    how do I make an object destroy itself

    I can't find a aDestroy() action in the sprite cvs I'm assuming you need to

    #define COMMONACE_COUNT_DESTROY

    either way, do I have to explicitly destroy them

    with

    ExtObject::~ExtObject()[/code:2kpiwxmt]
    
    or is there a something in the sdk to do it?
    
    Edit:
    would it be pRuntime->DestroyObject(MyObjectPointer)?
  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • [quote:34rfl3vm]Perhaps you could look at implementing LUA instead?

    as you may have been able to tell from some of my more newbish questions, I'm very inexperienced with programming. I took a class or two 9 years ago, and I've read half a c++ book here and there, but I have no real experience making something other than tutorials. The logic I'm using I understand completely, but I'm still looking up alot of pointer syntax on google frequently, and I'm only now giving real thought to #includes and such. so aside from learning how to make lua, I'd be learning how to use lua, and c++, and the sdk at the same time, and besides...lua's not what I need anyway:

    So sort of like a programming language?

    I'm sorry, not commands that you write out necessarily, but for instance, you have made animation systems in the editor, and saved your game file. Now in construct you can call an action from a character object, and the actions you call can be as high level as for sprite animations, but they'd be procedural and dynamic, with more options. And there will be environment objects for physics, and lighting with similar high level actions, conditions, and expressions. And so on and so forth for everything from AI to UI

    The idea is that after creating everything in the editor, you would include one of each of every engine object type, and at start of layout, you would call one initialize action on a main object that allows you to load your editor saved file, and initialize pointers to the different object types, and this one main object creates all instances of all objects, and snaps them together with pointers, and such, and set everything in motion. Amazingly, the main groundwork that I needed to work for the rest to work is mostly finished, and functioning stably. Wish me luck.

  • Ok,

    I have some pointer variables that I declared in main.h in the ExtObject definition

    but I realized at runtime all instances of my plugin shared these pointer variables

    but not the other variables

    for instance:

    class ExtObject : public CRunObject
    {
    public:
    //...all the sdk code ...//
            
       CRunObject* pMyPointer;
    	int MyInt;
    
    };[/code:3qbfajmq]
    
    at runtime MyInt stays unique to each instance of the plugin
    pMyPointer is like one variable shared by all instances of the plugin
    
    I say instances, but to clarify, this happens whether I have several instances of MyPlugin
    or if I have cloned MyPlugin several times so I have separate objects MyPlugin, MyPlugin2, etc...
    
    is there a way to avoid  this? I want each instance to have a unique pointer.
  • not sure what you mean aeal

    this is 98:

    http://dl.getdropbox.com/u/1013446/mouseover98.cap

  • Thanks again Ash

  • 2. I'm not sure I understand the question. If you use pRuntime->CreateObject(specific_object_type, 1, pLayout), and specific_object_type is a valid CRunObjType*, that will work.

    well for instance if I wanted to create a sprite

    how would I get the CRunObjType for sprite or my_object_type, when they aren't chosen as parameters

    just no matter what it's supposed to create a sprite,

    or to put it another way

    how do I get a CRunObjType* for sprite without using GetObjectParam?

    or my_object_type

  • I'm going to flood the board if I keep starting new threads for all my questions, so they'll all go here

    1.

    in the template SDK resources, there's IDR_ACTIONS and IDR_CONDITIONS, and IDR_EXPRESSIONS menus.

    can I do something with these? like make a different kind of interface to the plugin, instead of the standard list thing that comes when you use add param and such?

    2.

    I can take a parameter for object types, and get

    CRunObjType* pObjType= params[0].GetObjectParam(pRuntime);
    [/code:31q7idtd] which I can use to [code:31q7idtd]pRuntime->CreateObject(pObjType, pLayer->number, pLayout);[/code:31q7idtd]
    
    what if I already know the object type beforehand?  is there a way to like
    [code:31q7idtd]pRuntime->CreateObject(specific_object_type, 1, pLayout)[/code:31q7idtd]
    
    or 
    
    [code:31q7idtd]CRunObjType* pObjType = my_object_type[/code:31q7idtd]?
  • Good to know that it isn't too hard to get the hang of.

    The SDK couldn't be more awesome.

    [quote:106ydxet]

    What exactly are you making?

    I'm making an engine that plugs into construct

    it's going to generate several types of procedural data (animation, graphical, behavioral, etc, etc)

    that I will be able to setup and save in a separate editor and then use within construct

    with high level commands, like "start animation("animation name")", or "pop up window("pause menu")"

  • thank you rich,

    this is all very eye opening and awesome

  • or the system else condition

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