Soulmachine's Recent Forum Activity

  • If I set a Local Variable in an Event and then Call a Function ( jump to a function )

    is the Local Variable lost - for the next coming actions.

    Like... if I have an Event..

    Sets a Local Variable

    then in my actions I have like. Call Function"...."

    And next action Set "something" to "LocalVariable"

    Did the local variable got lost when Construct performed the FunctionCall ?

    I mean Construct jumped to another "location" in the code and back again - and I have a situation where I feel this phenomenon happened to me.

  • I was told there are more WebRTC apps running on iOS than there are running on Android? And I was wondering if anyone has info about when it may be available for the Chrome or Safari web browser?

    Is there a way to make a Construct 2 game that has multiplayer ( using WebRTC ) - that would work on the iOS? Or is it very complicated?

    I believe iOS ( an iPhone ) uses apps.. or wants to use apps, instead of using a web browser as a middle ware. And there's lots of self-sustaining apps out there using WebRTC? But there's not support in Chrome or Safari for WebRTC? This is perhaps because browser support isn't irrelevant for many vendors creating apps.

    *btw I'm an iPhone newbie, just got my first one.

  • Me too got a bit disappointed that iOS didn't support WebRTC

    Here's an interesting article about the subject: https://bloggeek.me/iphone-webrtc-smartphone/

    It looks like different vendors use WebRTC on iOS platforms anyway, despite it's not supported?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • hmm...

    Perhaps you could try using different states of your car.

    Like "impact" and "pushback" or something.

    So when the car first hits the forcefield you set the state "impact" and do the stuff that you want to happen with the car. Then when that stuff is finished, you set to next state "pushback" and you do that stuff you want to happen there.

    You could also try the Timer behaviour.

    Like when the car hits your forcefield, a timer starts, and after a certain amount of time you can trigger a "pushback"

    Try to use Apply physics force towards position, or towards angle, when you want to affect your car to move in certain directions. You could also try Apply impulse to see if that gets you a better result.

  • Yes Containers in Construct is the thing you need.

    Lets say you create 3 people. And every "person" have lets say. A head, body and legs. 3 things.

    If you start making a sprite representing the head, and call that one "Person".

    Then create another sprite representing a body, and call it "Body".

    And after that you create yet another sprite representing legs, and call it "Legs"

    If you go to, or select your Person-sprite ( the head ) and go to containers in the Properties ( to the left ) ... And click Add object. Just add your Body and Legs there.

    Now the Head, body and Legs are in a container.

    If you later need to select one Person. You use the "Pick by comparison" - event

    There you choose the Person-sprite ( the Head ) - and after that you have an expression... Lets say ( Person.index = person01 ). This way Construct picks the Person.sprite that has person01 in it's instance variable: Person.index

    Then what you later decide to do with that object applies to ALL the sprites in that container. The Head, Body and Legs. So if you want to destroy the "Person" - choosing Destroy Person also destroys the body and legs. It's the same if you want to create a Person. The body and Legs will also be created.

    If you position the person though... the body and legs wont automatically also position them selves correctly. For that you have to preferably use the Pin to behaviour. If you have pinned the Body and Legs to the head and later position the head somewhere, the Body and Legs will follow. The same works if you rotate the head. I do not know about scaling. But at least if you choose the Person object in an event and in the actions you for example use Person - Set scale and below that Body - Set scale and then Legs - Set scale. ...The correct Head, body and legs will be scaled.

    So think like this.

    Have an unique identification for each people. Like Person01, Person02 ... and so on. In an instance variable. Do it when the sprite gets created.

    Use one sprite that controls all the other body parts.. lets say the Head of the person. And put all the other body parts in the heads container.

    When you pick the Head.sprite - ALL the other body sprites also gets picked.

    Try experiment with this in a totally fresh project and I'm sure you will quickly learn how it works. A tip is to position the head and the body parts as you want them to fit together when you're in constructs layout. Because when you create a new object, construct will create the head, and then position the other objects in the container the way you have positioned them in the Constructs layout. If you directly after you created your Head ALSO pin all the body parts to it - then when you position your head all the body parts will also get positioned.

    I hope you get it to work.

  • Can you explain a little more what you want. I did not quite understand what you are looking for?

  • I understand. Thanks

    I was wondering. Is it best practise to disable physics if you have to move an object (Position it) - that has the physics behaviour assigned to it?

  • Ok. I'll consider disabling it to see what happens. It may be easier and to avoid "strange" behaviours.

    Physics are a bit unpredictable and I have issues and "strange" behaviours sometimes. And it only happens after I've moved the object. The performance are no problems though.

    I need things from the object, instance variables, position and such, so I cant destroy it without big problems.

  • I'll explain more.

    I have a player that throws an object. And I'm using physics.

    When the object hits a wall - it instantly has to stop. Like if you throw a knife into a wooden wall. The same has to happen when the object hits another player.

    To achieve this, I set the objects velocity and angular velocity to 0 when it collides with a wall/ground or another player.

    After this has happened - it's the other players turn to throw. So I reposition the object to the another player.

    I do not want to destroy my object, just reposition it after it has "landed/hit something"

    I'm doing a multiplayer game, so it's a bit complicated to do some things, that normally would be much easier if it just were single player.

  • Which is best. To set Physics Velocity X,Y to 0 or to disable Physics... If you want to move an object. For example the player has to spawn in a new position.

    I have an object that after it has landed, I need to respawn it ( move the object ) to another location. At the moment I set Velocity to 0 and Angular velocity also to 0. After that I position my object to the new location. ... I forgot.. I also set the World.Gravity to 0 before I move my object.

    Is it better to just disable Physics while I reposition my object you think?

  • Hello.

    I need tips and suggestions setting up the Stepping iterations and Stepping mode in Physics. I think they may be responsible for some small lags in my game.

    I get a small lag with the physics ( i think it's the physics ) in my game and I wonder why that is, and if I can do anything about it?

    In my game, I have a player that throw an object - applying a force in a direction. Also applying physics angular velocity so the object rotates. It works very good... The object gets thrown and rotates in air, as I want. But sometimes when the object are in air, I get some kind of flickering lag. You know... it feels like flickering, like when you play a game and the screen cant keep up with the framerate. But also the object can slightly lag ( freeze ) for a very short while, and then "jump" a short distance - as if the object are synchronizing something?

    However the game works pretty nicely with the performance - but I was wondering if I can fix this small problem?

    When I'm testing at my computer in Firefox. I have 60fps most of the time. Sometimes it can drop down to 45-50, but only for very short moments.

    This is a multiplayer game and I only have one single object with physics in the game. The players take turns throwing it.

    I haven't change any default settings for the physics: Stepping iterations and Stepping mode. So I think they are set to standard as you can find in the manual for the Physics behavior.

    I would be very happy if anyone with experience with these values could give some pointers what they feel works best - performance wise.

  • The only way I manage to do it - is to solely have the actions in the Host group. But then it kind of lags for the peer :/

Soulmachine's avatar

Soulmachine

Member since 27 Oct, 2013

None one is following Soulmachine yet!

Connect with Soulmachine

Trophy Case

  • 11-Year Club
  • RTFM Read the fabulous manual
  • Email Verified

Progress

13/44
How to earn trophies