cacotigon's Recent Forum Activity

  • EDIT: No problem, I'll upload a working sample capx, give me just a second.

  • I'm going to presume that you have an initial object belonging to Family created already. (and that there is only one of them on the screen at the time)

    Create a Global var called:

    Last_FamilyInstance_UID

    System On Start Layout

    --> Last_FamilyInstance_UID = Family.UID;

    Every X seconds:

    --> Family.Pick Last_FamilyInstance_UID

       --> Family.Spawn (Family, Family.ImagePointX("Back"))

       --> Last_FamilyInstance_UID = Family.UID // this will pick the one just spawned

    Note: I believe that calling Spawn on a Family will spawn a random sprite belonging to that family, though I'm not sure.

  • I don't get what I'm doing wrong here. It seems like a simple equation. Given time t, starting y0, ending y1, and gravity g, find the initial y velocity vy0 such that y1 is the apex (vy should be 0 at this point in time).

    Starting with basic movement equation:

    y = y0 + (vy0 * t) + (0.5 * g * t?)

    --> (vy0 * t) = y - y0 - (0.5 * gt?)

    --> vy0 = [ (y - y0 - (0.5 * gt?) ] / t

    I then set the bullet behavior angle to 270 degrees, and the speed to the absolute value of vy0, and the gravity to g. But it travels way past the point which I had intended to be the apex of the curve.

    Here is the code:

    <img src="http://dl.dropbox.com/u/12667027/Construct%202/Ballistics/ballistics.png" border="0">

    Here is the capx:

    Ballistics Capx

    What am I missing?

    -- cacotigon

  • Thanks! In that case, I'd better stick to a subsequent pick call of the Function.Result which I set to the created object's UID.

  • If I have the following code:

    Event 1

    -- Subevent 1

    ---- Call Function("CreateObjectA")

    ---- Set ObjectA.Val = bla bla bla

    And CreateObjectA() is a rexrainbow function (in a separate event sheet), which has:

    On Function CreateObjectA

    -- System Create ObjectA

    Will the following calls that act on sprites of type "ObjectA" only act on the one that was created? As I understand it, when a sprite is created, the SOL (for sprites of ObjectA) is only set to that particular instance.

    I just want to make sure I don't have to do a subsequent Pick by the created objects UID. Anyone have any ideas about this? I've got a lot of object A being created on the fly, so it's very important that the following Set value call only act on the latest created instance of ObjectA.

    Thanks,

    -- cacotigon

  • Construct r78

    Windows XP SP3

    Repro:

    1. Object Types

    2. F2 rename (object name is highlighted in blue)

    -- Ctrl-X (results in deletion of highlighted events)

    -- Ctrl-C (copies events instead of highlighted text)

    It's a small thing, but it got me for a second.

  • It's weird, I mean, I can't be sure if it did support WebGL before, since I only started working with Construct about a month ago, but all of my Construct projects have always been set to WebGL, and the framerate has always been decent.

    I checked the about:gpu page:

    All of the options were set to *not* hardware accelerated, so I went to the about:flags and enabled "Override software rendering list", and now it reports:

    Canvas: Software only. Hardware acceleration disabled.

    HTML Rendering: Hardware accelerated

    3D CSS: Hardware accelerated

    WebGL: Hardware accelerated

    WebGL multisampling: Hardware accelerated

    Canvas is set to software, but WebGL is hardware accelerated, so does that mean webgl construct apps are hardware accelerated?

    It also seems to run smoother. I just wonder what changed to make this happen in the first place.

  • I've always done my testing and previewing in Chrome and it's worked fine up until a few minutes ago, now for some inexplicable reason (despite multiple reboots), chrome webgl is down to 4/5 fps for even the simplest of html5 tests.

    If I switch webgl off in Construct, then it runs significantly better. I then decided to do a preview in Firefox with webgl, and it works fine!!! I also went to some random WebGL programs such as this one

    https://cvs.khronos.org/svn/repos/registry/trunk/public/webgl/sdk/demos/webkit/Earth.html

    and I get 20 fps in firefox and 4 fps in Chrome, so it's not just Construct. I've got Chrome 18.0.1025.11 beta-m and Firefox 9.0.1.

    Does anyone have any theories about how Chrome WebGL could suddenly get corrupted? Can someone chime in about what version of Chrome they are using? I haven't changed anything, or installed any extensions or plugins, so I have no idea what is going on.

    Thanks for any advice,

    -- cacotigon

  • I think you might be overcomplicating things, this is much simpler:

    (Spawner.myobj == 0)

         Spawner.myobj = 1

         Spawner.Spawn Object (child_obj)

         child_obj set position to Spawner.X Spawner.Y

    That will do it immediately, however, Sprite.Spawn method can create an object located at an image point or origin, so it should already be "on top" of the Spawner so to speak.

    Secondly, why would you need "on tick"? Unless the spawner is moving around, it's going to repeatedly set the child_obj's position to the same coordinates.

    Let's assume for a moment that the Spawner does move around, you could just pin the child object:

    #1: Add Pin behavior to the child object and pin the child object to the Spawner right after the Spawner.Spawn child_obj call.

    Here is how to use a stored UID's sprite's properties (you have to use Sprite.Pick call)

    #2: If you want to set child_obj to obj_parent's coordinates, but you only have obj_parent's uid value, then you need to do this:

    Pick(instance of obj_parent where UID = obj_parent)

         child_obj.Set position( obj_parent.X, obj_parent.Y )

    See here for tutorials on picking:

    scirra.com/forum/how-do-ifrequently-asked-questions_topic45416.html

    Hope this helps,

    -- cacotigon

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • <img src="http://dl.dropbox.com/u/12667027/Construct%202/UsingGenericImagePoints.png" border="0" />

    I have a ton of different sprites all of which are capable of firing projectiles. However, the firing point is different on all of them, and it also happens at a different spot in the "Attacking" animation, so I decided to set an image point which only exists in that particular frame of the Attacking Animation and test for it in the family of enemy sprites.

    The Shell sprite is a generic sprite which contains a UID ref to the Animation Sprite, the respective firing frame index, as well as a lot of other common enemy properties.

    Is there any chance when a player hits a "cpu spike" in the browser, that a frame might be skipped and the event will fail to return true? If so, how would you recommend restructuring the code to accommodate for this?

    Thanks muchly for assistance,

    -- cacotigon

  • I'm going to outline the entire problem with a picture, but basically, on animation finished seems to fail for sprite families. Before I post this as a bug (A REALLY FREAKING ANNOYING ONE THAT MADE ME DO AN ANGRY DONKEY KONG DANCE IN MY ROOM), I want to make sure I'm not doing something wrong.

    <img src="http://dl.dropbox.com/u/12667027/Construct%202/FamilyAnimationFinishedBug/familyanimationbug.png" border="0">

    Here is the capx as well for those interested in seeing this in action.

    Family Animation Capx

    P.S. Will I eventually get some kind of xbox achievement award for discovering the most bugs, like an Orkin Man Trophy or something? <img src="smileys/smiley36.gif" border="0" align="middle">

    -- cacotigon

    EDIT: Guess what I just realized. Since the hack solution is checking if the animation is playing and the frame is set to the last frame, it's going to immediately trigger at the *start of the frame* without waiting for the last frame to complete the frame time allotted to it in the 'Frame Speed', SO OH BOY.

    EDIT 2: I duplicated the last frame in the animation to "fix" the problem.

  • Just created new project from scratch to confirm this bug.

    Here is the test project:

    Family Instance Bug Sample Capx

    Open the project and try one of the following things:

    1. Attempting to change family instance variables values results in "Name used by object type in this family".

    2. Attempting to drag another sprite (belonging to the family) into the layout results in a Construct 2 Check failure as seen in this thread:

    http://www.scirra.com/forum/adding-to-family_topic48923.html

    Any attempts at retrying or ignoring usually result in complete crash of program. Unfortunately, I won't be able to continue working on my project until its fixed as my entire design revolves around the usage of family instance variables. :(

cacotigon's avatar

cacotigon

Member since 10 Mar, 2009

None one is following cacotigon yet!

Connect with cacotigon

Trophy Case

  • 15-Year Club
  • x2
    Coach One of your tutorials has over 1,000 readers
  • RTFM Read the fabulous manual
  • Email Verified

Progress

18/44
How to earn trophies