QuaziGNRLnose's Forum Posts

  • What do you even mean by attribute?

    you can make a behavior which modifies an instance. You can make a flag on the instance. you can then check for that flag on the instance, which is effectively what you want to do, you can even make the behaviour control multiple 'attributes' and flags. It's not very complicated.

    pushing out of an object requires complex detection routines / memory management to be fast, you're greatly simplifying things.

  • you'll need to grab those positions before the layout changes. construct doesn't automatically save the previous object positions like that. Make a plugin with an action that has an object type param, and save the positions of all the objects picked into an array or js object, then process them in the next layout by making your object global or saving the array to some global js object.

  • I'm still confused by what you mean by mouse x y. the coordinate system is fixed while the camera can rotate. You mean the intersection of the mouse position in screen space projected onto the x,y plane formed by the world x,y axis's? You'll need to use a line plane intersection formula:

    http://geomalgorithms.com/a05-_intersect-1.html,

    You'd have to generate a line using the mouse position / camera orientation/axis. It's a bit involved if you're not comfortable with vector math, but its a simple enough task to start learning with. The ray you generate will depend on the type of camera you're using. I guess i'll eventually add a helper function to do this using the viewport object.

    again these aren't specific things to the plugin, you'll need to learn basic 3D maths to do this kind of stuff.

  • I managed to fix the problem by deleting a multi line comment from within a function...

    i had something like:

    alert('start')

    Act.prototype.function001 = function(){

    var do,code;

    stuff(true);

    code = stuff();

    /* bla bla bla

    blalblabla

    bla bla

    this is actually a multiline comment*/

    }

    alert('1');

    ...... etc.

    if i delete the multi-line comment from within the function, everything works as intended...

    There something very wrong with how multi-lines are being handled by the exporter. I think its pretty agreeable that deleting a comment is a very obscure bug-fix. I almost don't believe it's that but after testing quite a bit im 100% sure.

    I can send you stuff if you want to investigate but it'll have to be privately.

  • So far what i understand a little more from more testing.

    I have a lot of actions (about 150). From the previous for-in loop i found that there was a chunk of maybe about 30+ actions that come up sequentially in the runtime.js file of my plugin but are missing from the prototype in export. there are actions which aren't missing which come before and after this chunk. My theory is that the 'compiler' - parser- whatever you might call it, which runs during export, is clipping out a big chunk of code from the runtime for some strange reason which i'm not sure of.

    I added alerts throughout my code so that i have my runtime.js file set up something like this:

    .................... above this point there are lots of actions that weren't missing around where actions started to go missing from acts.proto on export i added alerts.

    alert('start')

    Acts.prototype.function001 = function(p1,p2,p3){

    //code

    };

    alert('1');

    Acts.prototype.function001 = function(p1,p2,p3){

    //code

    };

    alert('2');

    Acts.prototype.function002 = function(p1,p2,p3){

    //code

    };

    alert('3');

    Acts.prototype.function003 = function(p1,p2,p3){

    //code

    };

    alert('end')

    .................. more actions which didn't go missing.

    running the project, in preview all the alerts fire as you would expect, but on export only those which come after a certain point, and those which come before a certain point, are firing. theres a block of script which just disappears for no good reason. I've poured over the code and there doesn't "seem" to be anything suspicious which should cause this, but it's happening anyway.

  • I've made a simple routine to check which functions are being added to Act.prototype

    var str = ""

    var key

    for( key in Acts.prototype) str += key+"\n"

    alert(str);

    when i call this, in preview all my actions appear, but in export a big block of them are mysteriously gone, but not all of them.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You mean you want to project it from screen space into the 3D world right? The Q3D viewport objects castRay is your best bet like in the physics example.

    you can test against invisible objects i think, so you just need to put invisible collider geometry and use a raycast. Alternatively (this is a bit faster cpu wise) you could use a bit of math but it's kinda complicated and annoying.

  • I also just recently had to fix a new problem where my code wasn't working anymore in export because i had comments on a single line using /*comment*/. i'm just guessing that it had something to do with the /**PREVIEWONLY**/ style compiler instructions.

    I'm not sure how i'm supposed to debug when its specifically exports causing me trouble, and everything works fine in preview. I wouldn't expect anything to change so vastly

  • Code doesn't work with the minifier, but i'm not running the minifier so i'd expect behaviour to be identical to preview. It's my own plugin yes.

    As an example I have specific functions in Acts.prototype, like Acts.prototype.foo, and Acts.prototype.bar .

    to test i made an event in a blank project with my plugin like "on key z pressed : alert something" and that causes the following js code to execute:

    alert(Acts.prototype.foo)

    alert(Acts.prototype.bar)

    in preview:

    the first alert returns the contents of a function as expected.

    the second alert returns the contents of a function as expected.

    in export:

    the first alert returns the contents of a function as expected.

    the second alert returns undefined.

    if i attempt to run the action which returns undefined in my project, i get the "cannot call .apply on undefined" bug

    The fact that some of my actions just don't exist on export is very confusing, and I can't figure out why this is happening on export only, unless C2 is parsing things completely different than in preview.

  • Ashley

    I'm running into a big problem where exporting seems to change functionality from preview completely. Lots of things which run fine in preview are spontaneously broken during export. I'm getting a very weird bug where actions work fine in preview and cause errors with "func.apply" in Action.run_object, saying func is undefined. I'm really baffled as to why the export (so far NW and HTML5) are behaving SO differently than the preview, that actions aren't even being called.

  • hmm seems like some kind of weird build bug slipped by this version, im trying to fix it atm. This Construct version (192 and up i think at least) seem to be garbling the code on export because of something weird. Sometimes i write comments in the code that are /* */ like this on a single line, and they're breaking with the exporter. I'm fixing it asap.

    looks like it may partially be a construct bug though, things like this shouldn't just switch.

  • GameThirsty

    how are you exporting? which platform ? Sometimes "use model" will be true on an object with an invalid filename specified, and export causes the models to not load if one fails because the model file it does not exist. Make sure this isn't the case. It only happens on export sometimes because of the way loading external resources is handled. Also i've been wrestling with a cordova bug for a while that makes model loading fail on that platform.

    If you're loading cross domain resources, they'll only work in Node Webkit.

    I need more details to understand the issue, and fix / suggest anything.

  • GameThirsty

    Q3D sprites aren't affected by lights.

  • Aphrodite

    yea i rephrased it, you quoted a post i edited a few seconds later realizing what i said sounded off from my exerience

  • I'm pretty sure the dt in C2 is based on the assumption that whatever the framerate, it'll sum to a value of 1 after a second. I don't see why it should go crazy at 120 fps unless you've double counted dt somewhere, or just plain used it wrong