Ciao121's Forum Posts

  • I read with ajax a .txt file containing (i.e):

    Server A|192.168.0.1|Server B|192.168.0.1

    with tokenat i populate the dropdown menu.

    So I have a dropdown like

    |--- Server A

    |--- Server B

    I would like to have

    |--- Server A (VALUE 192.168.0.1)

    |--- Server B (VALUE 192.168.0.1)

    The user select the Server and connect to the associated ip address in value

    Anyway I'have found a workoaround. The Ajax is still populated so I use:

    tokenat(AJAX.LastData,(ServerList.SelectedIndex*2)-1,"|")
    [/code:6cn4klkf]to get the ip  associated to the selected server
  • In html I can make a dropdown like this:

    <form action="myaction">
      <select name="cars">
        <option value="volvo">Volvo XC90</option>
        <option value="saab">Saab 95</option>
      </select>
      <input type="submit" value="Submit">
    </form>[/code:3b3j56rn]
    
    In construct 2 it seems to me that I only have a text for the option.... something like:
    [code:3b3j56rn]
    <option>Volvo XC90</option>
    [/code:3b3j56rn]
    and I can't find a way to show text and send a different value.
    Is this missing?
    Tank you!
  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Ops.... "Is downloading update" and "On update ready" are no more available.

    https://www.scirra.com/construct2/releases/r235

    So I read the new way to update game. Anyway.. suggestions for my question are welcome <img src="{SMILIES_PATH}/icon_e_smile.gif" alt=":)" title="Smile">

  • Hi,

    in a game I'm trying to develop the first screen has a nickname field, a server selection dropdown and a start game button.

    The start game button is only enabled when the nickname is inserted and a server has been selected.

    I'd like to enable it only when the game is the last version so I'm sure all players are using the same game version.

    Reading the manual I see two states: "Is downloading update" and "On update ready". Maybe I could use "if NOT is downloading update" to enable the button. But I'm not sure it will always fire. Will the browser start uploading the update before the first layout is showed (so I can rely on this)?

    Any other way/suggestion?

    Thank you!

  • Probably this is the problem... from the manual: "Therefore, nothing can be displayed on top of a form control, apart from other form controls."

    So maybe I have to use a sprite. Anyway if anyone have a different solution... is welcome

  • Hi,

    I have a problem with the progress bar object.

    I make a progress bar on level 0, than I add a new layer on top (let's call it layer 1).

    I add a black rectangle on layer 1; the rectangle partially is over the progress bar. But the full progress bar appears on top of the rectangle.

    I need to have only the progress bar part that is not covered by the rectangle to be visible. How can I solve it?

    I made a capx: https://www.dropbox.com/s/hmqxmkpm09n7b ... .capx?dl=0

    Thank you!

  • I'm using the scirra own websocket plugin now.

    Thanks!

  • Cover a layer with sprite blocks, set the visibility of any that come within 300 pixels or so of the player to invisible. Leave them that way.

    How to set the visbility area/range?

    Thank you!

  • I'm trying the server side approach (just the first part in wich the server send each turret a targetID).

    It's workin in a 2 player game (player/enemy). I use:

    [ul]	[li]pick turred by turretID[/li]
    	[li]pick enemyTurret by enemyturretID[/li]
    	[li]turret add target enemyturretID.[/code:3dganqr1][/li]
    [/ul]
    The problem when it comes a third player. He saw all other's turrets as enemy turret. I can't use:
    [code:3dganqr1]
    [ul]
    	[li]pick enemyTurret by enemyturretID   <------[/li]
    	[li]pick enemyTurret by enemyturretID   <------[/li]
    	[li]enemyTurret add target enemyturretID.[/code:3dganqr1][/li]
    [/ul]
    I think because the the econd enemyTurret pick "overWrites" the first one. I think I should find a way to do something like
    
    [code:3dganqr1]
    [ul]
    	[li]pick enemyTurret by enemyturretID   AS A[/li]
    	[li]pick enemyTurret by enemyturretID   AS B[/li]
    	[li]A add target B.[/code:3dganqr1][/li]
    [/ul]
    Making all server side as you suggest in the second part of your answer could be a solution. But in this way I will not use the turret behavior at all.
    Maybe it's also better... I'm thinking about it.
  • I started using this tutorial: https://www.scirra.com/tutorials/4997/r ... oard-basic

    But probably randomly is right. I don't need all those sprites.

    I'm trying a totally different approach.

  • You are absolutely right. Diep.io is really a good game and (for a newbie like me ) is really hard to do something better.

    In fact I abandoned this project. This has been really useful to learn.

    Now I'm tryiing to make something completely different.

  • Hi,

    I have a grid of 99X95 tiles. Total tiles is 9.405.

    I have an event like

    If cursor is over Tile -> So something[/code:cb2pnowd]
    This cause 9.405 collisions check per tick. Maybe this is normal, but does anybody know a better way?
    
    Thank you.
  • Thank you for your aswer.

    Anyway I had more problems using the turret behavior.

    It should work if every player joins before the game starts. But if a player joins after others players it's a little more complicated. Because I send all existing turrets from the server to the new player so the client can create those. But I have to send the all turrets in the same order those were created. Because (I think) if there are two targets at the same distance, the turret acquire the first created one. And if I do not send turrets in the same order those were created, in a client the target can be different from anothe client.

    Also my clients create objects at runtime that are not created on others clients. So uid and targetuid can differ from client to client (i.e. because while a new client creates turrets that it receives from the server it can create another object on the fly addng +1 to the next turret uid).

    All those poblems surely have solutions. Anyway it's little too bit complicated.

    I have found a workaround in this topic:

    It's not using the turret behavior but storing custom turret IDs and target IDs client and server side makes clients be synced.

    Thanks again

  • Hi,

    I'm trying to make a multiplayer game. BTW I'm not using the multiplayer object. I'm using websocket.

    Each player can create turrets. When a turret is created it should get another turret as target.

    If I try to use a single sprite object for everyone 's turret (they look identical but I can use a simple text to see who "owns" a turret) and the event:

    Turret -> Add Target -> Turret[/code:1esy9ver]
    Turret does not make difference from "my" turret and "enemy" turret (also the turret will self target).
    
    I can solve this by using two sprites objects; let say my turrets use the sprite "Turret" and enemy's turrets use the sprite "Enemy_turret".
    So I can do:
    [code:1esy9ver]
    Turret -> Add Target -> Enemy_turret
    Enemy_turret -> Add Target -> Turret
    [/code:1esy9ver]
    
    In this way my turrets should only target Enemy's Turrets and viceversa.
    
    But what if I want to have an undeterminated number (or a max of 5) of players?
    Should I clone all those sprites, events and condition? Is there (I think surely there is) a better way to do it?
    
    BTW I have an instance var in each turret with the player ID. But I can't find a way to use this as filter.
    Thank you!!!
  • Thank you plinkie! Very good sooooolution!

    badmoodtaylor, your solution is also good. To switch debug of/on at runtime.