Ecation's Forum Posts

  • One thing I miss from After Effects sorely at the moment is a way of evening out the spacing between keyframes in order to smooth the speed of the motion. It's called "rove across time" in After Effects and turning it on will automatically space the select keyframes on the timeline so that the speed of the motion (measured in pixels per second) is always the same.

    I'm animating a character running around the map at the moment and it's quite difficult to keep the speed of the character even somewhat constant without this feature. It's one of those things that is difficult for a human to do but quite easy for the computer to calculate.

  • Okay I simplified the code and for some reason this version works just fine:

    const arrayForSplitText = localVars.randomylChosenScrollText.split((/(?<=[.;:])/gi));
    const a = runtime.objects.ArrayFromConstruct.getFirstPickedInstance();
    
    console.log(JSON.stringify(arrayForSplitText));
    
    a.setSize(10, 1);
    
    for (let i=0; i<arrayForSplitText.length; i++ ){
    	a.setAt(arrayForSplitText[i], i);
    
    }
    
    
  • Hi!

    I'm trying to get into scripting, but can't figure out what I'm doing wrong here. My goal is to populate a C3 Array object using a javascript array.

    Here is my script:

    //creating a JS array by splitting a string:
    const arrayForSplitText = localVars.randomylChosenScrollText.split('.');
    
    //accessing a C3 array object:
    const a runtime.objects.ArrayFromConstruct.getFirstPickedInstance();
    
    //This console log works as expected:
    console.log(JSON.stringify(arrayForSplitText));
    
    //Function someone here on the forums built for loading a C3 array with a JS array:
    function setC3Array(c3ArrayInstance, arr){
    
    	try {
    		const w = arr.length;
    		let h = arr.sort((a, b) => a.length - b.length)[0].length;
    		c3ArrayInstance.setSize(w, h);
    		arr.forEach((x, xi) => {
    			x.forEach((y, yi) => {
    				c3ArrayInstance.setAt(y, xi, yi);
    			})
    		})
    	} catch(err){
    		console.log('Errror on setC3Array function', err);
    
    	}
    
    }
    
    //call the function:
    setC3Array(a, arrayForSplitText)
    
    //What I get is:
    Errror on setC3Array function TypeError: x.forEach is not a function
    

    Tagged:

  • Thank you for all the replies!

    I will try to implement R0J0hound's suggestion next.

  • Hi!

    I'm trying to create a dialogue system in which the input text for a dialogue can be any length. The game should then take the input and break it into chunks that can be displayed comfortably on the screen.

    How can I break a long string into chunks of say 200 characters while also considering the spaces between words (so that a word doesn't get broken in half)?

    Tagged:

  • Hi sachos345!

    I think that trailer was somehow automatically generated by the play store. I wouldn't have chosen those exact seconds from the game myself. I did provide a YouTube link in my play store listing, so perhaps Google captured the trailer from that?

  • Here is King David RPG on Google Play. Made fully in Construct 3:

    play.google.com/store/apps/details

    Play as the young king David before he became a famous king. Find scrolls of scripture, learn new skills and find tools that allow you to interact with the game world. Discover secrets everywhere. Try to also be kind to your neighbors.

    youtube.com/watch

  • Thanks calminthenight, we posted almost at the same moment!

    Unfortunately there might be a newer instance that exists at the same time since I'm allowing the player to swing with every button press (so two rapid button presses might actually create two instances).

  • Hi!

    Thanks for helping!

    Luckily I got it to work quite simply in the end, I just used a "system" --> "wait for previous actions to complete" action after starting the timeline and then I destroyed the instance, all in the same event block.

  • I'm trying to do something quite simple with the timeline; animate a tool that the player is swinging.

    When the player presses a button, I'm creating an instance of this tool. After the tool has swung, I would like to simply delete the instance.

    I managed to add the rotation animation for the tool using the timeline. I'm using "set instance" to schedule the freshly created tool instance to play in the timeline. But how can I select the instance that has just finished playing it's timeline animation for destruction? Is there some obvious way of selecting instances involved in a timeline animation that I'm missing?

    Thank you!

    Tagged:

  • Thank you!

    I didn't realize that you can simply check for overlaps like this and it will automatically ignore the tiles without collision during that check!

  • Hi!

    Is it possible to check if a certain tile has it's collisions disabled in a tilemap?

    I'm trying to make a character drop something in the layout. But it should be dropped in a location which the player can access (so a tile on the tilemap that has no solid collisions so that the player can walk on top of it).

    I think I would know how to pull it off by checking for certain tile numbers that I know don't have collisions. But my tilemap has hundreds of tiles and creating this list would be tedious. So that's why I'm asking if there is a simpler way to find the closest tile with no collision turned on?

    Tagged:

  • Thank you very much for this explanation!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hi!

    Thanks for your explanation. I guess I'm a bit confused why the moving angles are different from the basic angle system of Construct, where north is 270 and south is 90. Why does movingAngle go into negative values?

  • I'm having trouble understanding the movingAngle expression values related to the MoveTo behavior. I even made a simple capx to test it but the values remain a mystery to me: sometimes when I make the object move right I get a negative value, but sometimes it's positive.

    Here's the capx, simply click with mouse (or touch) in order to move the arrow. The movingAngle will be displayed in the text box:

    drive.google.com/file/d/12djpC7S2MefwIq3ZXg-y_errvb5jH09I/view

    Any help would be appreciated. I need this to make the object mirrored when moving left and not mirrored when moving right.

    Tagged: