megatronx's Recent Forum Activity

  • MegaMente Br I see you have 38fps. Can you give me details of your project: nwjs or chrome, something else? your specs? Resolution? Number of objects? Thanks

  • megatronx

    Sorry, I'd avoiding any aspect of making plugins and I'm not a fan of debugging ai generated stuff.

    megamente Br

    Alexander Wiseman

    I haven't used this plugin in months but I tried it and it works here. You'd load the texture to a tag, say "tex" then set the object's texture to that tag. As long as your mesh uv's are good then it should show the texture.

    No problemo.

  • > You need to pathtrace or raytrace from ach object within the range of the light to the light source and if there is a collision with block on the path ( assuming each of your blocks has it's own sprite object ), you test weather the path is between min and max z of the object, and if it isn't, it continues the path till it eventually reaches the source. You already did raytracing I think.

    Bro? 💀💀

    You suggested me to do Raytracing for each light?

    My Raycaster does a ray in one direction and it cost about 7 fps. What would happen to my PC I make the raycast in all directions at the same time and for literally each light in the scene? Idk maybe I am exaggerating, but IDK... I might test it anyway, but this week I don't think so

    You only test for lights within distance.

    If your light is dynamic, you could use A* pathfinding, or you could do a mix of variables and neighbouring tiles check, where if a neighbouring block has another block next to it at the angle towards light, then it is darkened, and you update only a single block on change of state.

  • R0J0hound Can you help me with a plugin? I've asked chatgpt to write c2 plugin that would add expression to retrieve imagepoint name by index ( it would be very useful to me.) I'm not sure how to test it or turn it in to a plugin. Any chance you could give it a shot? Thanks! And Merry Christmas!

    // Define the plugin information
    function GetPluginSettings() {
     return {
     "name": "ImagePointName",
     "id": "ImagePointName",
     "version": "1.0",
     "description": "Get the name of an image point by index.",
     "author": "Your Name",
     "category": "General",
     "flags": 0
     };
    }
    
    // Define the plugin class
    function SetupObject(objectClass) {
     // Define the expression "imagepointName(index)"
     objectClass.AddExpression(0, ef_return_string, "imagepointName", "General", "Get the name of an image point by index.", "imagepointName", 1);
    }
    
    // Define the plugin instance class
    function InstanceType() {}
    
    // Define the behavior of the expression
    InstanceType.prototype.imagepointName = function (index) {
     // Get the sprite instance
     var inst = this.inst;
    
     // Check if the sprite instance exists
     if (inst) {
     // Check if the image point index is valid
     if (index >= 0 && index < inst.image_points.length) {
     // Return the name of the specified image point
     return inst.image_points[index].name;
     } else {
     // Return an empty string if the index is out of bounds
     return "";
     }
     }
    
     // Return an empty string if the sprite instance doesn't exist
     return "";
    };
    
    // Add the behavior to the object
    SetupObject(InstanceType);
  • Any tips for 3D lighting?

    What I was able to do so far:

    - On Start: Function "CallLights"

    - Function "CallLights": for each Light object - Function "UpdateLight"

    Param (0) = light level

    Param (1) = redcolor

    Param (2) = greencolor

    Param (3) = bluecolor

    Param (4) = alphacolor (I did nothing with this until now...)

    Param (5) = light.posX

    Param (6) = light.posY

    Param (7) = light.poxZ

    - Function "UpdateLight"

    -- For each object that isn't a ligth object (this condition is only for my project, as I said, Meshloader load/placehold everything that is 3D)

    -- (param(0)*10)/Distance3D(obj.x, obj.y, obj.z, param(5), param(6), param(7))

    -- obj red color = Function.Param(1)*Self.LightLevel

    -- obj green color = Function.Param(2)*Self.LightLevel

    -- obj blue color = Function.Param(3)*Self.LightLevel

    Image :D

    Problem? Here: I need to make this to verify if ther is a block blocking light, since a light on the ground cannot reach a cave level.

    I saw that it could load light block per block... How am I supposed to that mid-air? I have to place every non-block with 'air placeholder'?

    You need to pathtrace or raytrace from ach object within the range of the light to the light source and if there is a collision with block on the path ( assuming each of your blocks has it's own sprite object ), you test weather the path is between min and max z of the object, and if it isn't, it continues the path till it eventually reaches the source. You already did raytracing I think.

  • Interesting concept. Simple but has intriguing atmosphere. Could be developed further.

    R0J0hound PixelRebirth What specs do you guys have? Curious to know. On my current machine it was running spot even on power saver. I bet it would run spot on on my old i78750h laptop too.

  • * Inside my project the MeshLoader Loads basically everything from 2D to 3D, like a placeholder

    Cool man, will look more in to it later, but on first glance pretty cool. But I think you could use more of c2 features to save yourself that much eventing. For example, instead of using variables to define object type, just use animation frames, animations from sprites. Those animation frames can also hold textures, positions etc Can have plugins loaded to use and reuse. If you clever about it you can minimize the amount of events needed. Planning takes longer thought.

  • I have some plugin repos links

    Pode's plugins

    github.com/Pseudopode/construct2_plugins_behaviors

    Library from another repo on my drive

    drive.google.com/file/d/195z3zWdD3DRfHEuRhUekBDGq_S4FkAra/view

    Rex's plugins

    c2rexplugins.weebly.com

    If anyone has more links, please share. Let's keep C2 going as long as it is viable for us.

  • I understood how the Paster Plugin works!!!

    :DDDD

    But I found a problem, the Paster plugin don't work to copy the text plugin 'sprite', since it's not a... sprite. Anyway, it does work with SpriteFont, BUT! It does have a clip frustum or something (srry I don't want to use translate) -- It disappear when outside layout

    Anyway I searched for one plugin I saw one time, and found this: (https://www.construct.net/en/forum/construct-2/addons-29/behavior-sprite-effects-amp-46890)

    R0J0hound you were here way before me, did you by any change have already downloaded this plugin? Because it isn't available anymore. If not, I might ask the guy who created the plugin and test if it works.

    Afte all, if nothing works, I still can try making loading screen that would hide the Paster Plugin behind a sprite and the SpriteFont behing the Paster plugin to load every text inside the scene.

    Well done. I might get in touch how you did it.

    Here's Pode's plugins repository with the plugin that you want

    github.com/Pseudopode/construct2_plugins_behaviors

    github.com/JohnnySheffield/C2_Plugins_Pode

    And you can grab these I've downloaded from online repo from other creators.

    drive.google.com/file/d/195z3zWdD3DRfHEuRhUekBDGq_S4FkAra/view

  • I think I might use local variables then. I didn't want use them before because I thought it would make the debug window be messy.

    Local variables wont appear in the debug until you set them to static. Just create Locals and then have second set of actions for debug and use whatever you want. Once you don't need the debug for that particular set of events just disable those debug events. This way you can program clean and debug at the same time.

    I will mess around with everything you told me and see what the result will be.

    ++ Try again with the Paster plugin with a can learn how to use it correctly.

    Do I have to position it behind the text

    Then I make its length the same of the text.

    Then I also I change the resolution to fit it's size

    Then? I use 'paste object'?

    This object must be a third object like a plane and that plane will 'screenshot' the area? Or the object selected must be the text?

    Why not have it simpler and have a speech bubble icon above object and when you approach it you'll get 2d speech bubble with text?

  • Btw. Instead of dictionary you should use local variables. They are faster performing.

    As for the speech bubble, in my opinion you should do it just with 2d canvas, and ignore the plugin. You can scale the bubble by dividing it's size by distance, and you can set it x and y on screen in many different but simple ways.

    Scroll x/y are probably same variables as the ones I use in my code for camx camy.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • If I'd be doing a text bubble, I guess I'd work with billboards and would look for a way to turn text in to a texture. Would have to load in additional bubble graphics. Any thought how to do it with PASETER R0J0hound ?

    As for field of view, would love to make a 3d camera cone for tests, but if I won't I'll work with what c2 offers, so fov plugin. I think it's much better to work with what there is in c2 already and with additional events extend those plugins to work in 3d then inventing all of the systems from scratch if it isn't necessarry.

megatronx's avatar

megatronx

Member since 25 Sep, 2008

Twitter
megatronx has 1 followers

Connect with megatronx

Trophy Case

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

Progress

23/44
How to earn trophies