Prominent's Forum Posts

  • Pin+

    Works just like the pin behavior, but has more features.

    You can pin other properties besides the default;

    position/angle,

    width/height, (w/h size, w/h size relative, x/y scale, x/y scale relative)

    zindex/layer,

    opacity,

    visibility,

    collisionEnabled,

    timescale,

    hotspotX/hotspotY,

    imagepoint,

    animation,

    frame,

    mirror,

    flip,

    destroy

    There are also expressions to receive the states of each, as well as actions to set them. You can also have them preset in the properties window.

    When you pin an object, it will ask for a mode, such as position only/position and angle, etc. It will only reposition if you have the x,y property enabled and only set angle if the angle property enabled.

    download link:

    r8 (new): https://1drv.ms/u/s!AhHSZHEulqh_gg2mU5cKBvCFdUKo

    r7 (old): https://1drv.ms/u/s!AhHSZHEulqh_ggeYd6-9HIeFgikN

    edit: here's a simple capx example

    https://1drv.ms/u/s!AhHSZHEulqh_gX4lAkddZ560rWic

  • nice, thanks for the info! That works great!

    I feel like I've gained some new brain cells and can make better plugins/behaviors now.

  • Thanks for that tip!

    Okay, seems like it might be choosing the first instance of the objectType..

    I believe by calling the ZMoveToObject it was expecting to be run in an event which would have a SOL..

    var other = obj_.getFirstPicked(this);

    is in the call, so I think it tried to pick from SOL.. so in this case it would always pick the first instance of the object apparently.

    I went and copied the code into my behavior and replaced that so that it doesn't try to pick anything(since the behavior already has the object picked), and now it works..

    So I guess I'll live with this unless anyone knows how to change the SOL??

    maybe someone who knows more about it can suggest it, but I remember the desire for a timeline feature where you can set up scheduled events or animate the events, or something like that..

  • oohh I see. Okay, now it is called, but for some odd reason it isn't moving the object to the correct layer.

    ..just seems to be setting it 1, when it should be set to 6 (pinObject is on 6, this.inst ends up on 1).

  • "this.inst.type.plugin.__proto__.acts.ZMoveToObject"

    is not correct

    "cr.plugins_.WebStorage.prototype.acts.StoreLocal.call(webstorage_obj, key, value)" ,

    - replace "WebStorage" to your plugin name ("Sprite", maybe)

    - replace "StoreLocal" to your function name ("ZMoveToObject", maybe)

    - replace 1st parameter to the instance ("this.inst")

    - replace other parameters according to your function call interface("1,this.pinObject.type", maybe, I am not sure "this.pinObject.type" is correct or not)

    Reference : Function.prototype.call()

    The plugin name could be different depending on which object has the behavior.

    So if a 9patch has it, it would be NinePatch. If a sprite has it, then it would be Sprite, I think..

    How would I find that out?

    I guess I would then do cr.plugins_["objectType"] ?

    I tried console.log(this); to search through it, but can't find it anywhere.

  • yes, this blog post sounds exciting to me.

    also, I will definitely be submitting some feature suggestions when I can.

  • c2plugins.blogspot.tw/2014/02/reuse-ace.html

    can you explain what this is? not sure what it is about.

  • Thanks r0j0hound, that helps a little.

    I seem to have run into another issue..

    here is my code

    behinstProto.tick2 = function ()

    {

    if (this.zIndex === 1 && (Math.abs(this.pinObject.zindex-this.inst.zindex)>1 || this.pinObject.layer != this.inst.layer ))

    {

    this.inst.type.plugin.__proto__.acts.ZMoveToObject(1,this.pinObject.type);

    }

    };

    I end up receiving an error message saying..

    uncaught typeerror: cannot read property 'index' of undefined.

    line 832, 19 or commonace.js

    acts.ZMoveToObject = function (where_, obj_)

    {

    var isafter = (where_ === 0);

    if (!obj_)

    return;

    var other = obj_.getFirstPicked(this);

    if (!other || other.uid === this.uid)

    return;

    // First move to same layer as other object if different

    error here>>> if (this.layer.index !== other.layer.index)

    {

    this.layer.removeFromInstanceList(this, true);

    this.layer = other.layer;

    other.layer.appendToInstanceList(this, true);

    }

    this.layer.moveInstanceAdjacent(this, other, isafter);

    this.runtime.redraw = true;

    };

    not sure how to fix this.. maybe I can't call it?

    btw, I'm trying to make a pinned object keep the same layer/zindex as the object it is pinned to.

  • Moodge pretty much confirms my suspicions in regards to new users of construct. New users who have no experience working with construct won't have the desire to pay a subscription fee if they don't even understand how construct will work for them. A new user could take months, years just getting accustomed- sometimes spending months not even using construct and coming back to it later. Then you also limit the free version even more which makes the introduction process shorter-lived.

    If I'm wrong then perhaps they will buy once, but will only use it a few months out of the year and then never use it ever again due to the subscription. And if that is the case then it might prevent hobbyists from continuing to use construct at their own pace.

    I could be wrong though. That's my thoughts on it anyways.

  • I'm making a behavior, and need to know how to call the acts.ZMoveToObject from commonace.js from within my behavior.

    sorry if this is a noob question.

  • So I spent some time and cloned the Pin behavior and added the option to scale the object to the pinned object's scale.

    I wish I didn't have to resort to this behavior and the extra objects, but I feel like my feature requests aren't being heard so I have to make due with what I have. This is the best option I can come up with on my own.

    So I might spend some more time adding more features to the behavior and then sharing it in the plugin section of the forum. I feel like it will be very useful for others.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Problem Description

    When pick by evaluate is used, a sub event with Or block will not limit itself to the picked.

    Attach a Capx

    https://1drv.ms/u/s!AhHSZHEulqh_gXytJvUD1PEiFvE7

    Description of Capx

    it picks by evaluate, and then does an Or condition. It then prints to text object.

    Steps to Reproduce Bug

    • simply run program
    • look at events.

    Observed Result

    Or block is run

    Expected Result

    Or block shouldn't run.

    Affected Browsers

    • Chrome: (YES/NO)
    • FireFox: (YES/NO)
    • Internet Explorer: (YES/NO)

    Operating System and Service Pack

    vista

    Construct 2 Version ID

    r243

  • Some get dynamically resized during runtime, yes. And the objects in the container sometime get repositioned also.

    I've been wondering perhaps a behavior could be created that is similar to the Pin behavior but just copies all the properties/position/size, etc. So a more advanced pin behavior. Then perhaps I could create the other 9patches and then create and pin them to the current 9patches at the start based on what layer it is on. Then I could control the original 9patches and the pinned ones would auto-copy that..

    This seems like it might be the most sane way of handling it without all the headaches of eventsheet complexity that makes further development more difficult.

    but not sure if a behavior can accomplish that yet- would need to look into how the pin behavior works and if it can be expanded.

  • oosyrag , unfortunately sprites don't tile/repeat. I could use a tilebackground, but those don't have animations/frames, so that would be 4*4*25 tiledbackground objects(for each side of the 9patch area)!! So using sprites/tiledbackgrounds is out of the question.