Pulstar's Recent Forum Activity

  • You need to store the location in variables, mark it as "selected" or something with a boolean, then in the next sub-event's conditions pick all objects of the same type*, then exclude the selected object and after that add a pick closest to X,Y condition.

    Please see capx as an example:

    https://www.dropbox.com/s/z1df71tscepzr ... .capx?dl=1

    *remember every condition picks only out of the objects exluded by the conditions before/above it, you need to make sure you are selecting out of all objects again hence why you need pick all which resets it to all, then you narrow it down to all but the selected one.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Add a number variable called "Parent" to the pinned invisible sprite and one called "ID" to the visible Animation sprite. Set the Parent value to be the same as the ID of the Animation sprite, make sure every visible Animation sprite has a unique ID and the pinned invisible sprites are assigned the correct parent IDs.

    Under the "Animation hit by Weapon" condition, add a second condition "Compare instance variable [Parent] for Invisible Sprite", with the value of parent equal to "Animation.ID" (the ID number of the hit animation will be retrieved by construct). That way the hit by weapon event will pick only the invisible sprite that has the right animation designated as a parent, and any actions you add in the same event will apply only to that invisible sprite.

    I think this can also be done with containers but I got used to doing it as above that I never bothered with containers.

  • Basically you do not know *where* Bob is in the array? I had a similar challenge when I attempted modelling customizable spacecraft. Instead of creating an object for every module, with its own variables, I stored everything from stats, sprite ID etc. to description in an array.

    If you have the name in row 0 (y=0) of your array you can just use array.indexof("bob") as shown in the capx:

    Some explanation on the capx. When you click on the button it retrieves a random name from y=0 of the party array. It stores that random name as a text string in the buttons variable. Then the same name, as text, is passed to the ReturnPartyMemberName function as a parameter, stored as a text variable "name" (the function.param(x) expression can in some cases not be retrieved within a function event after some sub-event or actions, so it is best to store the parameters in local variables located in the fun just in case) and array.indexof(name) will retrieve the x index of the name.

    https://www.dropbox.com/s/rrrn0j5s4hs5l ... .capx?dl=1

    If you have names stored in another row, or worse, if you have names all stored in column 0 (x=0), or any other column, with each row a different party member, you need to do a custom search function for retrieving the index. It is a bit more difficult but not impossible.

  • No problem. I googled for test screen images and it came up in the results on some forum post. Not sure what the original source is.

  • Attached simple example. Basically if you do not move your mouse it should take the camera 2 seconds to reach the position to which the cursor was first moved.

    EDIT: this should also solve the problem you described in the second post. Use scrollx and scrolly to return the current camera position in the layout, then scroll to a point relative to that by adding whatever up/down or left/right scroll number of pixels you wish.

    https://www.dropbox.com/s/njypmgrwa6pcj ... .capx?dl=1

  • Here's how I did it with timer behaviour added for enemies, turns out it is a bit more complicated than expected (not too much though). Add (repeating) timers equal to attack speed for all enemies. Basically on timer end do actions for each enemy (this is important otherwise just one enemy does the damage). Keep track of who has a timer initiated with a boolean. Stop them once enemy is out of range.

    I recommend clicking between the two squares to the left to move the player there. Every 15 seconds they attack simultaneously and player HP should drop by 5+3=8.

    https://www.dropbox.com/s/etpdvfta51ck9 ... .capx?dl=1

  • Can you attach a capx file of what you did so far? It would help as I think there is possibly more than one reason why this is not working and all of them need to be fixed. And I can only guess what those issues might be.

  • Use a function (add a function object), set the triggering event to call the function "sfx" (you can name it what you wish) with whatever parameters you wish as an action. Also pass "sound file" (or some other kind of flag) as parameter 0. Once you get comfortable with using functions you can experiment with multiple parameters.

    On function call "sfx":

    Define/add a local variable for "sound file" under the function "sfx" called event.

    Set "sound file" to function.param(0) (this will retreive parameter 0)

    Next do subevents under the function called condition:

    on "sound file"=whatever

    play sound applicable to whatever

  • Set the Cam shake to: clamp(190/distance(Char.X,Char.Y,Object.X,Object.Y),5,1) shouId work I guess. You need to divide the shake factor at distance 1 (190) by the distance. When in doubt, check the math in excel.

  • Use multiple sprites for each part and build the bike out of them, that is the easiest and less time-consuming way. Some mods that do not come with the first/basic version of the bike, like say the lights, can be turned invisible by default when not bought. Then you have one of two options, you either use frames for each mod type (say for every type of light) and set the sprite animation speed to 0 so that you just pick the frame with the currently used mod.

    Or you use separate animations if you want the mods to be animated, like banner flags or something. Then you just switch the animation of the "part" sprite to the one you need.

  • No problem, always happy to help obliterate more pixelated crates

  • Set object width to "object.width+4"

Pulstar's avatar

Pulstar

Member since 10 Jan, 2016

None one is following Pulstar yet!

Trophy Case

  • 8-Year Club
  • Email Verified

Progress

9/44
How to earn trophies