troublesum's Recent Forum Activity

  • sorry about that.. try it again

  • RexMundane - For that you need to work with and understand containers and picking instances. I updated the example for you. I think from the example it will cover the basics. The Person Sprite has a container that has the Dialog Dictionary and the DialogBox has a container that contains the text box and button. When you pick the Person it also picks the dictionary and when you create or destroy the dialog box it also creates or destroys the text and button... Good luck.

    [attachment=0:cm5uqnwb][/attachment:cm5uqnwb]

    [attachment=1:cm5uqnwb][/attachment:cm5uqnwb]

  • RexMundane - No worries I created an example for you... Sorry if it seams over complicated but as a developer I'm usually pretty thorough in code layout.. It does require some understanding but I think it will make sense once you see it working and can go over the code. Hopefully this helps.

    [attachment=2:u9gylaq3][/attachment:u9gylaq3]

    [attachment=0:u9gylaq3][/attachment:u9gylaq3]

    [attachment=1:u9gylaq3][/attachment:u9gylaq3]

    Edit: I made it easier and took out the processor part and its simply a triggered event now.

  • RexMundane - You want create a processor that executes thread chains of functions in a given order waiting for the previous one to finished before calling the next.

    The easiest method is as follows:

    First define variables

    • Create a stack of function names and store in an dictionary. (This will be your thread)
    • Create var functionIndex and set to -1 (Represents the next function to call)
    • Create var currentFunctionIndex and set to -1 (Represents the current function that was called)

    Now setup the processor

    • EveryTick if (functionIndex > -1) call Function from stack of that index (IE functionIndex = 0 call function name where dictionary index = 0)
    • Set currentFunctionIndex = functionIndex (to store for incremental purpose)
    • And then set functionIndex back to -1 so you stop calling functions

    Last is the control

    • When user presses a button (or some triggered event takes place) you take the currentFunctionIndex that was stored when the function was called and then set functionIndex to (currentFunctionIndex +1) so the next function will be called by the processor and so on
  • Love this game... I'm working on a scorched earth clone (physics shooter like gorillas) my self. Nice job!

  • skelooth - Sorry no I haven't put that in yet as my projects don't involve saving... but ill look at the API this week end and see whats involved... ill message you and let you know.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • skelooth - I made these a while back. I don't officially support them but they work and I use them in my project. Your welcome to give them a try.

    Plugins

    [attachment=2:2gpmif2e][/attachment:2gpmif2e]

    Example Capx

    [attachment=1:2gpmif2e][/attachment:2gpmif2e]

    Preview of usage

    [attachment=0:2gpmif2e][/attachment:2gpmif2e]

    Storage = 3D Object

    Table = 2D Object

    List = 1D Object (Basically the same as a dictionary)

    They function like a normal Array/Hash table would in most programming languages. They support merging/loading raw JSON to them which is what you looking for. I provided a few example capx files that i work on to test them when i make an update to them. They should explain how to use it. Hopefully this helps

  • While I don't see a kick option for the Host to act with you could just send a message to a peer that they then will call a function on their side to leave the room or disconnect them selves. The Host will need a loop to verify and resend if peer is still in room after x amount of time.

  • imothep85 google is one of the few sites that does not allow its self to be run from iframe. You should pick another site for testing.

  • NicholasMDS Oh boy... that SQL statement needs a lot of work.

    To start you need to specify table name to select values from.

    This will select all rows from table "names" and order them by Id

    $sql="SELECT * FROM names ORDER BY id";
    $results=mysql_query($sql);
    [/code:jtioblbm]
    
    But then how you use $results is also wrong. $results is a SQL object return by the statement. To get results from the SQL object you need to 
    [code:jtioblbm]
    $output = array();
    while($row = mysql_fetch_array($results, MYSQL_ASSOC)){
         $output[] = $row;
    }
    [/code:jtioblbm]
    
    $output is now an array representing the data from the table names. What you do with the data now is up to you. I don't really see what your trying to accomplish with this though?
  • NicholasMDS Its strange that you are getting "<br/>". That means your PHP file that the Ajax request is accessing is returning HTML as well? I can't really help you on where that HTML coming from. Check your file or create a new one. If you willing to attach your PHP file i can take a look at it.

    Secondly that SQL looks does wrong. You have "SELECT * FROM nameIsOk" but you made it sound like "nameIsOk" is a column in the table. Is that also the table name as well? If not then there is one problem and if so I would recommend changing the table or column name so they dont match. Everything should still work but it will be less confusing.

    Do you self a favor and don't store the AJAX.Lastdata in a global number variable. If the AJAX.Lastdata ends up being string because it failed you will get the NaN (Not a Number) value. Just store it a as a string and work with it like that. As you PHP and C2 skills get better you should look into sending and recieving data as JSON (dont worry about that now but it will be useful to learn later).

  • I gave an answer to this a while back for someone else. Maybe it will help you...

    https://www.scirra.com/forum/viewtopic.php?f=147&t=111694&p=813850#p813850

troublesum's avatar

troublesum

Member since 4 Dec, 2013

Twitter
troublesum has 2 followers

Trophy Case

  • 11-Year Club
  • Email Verified

Progress

12/44
How to earn trophies