dop2000's Forum Posts

  • You can use tokenat and tokencount expressions to parse a list of values in a string:

    construct.net/en/make-games/manuals/construct-3/system-reference/system-expressions

    For "n" from 0 to (tokencount(s, ",")-1)
    .. Text append "Item #" & loopindex & "=" & tokenat(s, loopindex ",")
    

    Where s variable contains a string from the dictionary.

    But replacing values in the list will be tricky.

    I suggest you replace your dictionary with JSON object. JSON will be much easier to work with in this particular task.

    {
     "list1": [2,4], 
     "list2": [1,5], 
    .....
    }
    
  • Please try this or this:

    https://www.dropbox.com/scl/fi/2ctsvsdcobdem94haxq9j/ManOnARaft.c3p?rlkey=vo4j4louckydqzprwpp0nvp1t&dl=0
  • Add a black sprite on top with two effects - Screen and Bulge. (in that order)

    The bulge effect will only be in the area covered by that sprite.

  • I often use this trick:

    Object on screen : // nothing in this event
    
    Else : // your actions here
    
  • I tried to use your code but it gives me an error on key<> and I don't understand why.

    Sorry, I don't use JS often, it should be != instead of <>

    I assumed you know Javascript since you asked for a script solution?

    Here is a demo.

    dropbox.com/scl/fi/iw8pscxnqot8t6dnx0965/JS_InstVars.c3p

  • I didn't understand how to use the first one.

    It's easy. Save Sprite.AsJSON to a text variable. Later, when you need to restore, create a new Sprite instance and use "Sprite Set From JSON" action - it will restore its position, instance variables and all other properties from the saved JSON.

    I would like the console.log to also write the object variables not related to the family.

    You know which variables are related to the family - simply exclude/ignore them when running the "for (var key in o.instVars)" loop.

    for (var key in o.instVars) {
    
     if (key!="FamVar1" && key!="FamVar2") {
     console.log(key + ": " + o.instVars[key]);
     }
    }
    
    
  • It's probably only in preview. You will not see it when you export the game.

  • I would probably use a timeline for this. When the character collides with the vine, disable Platform behavior, start the timeline. You will need to move the character above/below the vine on z-axis during the playback.

  • rockpapershotgun.com/moonstone-islands-farming-doesnt-quite-gel-with-its-ghibli-esque-poke-like-battles

    Thanks! Seems like the author is not very familiar with the game yet, this explains some points of criticism in the article.

    For example, you can ask spirits not to follow you. You can receive a Spirit Barn quite early in the game by completing professor's quests. Spawn rate for spirits can be reduced in game settings.

  • If you need this to save/restore sprites on the layout, you can use Family.AsJSON expression. It will save all object properties, including the values of all instance variables. However, there will be unique codes instead of variable names.

    Or you can retrieve all instance variables with this script:

    const o = runtime.objects.Family.getFirstInstance();
    
    for (var key in o.instVars) {
     console.log(key + ": " + o.instVars[key]);
    }
    
    
  • In Construct all events are executed one by one at the start of the tick. Wait 0 allow to delay the action until the end of the current tick.

    Another option would be putting that event at the very bottom of the event sheet. But when you have lots of interlinked event sheets, it may be tricky to figure out in what order they are executed.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You can get platform speed using Sprite.Platform.vectorX and Sprite.Platform.vectorY expressions.

    Save these values in a pair of instance variables at the end of every tick:

    + System: Every tick
    --> System: Wait 0 seconds
    --> Player: Set speedX to Player.Platform.VectorX
    
    + Player: On collision with Wall
    --> TextSpeed: Set text to "Collision speed:" & Player.speedX
    
    
  • I don't think it's possible to do without a loop.

    You can add sheep value to the field value as sheep enter the field with "On collision" event. But if they are already there, this won't work, you'll still need for-each loop.