randomly's Forum Posts

  • [quote:lhazvrjb]When host get an "answer" message from peer, he adds a key "CreatureCount//Multiplayer.message" with value "1". Or add +1 to the value if the key already exists.

    Yep, that would be a good way to go.

    But remember to add a "lowercase()" around the answer since not every person does capitalization the same. ;)

    (If you didn't add this, same answers with different capital letters would be recognized as "different". Adding "lowercase()" basically makes the comparing process case insensitive)

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I'm not 100% sure, but I think that this is already the way it works.

    When the host leaves the room, a different player becomes the host.

    Either this is the case or there is no way to change the host, since there isn't any action that does this.

    So if it doesn't happen automatically (which I assume), there is no way to do it (yet?).

  • I have no experience with Intel XDK, but you could try to replace the space between Alfa and Romeo with a dash or something else.

    Some programs don't handle spaces in filenames very well...

  • Yep, they got removed in r235.

    They were added again in the current beta, r240.

    So if you really need those conditions/events, go ahead and download the beta.

  • rexrainbow Thanks.

    db3344 ChesVCF Look at rex's .capx's, they are more compact and helpful.

  • This fixes it:

    _______

    _______

    I also found two bugs:

    • The nano animation doesn't trigger anymore after it has been done twice in a row (probably an issue with the "nano"-variables
    • The reversed "nano" animation is triggered multiple times when "nanocontrol" >= 5 (I fixed this with the "trigger once" in the image
  • Actually, I'd go with rexrainbow 's firebase plugin.

    It's really awesome.

    It provides an actual account system where you can register with your e-mail address, get a proper username and connect that with a database.

    No need to learn SQL or anything.

    If you want, I can send you a .capx of how it works.

  • [quote:1qfanoxy]Pick sprite (currently a question mark picture) by instance variable = creature count => Replace with sprite of current creature

    Pick "answer" text (currently a question mark) by instance variable = creature count => Replace it with Answer.Text

    Pick "score" text (currently a question mark) by instance variable = creature count => Replace it with "HostAnswerList.get(Answer.Text)-1"

    [quote:1qfanoxy]Do you think I can do something along those lines ?

    Yup, that should work too. (I'm just too much of a fan of Dictionaries to not propose them).

    _____________________________________

    [quote:1qfanoxy]So far, empty answer = you don't send anything to host

    Ah ok, if you included that already, then you won't have to worry about it.

    ___________________________________

    [quote:1qfanoxy]Also, I notice a little problem with the way the scoring system works now : if someone always answer the same thing, like "ZZZZZ" for example, even if it is nonsense, it will add 1 to "ZZZZZ" value every round. So this player would score round number-1 every round. I should find a way to prevent previous rounds to influence later ones.

    Well, we both know that we need a way to differentiate between answers given in different rounds.

    The way I'd probably go (because I find 3d-Arrays too tedious to use, though they are very powerful), is to include the "round" number in the actual answer.

    So for example, the dictionary-entry for the first answer could look like this:

    · Key: "1" / · Value: "1//[answer]"

    The second answer would look like this:

    · Key: "2" / · Value: "2//[answer]"

    Now you can see which answer comes from which round.

    Of course, you will need to extract the plain answer from the key.

    If you know, that the number of rounds will never] go above 9, you simply use "left(3,length([string]))".

    Otherwise, you will have to use regex. (RegexMatchAt([string],"\d\/{2}([\d\D]+)","",0)

    __

    Or, you can learn 3d-arrays. :D

  • [quote:2ut3bivj]I want it to be a page that appears when "previous creatures" button is clicked. It would show the previous creatures sprite (in reduced size) + the answer given by the player and the points he got for that round. I am sure there is a quite simple way to do this. I just haven't had time to think about it yet. If you have any advice...

    In my opinion, the hardest thing while doing this, is to find a proper way to layout this to not make it obliterate the whole program haha.

    But that's up to you.

    Well, again, I'll have to refer to Dictionaries for this case (they are so useful).

    Since every peer receives the current creature anyways, you can simply submit that creature to a "creature"-dictionary when receiving the creature for the current round. Choose the current round's number as the key.

    (Don't forget to add "str()" around the number, since dictionaries only take strings as keys)

    (And to use "int()" when parsing the dictionary's contents)

    The same goes for the answer and the points. When you submit your answer/get your points, add the answer/points to a "myAnswers"/"myPoints" dictionary with the current round as a key (-> "str()").

    Now when a new round starts (and it isn't the first round), get the creature, answer and points from the previous round using a "For each key" condition (from the dictionary).

    Under that condition, you can retrieve the current dictionary's contents with the expression "[Dictionary].currentValue".

    Use these steps for the three dictionaries (creature, answer, points) and voilà, you have your previous answers at your fingertip(s).

  • Didn't read through any of the .capx 's, but try to add a "For each Zombie" in front of the condition that checks the distance between the player and the zombie.

  • To be honest, I would replace the TiledBackground with a Tilemap. That will make future environment building easier. :]

    Also, the "If" condition is not a "real" condition, I just used it to tell you that it is a condition.

    You know what? You could simply upload your .capx to Dropbox and link it here. Then, I can directly edit your .capx.

    That will make everything easier. :]

  • Probs to you for adding Download Manager support.

    And great plugin, thanks. More minor stuff, but definitely helpful.

  • I guess that's a Tilemap with which you are drawing the obstacles.

    If that's the case, you can do this:

    Put a condition in front of your 'resizing back to normal'-action(s):

    If Tilemap.PositionToTileY(Player.Y-50) = -1[/code:34gke2xa]
    
    (Replace 50 if needed. Right now, the player will only rescale, if there are no tiles 50 pixels above his origin image point)
  • Capx for my solution

    For more complex effect animation, you can use rexrainbow 's Tween to effect behavior.

  • The "OR" works perfectly.

    What causes it to not work is the "C" and "V" events.

    They are events (marked by an arrow) and differ from conditions.

    Conditions trigger each tick when they are true while events only trigger once as soon as they are true.

    You can simply change the "C" and "V" events to "Key is down" conditions.

    It will work then.