randomly's Forum Posts

  • You can change effect parameters with the appropriate action.

    Use "set effect parameter" under the system condition "Every 0.1 seconds".

    Change the effect to your exposure effect and leave index at 0.

    Now, use a variable to set the current exposure to.

    The variable would start at 0.

    Every 0.1 seconds, you would set the effect parameter to variable + X.

    Increase your variable by X too.

  • Sorry for the late answer, I was on Christmas holidays.

    ________________________________

    [quote:24fpnv3a]When peers get "timer0", they send their answers to host (if not empty, tag "Answer")

    Don't know whether you added this yet or not, but it may be sensible to catch the case that every player submits an empty answer, by accident.

    So that it doesn't display "", but "No answer given" for example.

    ________________________________________

    [quote:24fpnv3a]I thought about asking the host to count the answers he gets and set timer to 10 only when that number reaches peercount-1.

    Yep, that is exactly what I would do.

    Don't start a new round before the host didn't receive all answers.

    You could also add a timeout, so that when the timer is 0, he waits 30 seconds and after that, he uses the answers he received no matter whether there are some missing (which should be unlikely anyways).

    ________________________________________________

    [quote:24fpnv3a] find another way to exclude those from the dictionary, so nobody get points for not answering.

    Just compare the content of the received message.

    If "Multiplayer.Message" equals "", then it is empty.

    If you invert this condition, it isn't.

    Easy as that.

    _____________________________________

    I'm happy you are making progress.

  • fixed the link

  • Apparently, quite a big one.

    No, I was just wrong when I thought that FromID returns the ID of the recently connected peer when put under a "On peer connected" event.

    Cause, you know, that would make sense.

    But apparently, that's not the case, so I tried something else (PeerIDAt) and that worked.

    Now, to explain Multiplayer.PeerIDAt:

    it takes the index of a player and returns his ID.

    The index is different for each player.

    So, when there were two players in a room, me and you and I used PeerIDAt(0), it would return my ID while PeerIDAt(1) would return yours.

    The other way around, if you used the expression, (0) would be your ID and (1) would be mine.

    When a player joins though, he will always be added on the last position of this table.

    That's why we use PeerCount.

    We substract 1 because PeerCount starts as 1 and the PeerIDAt expression needs an index, which starts at 0.

  • [quote:pixc7ewh]instead of automatically straight to the output but rather list the outcome of certain recipes and select the recipes.

    Yep, that was my idea too.

    Again, this will take some time.

    And since I'm on holiday from tomorrow until 29th, I probably won't finish this until then.

    But it definitely is possible.

    Please tell me if you're gonna stick with the solution of 99Instances2Go ,because if you do, I can keep the XML crafting thing as a personal challenge and don't have to hurry.

  • Just add a text variable, name it "currentGun".

    When you equip the gun, add an event "currentGun": set to [gunname].

    The exact way how to do this depends hardly on the way your weapon/equipment system works.

    So if you need more help, e.g. on how to get the gun name, you need to share some details, or, even better, the .capx of your project.

  • Again, I will need the .capx to see what's going on.

    Or maybe at least a screenshot of the text properties and the text events in the event sheet, if any existing.

    Maybe you are using a non-websafe font style.

    Also, try to change Comic Sans to other web-safe fonts like Tahoma or Courier/Courier New and see what happens.

  • First of all, a bit more info would be useful.

    • Do you export to a server?
    • With which browser are you viewing the page?
    • Does it work in the preview?
    • Which font are you trying to export?

    Also, a .capx is always helpful.

    Without the .capx, I can't assume really much.

    It might be the case that the font is not web-safe, but to tell, I'll have to know more about your project.

  • well, actually, in this case, it uses Dictionary.AsJSON, but you can use Arrays in more complex scenarios too.

    It simply works like this:

    • Add all values you need to the Dictionary/Array
    • Now you can share the Dictionary/Array as one single string with Dictionary.AsJSON or Array.AsJSON
    • When somebody receives that string, he can simply load his Dic/Arr with the JSON he just received
    • Like this, you can technically share hundreds of values in one string

    This is especially useful for Multiplayer games to send statistics or sth. similar to other peers.

  • I think, your option is easier, but since saving to LocalStorage, saving a dictionary as JSON takes less time since it only saves one Local Storage item instead of multiple.

    No offense, just trying to figure out what's more efficient.

  • You can return Arrays and Dictionaries as JSON.

    You would then use two LocalStorage keys.

    One for the level you are on/the number you finished and one for the dictionary with the scores as JSON.

    (Dictionary.AsJSON)

    When you want to get the scores from LocalStorage,simply load the Dictionary from the JSON in the LocalStorage value.

  • Yes, this is possible.

    You will use the system action "Canvas snapshot" for this.

    There is one inevitable downside though:

    snapshots take a short time to be done.

    This doesn't take more than some ticks, but you may have some frames rendered before the snapshot is done.

    To take the snapshot in your case, you would want to do the following steps:

    • hide the layers that you don't want to be visible on the snapshot
    • Take a snapshot with the system action snapshot canvas
    • Add an event "On Canvas snapshot"
    • Now, you can load a Sprite's image from the URL "System.CanvasSnapshot"

    Of course, you will have to add a Sprite first.

    You would make that Sprite as big as the layer you want the screenshot displayed on.

    Make sure to put it on the appropriate layer.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Got it to work now.

    Download .capx

    (The only thing that isn't perfect yet, is the way it handles recipes with the same list of ingredients as another recipe. It will produce the first one in the XML. If you need this to work too, just gimme a shout.)

    Concerning 99Instances2Go 's version:

    I didn't look at the .capx, but Arrays are (probably?) more complicated to setup, but easier to handle than XML's.

    It's probably more sensible to go with the Arrays. 99Instances2Go does quality work, I have experiences that myself already, haha.

  • Actually, I'm quite familiar with XML now, so most of the XML-related stuff shouldn't be much of a problem.

    The issue is:

    We can't use a dictionary to store the items the are dropped on the input.

    Why?

    Because dictionaries don't allow multiple keys with the same name.

    So what we need is a way to differentiate between multiple instances of the same object or to merge multiple instances into one dictionary entry.

    If we got this to work, then there wouldn't be any problem whatsoever.

    Actually, I have difficulties understanding the ID system you tried to explain.

    What do you mean by ID? Based on what pattern do you want to generate it?

    What do you mean by Creation? Do you mean the output of a crafting process? Do you want to backtrack after crafting something?

    _______________________________

    [quote:1hbgiadr]check the Item count with the current picked to where if we have two stone dictionary a counted for and two item it would know to use them both. Would we use a loop here something like Loop 1-(count(//Item)

    If you explained this to me a bit more detailed, we could surely come to a solution.

    (As I said, the XML parsing shouldn't be much of a problem)

    _______________________________

    I think, I found a solution, just need to test it.

    This is what I think of:

    When adding the items on the crafting table ("Input") to the dictionary, we could simply check whether a same key already exists.

    If it does, we add 1 to its value, if it doesn't, we create a new one.

    I'll post a new reply if it works. It should.

  • [quote:3fkvm5ld]But when would I send this message ? If someone joins after the message was sent, this peer won't have a timer.

    Earlier, you said that the timer is to give each player a timelimit on how long he can take to make a pick.

    I would generally say that you start the game no earlier than when all players joined a room (room is full).

    This will prevent you from needing to synchronize the timer every second or so.

    If a player disconnects during a game, I wouldn't let him join until the current round is over. That makes the whole process easier-

    _______________________________

    [quote:3fkvm5ld]I will need to be sure everyone send their answers upon host's signal

    Alright, that's quite a requirement.

    I would take the following approach:

    Since you are playing over LAN, latency shouldn't be much of an issue.

    This means that the timer's current times wouldn't be very different for each peer anyways.

    Do this:

    • When the round starts, the host gives each player the signal to start the timer
    • the timer for the peers is used to control the displayed timelimit only.

    That means that they will have visual feedback on their time left. (You probably wanted to do that anyways)

    But when the peer's timer reaches 0, they won't send their message yet.

    They will wait until the host broadcasts a message, that his timer is over.

    This will probably cause a slight difference delay the peer's visual timer reaching 0 and the host's message arriving, but this will guarantee that each player sends his message at the same time.

    Long story short:

    • The peer's timer is started at the same time as the host's timer
    • The peer's timer is only used for displaying the time left, not to send the message when the timer reaches 0
    • When the host's timer reaches 0, he broadcasts a message (e.g. "timer"). When the peers receive this message, they send their answer (synchronized)

    __________________________________

    [quote:3fkvm5ld]I tried to do that after including "int(value)", but it stills doesn't work for the group value. The peer never gets their message upon connection, so there must be a problem on host side.

    Alright.

    Try to set the "Send message" Peer ID to Multiplayer.PeerIDAt(Multiplayer.PeerCount-1).

    (I'll explain that if it actually works)