randomly's Forum Posts

  • Let me give you an example why this doesn't work.

    Let's go event by event.

    • You start with ActiveCharacter=1 and ActiveScreen=2
    • You press left on the Gamepad
    • Line 6 triggers and sets ActiveCharacter to 2
    • In the same tick, the event in line 9 triggers since ActiveCharacter is now 2 and sets it back to 1

    To you, this looks like nothing happened.

    The mouse events work since there can only be one mouse event happening at the same time.

    What you need to do, is replace ActiveCharacter=2 in line 8 with "Else".

  • Awesome graphic style.

    I guess that's pre-rendered Sprites right?

  • [quote:3pclflqo]On the debugger, I can see the "spawn" variable changing exactly as I wanted to, but the sprite never appear. Any idea what I did wrong ?

    Try this:

    • Add a family containing all the sprites, e.g."Sprites"
    • Add a family instance variable, e.g. "index"
    • Edit that variable for every Sprite and set it to the Sprite's number (don't set it in the event sheet, set it in the object properties)
    • Delete that long chain of conditions you referred to (Spawn=X, Spawn=Y,...) and replace it by this:

    ____________________________________________________________

    [quote:3pclflqo]I know I will be working with exactly 18 players, so I want to have exactly 6 in each room, but it has to be random.

    [quote:3pclflqo]I found a way to lead players to different chatrooms, but I am not satisfied since I have no way to keep balance between the different rooms.

    In your .capx, I can't find the way you are managing the different chatrooms...

    The way I would go about this, is the following:

    • since the Multiplayer-plugin included rooms can't communicate between each other, we need to have multiple game rooms in one actual multiplayer room
    • To assign peers to different rooms on joining, I'd use a global variable storing the room number you are in and using that variable to differentiate between messages that come from the host (to determine whether that message is important to you).

    I'd also use three dictionaries, one for each room, to determine how many people there are in one room and whether it is full or not.

    Those dictionaries are used by the host. When a peer joins, the host will go through the dictionaries one by one. As soon as one room is found where the dictionary's keycount is below 6, it will send the room number to the peer and add the peer to the dictionary. Randomness should be easy to add here.

    ________________________________________________________________

    [quote:3pclflqo]I want the "creatures" (presently represented with big numbers from 1 to 30) to appear in a random order and appear only once.

    I'd recommend you using blackhornet 's Smart Random plugin which allows you to get a random value out of a set amount of numbers while assuring that a set amount of numbers doesn't appear multiple times.

    _________________________________________________________________

    [quote:3pclflqo]A new one should appear every time the timer reaches 0. Here, I can't even make them appear at all and I don't understand why.

    I'd recommend giving the "creature distribution" task to the host only.

    The host would either have a "Every X seconds" or a "timer" behavior.

    (If you use the timer, broadcast the random value under the "On timer" event. Immediately after that, start a new timer)

    Try to transfer this task to the host only and see whether that fixes the issue, we will deal with that later if the problem remains.

    __________________________________________________________________

    [quote:3pclflqo]I still have no idea at all for how to compare what players wrote in the "answer" textbox and give them point for every other player that gave the same answer.

    Again, the best solution is to give those tasks to the host.

    Answer textbox:

    When a peer submits the content of the "answer" textbox, it will send it to the host. The host will store that in a dictionary, one for each room, or a single array.

    When the host receives an answer, he will check whether that answer already exists in the appropriate dictionary/array coordinate. If it does, it will add one to the value (dictionary) or the array's Z/Y value (array).

    If it doesn't exist yet, the host will add a new key (dict) or a new Y value (array).

    (In the array, the X value will be the room.)

    Note: dictionaries for this will be easier to handle, while an array will be more compact.

    Points for players:

    This will be a combination of host-/peer-sided to improve performance on the host.

    The host will use the same dictionaries /array as mentioned above.

    (But since points are room-independent, we don't need to compare the room variables here)

    Depending on whether you want the points to be given immediately after one creature round is over or after the whole game is over, there are different approaches.

    Immediately:

    When the peer submits an answer, he will save what he submitted in a variable to be able to send that to the host at the end of the creature round.

    When the round is over, he will send that value to the host.

    The host then checks with his dictionaries/array and see whether (and how many times) that answer has been given and send the appropriate amount of points to the peer that sent the answer.

    At the end:

    The peer will store all his answers in a dictionary, sorted historically.

    When the game is over, the peer will send his dictionary (as JSON) to the host. The host will have a dictionary for each peer which he loads from the JSON he just received.

    he will then go through his dictionaries/array and see how many times each item in the dictionary has been given before and give points.

    Note: since it's probably very unlikely that the same name will appear multiple times across different creatures, we can compare all the dictionaries/the whole array without differentiating between rounds.

    ______________________________________________________________

    [quote:3pclflqo]tell me if you think this seems possible

    Not a casual task, but yes, it is possible.

    Though I'd recommend you exporting the project to NW.js later since all that comparing on the host-side will take up some CPU and NW.js can use more CPU power than a browser tab.

    (Assuming, you don't use necessarily use high-end PCs only for that project)

    _____________________________________________________________

    [quote:3pclflqo]what tutorial I should read

    That depends on what topics you think you need help with. I won't put out links for every single object/behavior that will be used in this project, since that would be quite an amount.

    And since your project is a very specific, non-generic one, there won't be a tutorial tailored to your project.

    If you don't feel sure about a specific element in your project (e.g. arrays or dictionaries), just search for a tutorial for that or ask here or in the forum.

    ___________________________________________________________________

    ___________________________________________________________________

    That should be about it.

    *phew*

    PS: Don't think I am a C2 expert. I started using C2 in September this year, so I am in no way worth saying that I know everything about it. I just provide what I think is the best option.

    I am sure there are better ways to do this (that I don't know of), but this is the way I would do it.

  • Well, the image you uploaded shows no black bar inside the actual frame (the grey bounding box).

    That means that what causes the black bar, is that your project's width and height don't match with the browser rendering window.

    Could you try exporting to NW.js (all three checkboxes unchecked) and tell me what you see?

  • rexrainbow tried using userid2id.

    Works like a charm except that I can't seem to actually change an ID.

    I figured I can set as many ID's as I want but as soon as I want to set an ID with a UserID that is already bound to an ID. (The one I want to change)

    It triggers "On request ID failed".

    To have an effective username system, I would need to

    • Trigger success when trying to set an ID that is bound to my UserID
    • Trigger error when trying to set an ID that is already bound to a different UserID

    (Or is it just me being too dumb to use your awesome plugin? O_o)

    Thank you for your help.

    EDIT: any way to delete a ID would resolve that issue too.

  • Goddamnit, I'm too late.

    Anyways, if anybody wants a non-plugin variant...purely C2 code...

    here's my capx...

    Download

  • i need to replace the letters with sprites

    Alright, to do that, you need to do the following:

    • Insert your sprites
    • Add all sprites that contain money to a family, e.g. "money"
    • Give the family an instance variable, e.g. "value" and the "Drag & Drop" behavior
    • Replace "int(money.Text)" by "money.value"
    • Obviously replace the "money" family in my .capx with the new family
  • Alright, with 2, I still don't know what you want. I asked you whether you want this or that and you answered with *yes*...

    Alright, with 3, you can simply add a layer, call it "popup" for example. It contains whatever you want in your popup.

    Now, you set the layers initial visibility to "invisible" and set it to "visible" whenever you want the popup to appear.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • no, your link isn't work again =(

    Updated the link again. Dropbox seems to change the shared links without my knowledge..

    ___

    About the PHP stuff: I have no knowledge whatsoever concerning PHP.

    And I won't start learning it now, sorry.

    I think, it will be better if you start a new thread with the messaging layout you got and focus that thread on PHP, so other users who actually know PHP can help you.

  • Hey everyone, got a pretty severe issue with Java here.

    Recently, Java told me that an update was ready, so I installed that. The installation failed with the error code 1603 and my AV program giving me a positive at the same time.

    From that point on, Construct 2 stopped recognizing Java.

    It gives me this screen when trying to minify a script.

    (And yes, I have the 64-bit version installed)

    So I googled the crap out of the internet and tried to find a way to solve this.

    What I did until now:

    • Tried to reinstall Java (8u111 64bit gives 1603 error on install, 8u112 64bit installs fine, but C2 doesn't recognize it
    • Cleaned Java install with Java's tool, reinstalled
    • rebooted after every step
    • relaunched C2 after every step
    • went through everything google's proposals asked me to do

    None of that worked.

    Now the Java site tells me that I have Java 8+ installed, like C2 requires it.

    Anyways, the 8u111 installation still gives me an error 1603.

    (Sorry for German UI, added some translated text)

    I know that this isn't a Java problem resolving forum, but I clearly have Java 8+ installed and it's 64-bit.

    Anybody knows why I still get this error when trying to minify?

  • Depending on what you need to do, you could work with the parsing options that C2's system expressions give.

    Like left, right or mid, combined with "&".

    Now I'm not familiar with javascript, so I won't be able to create a plugin, but if you tell me how you want your numbers to be formatted, I can setup a way by using the above mentioned expressions.

  • You do not have permission to view this post

  • Well, the version that I use is a beta version.

    No idea how that works with Steam.

    Either you'll have to download the beta via Steam or download the beta from the Official Download Page.

  • Here you go:

    Download .capx

    I commented the .capx. If you have any further questions, don't hesitate to ask.

  • 1. I don't know how you set up your countdown, but the most sensible way would be to make the event like this:

    Set X to clamp(X-1,0,infinity)[/code:2kbmcm0c]
    The clamp will prevent the value from going below 0.
    
    2. Not really sure what you mean here.
    Do you want an animation for the text to show up? Like with the "fade" behavior?
    Or do you want the numbers to count up to a final value?
    
    3. Again, I don't really know what you mean...
    Do you want a popup that shows up when pressing a button, and that popup containing another button or text?