Estecka's Forum Posts

  • I wanted to make an app to process insanely long chunck of HTML, (I'm speaking of several millions of caracters), but just found that construct would truncate any string I give it to the 524.288th caracter.

    I though about cutting my string into smaller bits, -I could perfectly work with that,- but again, I want to give my string as a whole to construct, so even if I ask him to do this job, it will still only take in the first 524.288 caracters before cutting it into pieces...

    Is there a way I can safely enter a million caracters at once into my app without loosing the tail bit on the way ?

  • Isn't construct two debug performance check is due to single core and not multi-thread or layering or multi-core processors ?

    I... simply didn't understand that bit.

  • Again, I don't understand what your game is about, so you'll need to give more details.

    Alternatively, there is the "container" functionality I never used, but could help. It allows you to "link" objects of different types:

    If an object of one type is spawned, the linked object are also spawned. If an instance of on type is picked, the linked instances are also picked.

    You'll find an option to create a container on the left panel after selecting the first object you want to link.

  • If I understand, you want the game to automatically detect which tile the player is allowed to hang to?

    That's an interesting question I've also tried to solve.

    Your boxes around the player are to define the hitbox and the "no-grab" zone? It reminds me of an attempt I made myself (but didn't test yet) using "yes-grab" zone instead of grabable tiles, let me fetch some screenshot, and I'll explain...

  • That's another problem... There are things called family instance variable, that automatically applies to all object of the family. If your variables weren't set as family from the beginning you cannot upgrade them to family.

    If you don't have a lot of code about these variables, you can delete the variable then recreate it, but otherwise I'd suggest you to use the dictionnary method right above.

  • If you don't have access to the family function, you could use dictionnaries instead:

    One loop for every object type:

    For each object, create a key "Playername" with value "Score" in the dictionnary, then use a single to retrieve the keys in order.

  • Oh, my bad, I didn't understand the objects were of different types.

    Getting "different object" mixed up with "different instance"

  • If you want to create an ordered list you don't need to compare "two" instance with each other, "For" does it and order them for you.

    So let's say you want to create a scoreboard, your code would be like:

    • For each (Object) ordered by (Score) (Descending)
    • - Put (Object) at the top of the list

    or

    • For each (Object) ordered by (Score) (Ascending)
    • - Put (Object) at the position of the list (loopindex)

    It will start putting the smallest score in the list, then the second smallest above the smallest, and will finish with the highest at the top of alls.

  • (First, the "every tick" event does nothing, it's literally just for aesthetic when you don't want to leave an event blank.)

    From what I understand:

    You have an invisible sprite named camera to more easily locate the camera on the field. Did you use a "Scroll-to" behavior or did you make your own code for it ?

    Also several thing you might want to check:

    Is only the camera stuttering, or does the camera "object" stutter too?

    Did you check in debug mode whether only one player has ActorNr set to Photon.MyActorNr ?

  • Into the "system" conditions, you have the loop "For each (ordered)"

    It will repeats an action once for every instance of an object, and can order them according to any of their variable.

  • I don't understand what you're trying to achieve, but you might want to take a look to the "pick" condition.

    For every object, there is a "Pick with Unique ID" condition, under the system condition, there are additional "Pick", that let you pick an object depending various other condition.

    Let know that if there is no condition affecting an object, the action will affect all of its instances.

    Beside the "Pick" condition, if you know any condition that affect the specific instance you want to pick, add it to you action and it should do the trick.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
    • Send the bullet flying forth at (fixed speed)
    • Wait (random time)
    • Sends the bullet flying back at (fixed speed)
    • Wait (twice the previous time)
    • Start over
  • I made a code that analyze a provided HTML chunk to find all the occurences of a certain balise, and retrieve the unique data within each and every of these balises.

    It's a matter of about 200 (maybe 1.000) occurences per strings, from a file of 3 millions of caracters, with several of these files.

    So far with a shorter file of 32 occurences, it takes already 10 seconds to find them all, but with the bigger files, it take 44s to find only 32 of the occurence, so I expect 5mn to process the whole file.

    There are oblivious flaws in my code, it's kind of dirty, but I know no other way of going around.

    Most notably, I don't know how to retrieve more than one variable per regex test, and I don't know how to retrieve the Nth match of a regex variable if the variable has multiple match.

    As a result, my code looks like this:

    • Every tick, if the string match the regex (First test)
    • - Set a dictionnary entry to a RegexMatchAt() (Second test)
    • - Set the original string to a RegexReplace() (third test) to remove the previously gathered match, so it's not matched again.

    starts over at the next tick until done.

    38 millions caracters processed a three thousands times does sound like a lot of processing.

    The back of my mind is telling me I could gather all datas in a single test, but I just have no idea how.

  • I would remove the second wait and instead put its content into another event. I think the flash behavior has something like "on flash ending".

    I'm not sure whether destroying a flashing object triggers the event or not tho.

  • trueicecold Argh my bad. >_<

    I didn't spell the "no" in "no match". I'm so dumb.

    Yet I fail to understand, why do we need to escape the double-quote in the event, but not in the variable ?