briggybros's Forum Posts

  • I would be inclined to say yes. Given C2's browser object there is an option to execute JS code (It is noted that the Javascript SDK should be used if possible). This can either be used as a void method or to return a string or number.

    To check if a button has been pressed on the page, you can store when the button has been pressed on the page using JS in the page's html. While also checking this value from C2 every tick, and if true, set to false. This seems like it should work, but I've never tried.

    To update a text field you can again use the execute JS action, manipulating the page as if you were writing inline JS.

    Please note I've never tried to do this myself so I do not know if it will work.

  • Add a global variable called 'level' or something, whenever the user moves between levels update the value appropriately. Whenever the map is opened, move the player to the level stored in the 'level' variable.

  • I'm making a multiplayer car game, so when each user connects, a car spawns for them. This is a sprite with the car behaviour. However, only the host can move properly. All connected peers can move slightly before the host then resets them. This must be because the host is not receiving, or not processing the client input state, correct? I can't figure out where it is going wrong.

    I have this in my peer group:

    This is my start of layout event and actions:

    This is how the host handles the client input state:

    And this is how the peers car is created:

    What is wrong here, what am I missing?

  • thankyou!

  • Is there a method to get the version string entered in the project properties in the event sheet?

  • Hello, I'm just curious if there is a method in Construct which allows me to change a sprite's image. I know I can load one from a URL and I will use that if it's necessary. I am looking to generate the sprite's image at runtime, or at least on load.

  • Glad I could help

  • You can do this in the way you would do anything in multiplayer, Assign and sync the object. For host just do direct input and for client use the input client input state method. See here: https://www.scirra.com/tutorials/915/mu ... ame/page-4 and the rest of the tutorial. (Assuming you've read MP 1, 2 and 3 before)

  • What are the events you are using?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I'm pretty sure that doesn't make sense in English.

  • I'm not sure what environment you are running the project, so my help can be limited. I also do not know what your php code is.

    If this is a phone app, which I am assuming it to be. I believe SnapshotURL gives the location of the snapshot on the phone's file system, e.g. /internalstorage/yourapp/snapshots or whatever. Then if your php script gets this data what is it to do? I doesn't actually have the file you're telling it, only its path on the phone it was taken on. I do not know if Construct has a proper upload feature, but what you could possibly do it retrieve the data from the snapshot, the actual 1's and 0's in a reconstructible format, an image raster. Then you can get this data and post it to your php page for the php to then reconstruct the data from the raster and display the image.

    I'm no expert in this area so this could all be completely wrong, but I hope it helps.

  • If the object you want to rotate uses car motion, the behaviour has the expression VectorX and VectorY, which give the movement of the object in each of these axis i.e. it splits the current movement into its perpendicular components. The angle of movement can then be calculated. Taking 0 degrees as the positive x axis, the direction of movement equals:

    if x > 0 & y > 0 :

    a = arctan(VecX/VecY)

    if x < 0 & y > 0 :

    a = 180 + arctan(VecX/VecY)

    if x < 0 & y < 0 :

    a = 180 + arctan(VecX/VecY)

    if x > 0 & y < 0 :

    a = 360 + arctan(VecX/VecY)

    There may not be VectorX and VectorY values for other behavious. You could calculate them basically by storing the last position of the object and comparing it with the new version and finding the difference in x and y. This method may make the rotation rough so you may have to use some interpolation methods to make it smoother.

  • Nobody?

  • You're welcome!

  • To summarise the capx attached the alert.txt file has the contents:

    1|This is your first alert
    {id}|{alert}[/code:2u0ozydp]
    Using the first example, this is what will be returned. However, using the attached example only:
    [code:2u0ozydp]This is your first alert[/code:2u0ozydp]
    will be returned and will only be returned once. This is because the id of the alert has been stored.