randomly's Forum Posts

  • I'll look at how to do it and in case of not being able, subire example. How do I upload a picture so that you can see the example? Thank you

    This is actually quite off-topic, but anyways, let's get this thread solved...

    You can provide a .capx by doing this:

    • Open up your C2 project
    • Go to "file", "save as"
    • Choose "capx" as filetype
    • Save to whereever you like

    Next, you'll have to upload it to somewhere, where you can share it with us.

    Dropbox always works good.

    Then, you provide us with the link to the file.

    Make sure to tick "Do not automatically parse URLs" in the Options below tour topic post since you don't have enough rep points yet to post clickable URLs and the forum will shorten them if they are too long and you don't tick that option.

    ____________________________________

    How to provide an image:

    • Go to imgur.com
    • Upload your photo via "New post"
    • After it is done uploading, hover with the mouse over the image and choose "Share image"
    • Copy the BB Code
    • Paste it in your post without the "img" tags

    Again, make sure to tick the corresponding option under your post.

  • Take a look at this:

    https://www.scirra.com/forum/physics-gravity-direction_t66471

    (They try to simulate gravity with Physics: Apply Force towards [...])

    If that doesn't suit your needs, look at this great tutorial by sqiddster ;

    https://www.scirra.com/tutorials/273/how-to-make-a-gravity-based-platformer

  • Essentially, you have to put any of the system's rounding expressions that suits your needs in front of your value.

    Depending on your needs concerning the rounding, you would use one of the following:

    1) Rounds up

    ceil(value)[/code:29nwr85x]
    2) Rounds down
    [code:29nwr85x]floor(value)[/code:29nwr85x]
    3) Rounds following mathematics rules
    [code:29nwr85x]round(value)[/code:29nwr85x]
    
    Also refer to the manual, system expressions, [i]math[/i] section.
    https://www.scirra.com/manual/126/system-expressions
  • Take a look at this to see how to get to that option.

    http://i.imgur.com/jMdEqqL.png

  • We will need more info at this point since what you provided as info apparently wasn't sufficient to solve the problem...

    Could you provide us with your capx?

    If your project is too big, just reduce it to what's important for the pathfinding (and bullet).

  • You could also make the turret aiming server-sided.

    So that the server decides which turret aims at which turret. The server would then send each turrets TargetID to each player and they would then simpy "render" the view.

    Like that, the game would also be less vulnerable to be hacked.

    You could even go further and even make the turrets angles and everyting server-sided.

    This would solve the problems of players joining later since the client can update the number of players, turret angle etc. as often as he wants and can then send the data over to the players who then just have to "draw" the image.

    (And make their game decisions of course)

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Did you try to restrict the file chooser to .jpg ?

    (Via the "Show open dialog" and then adding ".jpg" to the restricted file extensions)

    I don't know any more solutions, you would probably have to ask a developer.

    It might be also possible (as I already mentioned) that you simply can't not show the other options since your app is (though it is wrapped in NW.js) still coded for browsers and is, therefore, restricted to browser's controls.

    Those may not include the possibility to open the gallery directly.

  • Could you explain your project or the use of your variable more detailed?

    I'm afraid I can't download the capx since I'm in a location with very bad and slow internet connection atm.

    Text is all I can up- or download...

  • Well with the instance variable and the palyer ID, you have basically all precomponents for a filter. :)

    You still need the EnemyTurret and the - let's call him - PlayerTurret- sprites.

    The sprites all look the same, but for every player, the own player is the PlayerTurret and the enemies are EnemyTurrets (yes, all the same).

    The way you can differentiate the different EnemyTurrets is by their instance var "PlayerID".

    You can target a specific enemy turret by putting a "Pick by comparison" condition before the target selection.

    This would look like this:

    Pick "EnemyTurret" by comparison: [whatever player id turret you want to target] =equal to= EnemyTurret.PlayerID
          PlayerTurret: Set EnemyTurret as target[/code:2vpc3rk0]
    
    What happens here is the following:
    [ul]
    	[li]the "pick" condition has the consequence that the PlayerTurret only sets the EnemyTurret as a target who has the PlayerID you specify in the "pick" comparison[/li]
    	[li]having two different sprites (which are essentially the same, but have different names and are no instances of the same object) will prevent the picking condition to exclude the PlayerTurret, so it can still target the enemy.[/li]
    [/ul]
    Now you just need the PlayerID of the turret you want to target. That's it.
    
    Hope I could help. :)
  • I'll just assume that you aren't talking about 10 instances of one Sprite but about 10 truly different sprites.

    It'd be easier if you had only one Sprite and 10 instances of that. But I don't know what your project is like so I'll just go with 10 different sprites.

    Check my capx: https://www.dropbox.com/s/yzv62sremd7vv7i/CollisionFamily.capx?dl=1

    (Just drag and drop every Sprite you want except the Blue Main Sprite)

    _____________________________

    EDIT: To answer you original question "How to select a group of Sprites from a family?":

    Just put an event or a condition before the actions to filter the Sprites you want to apply the action to.

    Every Sprite for which the conditions are true gets selected and the following actions are only applied to those Sprites.

  • Could you post a screenshot of the Error when it says "layer locked"?

    I don't think I ever saw that Error before.

    Now to your second issue: How exactly did you "attach" the sprite to the background?

    And if you would tell me what you want to create, I can give you a step-by-step instruction. :)

  • Arashee

    look at this:

    https://www.dropbox.com/s/5fmehbqavy23p3d/RedBalls.capx?dl=1

    Created a little capx for you.

  • If the Bullet behaviour serves only the purpose of following the player, you could replace it by

    Enemy: Set Angle to "angle(Self.X,Self.Y,Player.X,Player.Y)
    Enemy: Move Forward X pixels[/code:3bqx5zic]
  • Hey man,

    I'd appreciate if you explained your project/implementation of Bullet/Pathfinding first.

    Because I can't really imagine many occasions where you would have an object with both behaviours.

    Either you have Bullet OR Pathfinding, but I don't know why you would use both, because they ARE indeed conflicting.

    Both behaviours control the object's movement in some way.

    The Bullet behaviour applies some Physics to the object which influences its x and y coordinates.

    The Pathfinding behaviour searches for a path and makes the object move towards it which influences its x and y coordinates.

    As said, you shouldn't use both behaviours.

    Please explain your project to us so we can understand why both behaviours might be necessary.

  • Hey man,

    I see what you're up to.

    I modified your capx and corrected your initial event sheet.

    I also added another event sheet, called "Improved" which includes a function. Functions make your life way easier and this event sheet is also more compact than your initial one. I added several comments, I hope I can help you. :)

    (Switch between the Event Sheets by clicking your Layout and then choosing the Event Sheet on the left)

    If you have questions, don't hesitate to ask.

    Download: https://www.dropbox.com/s/yvefkfwpm5mnk25/test.capx?dl=1

    Btw, you can add as many instances of Sprite2 and change their values to whatever you prefer, my improved version will still work. ;)

    (I changed the movement, you now control the Blue Sprite via Drag & Drop)