immortalx's Forum Posts

  • I made a little example:

    dl.dropboxusercontent.com/u/14855413/ex.capx

  • If there only a couple of such objects, you can position them off screen so that they cannot be accessed (clicked, trigger accidental collisions, etc) and then recalled and re-positioned by picking them with their UID. You can store their UIDs in a simple array for that.

    If there are dozens of them, so that hiding them will probably affect performance, you can do the following:

    Using a 2 dimensional array, you can store whichever properties you want for each one of them and when you want to "store" them away, destroy them. When you want to bring any of this objects back, create a new instance and pass it the stored properties.

    Note: Don't try to store their UIDs or IIDs with this method. UIDs are gone when you destroy the object and IIDs are shifted. Instead visualize in your head which "row" in the 2d array corresponds to which object.

  • I'm not sure I understand correctly. You want for example the sound fx and music play at different levels?

    If so, then keep the master volume at db 0 and don't use a slider for that.

    Instead, create 2 sliders that each one will control one of the 2 categories (fx or music). Whenever you trigger a new sound, pass the corresponding slider value into its "Volume" parameter.

    ex:

    Play "MyMusic" looping at volume Slidermusic.Value

    Play "MyFX" not looping at volume Sliderfx.Value

  • One way is to add a global variable and do a check.

    ex:

    Global number MyGroup5IsActive = 0

    Group "MyGroup5" is active ------> Set "MyGroup5IsActive" to 1

    Else -------> Set "MyGroup5IsActive" to 0

    This is for one group only, you'd have to add one variable and one check for each group. After you finished debugging just delete those variables and events.

  • Thanks man, it's no biggie as you said! I just thought maybe it was there and I was too blind to see it. Glad I'm not

  • Ah, now I see. I know hot to stretch a window, but I though you had found a proper method to move the event sheet on another monitor, while keeping the main window maximized in one monitor.

    If you have a Nvidia card I believe that the Nview application can force dialogue boxes into a specific display

  • Here's a way to do it by picking the nearest unit

    dl.dropboxusercontent.com/u/14855413/nearest.capx

    As jobel said though, it might be difficult to implement in game

  • You can use "Pick random instance" and be done, but I guess you'd want the unit closest to the tree to go and start cutting?

    If so, you can use "For each" loop which will pick every instance one by one and store the distance of each one to the tree in an array. Then choose the one with the lower value and sent it there. Note that depending on the number of instances it could slow down performance.

  • I noticed that the scale property (or is it a method?) of sprites isn't exposed in comparison operations. Is that by design? Because I think it would be useful in some situations. I'm sure I must be missing something but it would be nice to know what that is!

  • try this

    dl.dropboxusercontent.com/u/14855413/fishy.capx

    (copy and paste the link)

  • Sorry I didn't know you had a dual monitor setup.

    I have a dual setup too but how is it possible to have the layout and event sheet on different monitors? They are docked inside the main window!

  • Man, I'm dying to see that one finished. Every time you post an update I'm drooling!

  • The main window can only be split in 2 or have sheets/layouts take the entire window space, when all the bars are undocked.

    If you accidentally spitted it in half, just drag one of the two child windows into the other and it will take the full window space

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Thanks again jojoe

    I tried exactly what you said but as soon as I scale the layer, the position of the gizmo (which is on a layer with scale rate=0) becomes "relative".

    I'm trying to re-position it on the object every tick, but it only moves exactly on the object's origin when the background layer scale goes back to 1.

    I don't know how to explain it better and thanks again for your valuable help!

    EDIT: Attached a capx to better demonstrate what I mean

    dl.dropboxusercontent.com/u/14855413/ex1.capx

  • Thanks jojoe

    I tried scaling the gizmo down when i scale the layer up (and vice versa), like this:

    Set Layer 1 scale to LayerScale(1)+0.002

    Set Gizmo scale to LayerScale(1)-0.002

    but unfortunately it doesn't work as expected. It keeps scaling up with the layer, just with a slower rate.

    With this method though the position is maintained, so I don't need to do anything.

    The other method is to set the scale rate of the layer to zero (which solves the scaling problem), but messes up its position. In this case I can do as you said: keep track of the gizmo's X and Y and position it. The problem is that the 2 layers (one scaled the other not) seem to have different coordinates after scaling. I'm guessing I have to use CanvasToLayer or LayerToCanvas but I can't really grasp what's happening