[PLUGIN]Unique Sprite(no anim,uniqe image per inst

This forum is currently in read-only mode.
From the Asset Store
Elevate your games with our AI Chatbot Integration! Seamlessly connect your Construct 3 projects with GPT-4 for dynamic,
  • I tried it in debug mode and Destroying the UniqueSprite doesnt decreases VRAM usage

  • I tried it in debug mode and Destroying the UniqueSprite doesnt decreases VRAM usage

    Actualy i have to take back what i have said a while ago.

    My game gone very advanced and this plugin is now a crucial element of it. and yeah, i just noticed that for some reason the textures arent unload. EVER. And if i wont find a way to kick them out of the damn VRAM my game is ruined. 6months of hard work gone down the tube. And i am at point where rebuilding the game without this plugin is just out of the question.

    now what.

  • Hi,

       Unfortunately I don't have anything setup to work on CC plugins anymore. I don't even have Visual Studio installed, and won't until it's time to make the Spriter plugin for Construct Classic, which is a ways off. It's barely changed from the vanilla sprite plugin, so anyone with basic plugin knowledge should be able to work something out.

    Here's the source code:

    https://dl.dropbox.com/u/1013446/UniqueSprite.rar

  • Here is an update that releases textures when you destroy the object or load another texture.

    http://dl.dropbox.com/u/5426011/plugins/UniqueSpriteFixed.zip

    Hopefully my build setup doesn't cause any issues.

    lucid here is what changed

    The destructor in Runtime.cpp:

    ExtObject::~ExtObject()
    {
         // No longer using this animation
         pRuntime->ReleaseAnimation(pRoot);
         renderer->ReleaseTexture(localTex);
    }

    and the load frame action in Actions.cpp:

    long ExtObject::aLoadFrameFromFile(LPVAL params)
    {
         TextureHandle newTex;
         try 
         {
              //localTex
              newTex=renderer->CreateTextureFromFile(params[0].GetString());
              //pAnimFrame->th=localTex;
         }
         catch (...) 
         {
              return 0;
         }
         renderer->ReleaseTexture(localTex);
         localTex=newTex;
    ...
  • Try Construct 3

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

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

  • Seems to crash the application if there is no image loaded and you delete one. Not a big proplem, just good to know. This is in the fixed version.

  • Unique Sprites used with Bullet beh crashes the app after about 7-9sec of firing. Thats regardless of fire rate or speed.

    UPDATE:

    Actualy this happends without any beh at all too.

    It doesnt happend with rising numbers of the objects. Just with time.

    Funny - as long as they wont MOVE everything is fine O.o

    But make them fly and sh*t hits the fan.

    UPDATE:

    Okey it looks like the problem might be comming from when the Unique Sprite object is being destroyed. If too many of them are being destroyed at once... well. App crashes.

  • broken link dude?..

    fix it please?..

  • fixed

  • Hey, thanks for this plugin, btw I have a problem when I'm using it with python :

    When you use UniqueSprite.x or UniqueSprite.y it always return "0" :/

    # v = the unique sprite instance
    
    if MouseKeyboard.MouseButtonDown(0):
    	v.SetPosition(System.MouseX, System.MouseY)
           # so now v.x, v.y should be : System.MouseX, System.MouseY
    
    hp.SetText(str(v.x) + ":" + str(v.y)) # but the text is -> 0:0
    [/code:2ql6tlk4]
    Those things works when you use the default Sprite object (the construct's one) and return the Sprite current X and current Y.
    
    Any way to solve it ? 
    
    Thanks in advance
  • Unfortunately I no longer have the source code to this. I also haven't worked on this or with Construct Classic for over 2 years, so I can't be of much help I'm afraid.

  • playerelite

    Re-download the link I posted for a hack fix. Ignore expressions a and b.

  • thanks R0J0hound

  • playerelite

    Re-download the link I posted for a hack fix. Ignore expressions a and b.

    Wow thanks, it's 100 % working now

  • I've got the same problem as irbis now, when I destroy more than 5 unique sprite (even if there are 10 seconds between each destruction) it crashes :/

    My .cap if you want (right click to move, right click on rocks / gifts to destroy them) :

    http://rghost.net/private/59392717/6d86663ff667813572a8ac203f00e0d1
    [/code:3gtk4odm]
Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)