WackyToaster's Recent Forum Activity

  • Families are a bit tricky. If you tell Construct to create an object "Family" it will randomly pick one of the objects assigned to that family. So if your family contains cirlces and squares, this will randomly create a circle or a square. You probably need to store the name of the object and then "create object by name"

    But without knowing exactly how your project is set up it's hard to give definitive answers on how to solve X, so ideally you could just post an example of your setup.

  • Man I have sunk a couple of hours into this problem and I still have no idea where to even begin :D It's really not an easy problem depending on how complex you want it. I'd argue the build-in pathfinding behavior is not suited for this type of problem. I've personally never managed to solve it.

    The basic idea is building a nodetree with connections, then use A* to find a path through that tree. But as to how to have the enemy properly traverse along the path... no clue.

    Maybe now that I have a bit more clue about js I could try again but this is rough.

    For a much more basic implementation. A handful of raycasts can do the trick.

    -Move towards the target sprite (either left or right)

    -Shoot one ahead of the enemy, if it hits a wall -> jump

    -Shoot one down from the enemies feet, if it doesn't hit anything there's a pit -> jump.

    This is crude and will not work for anything that requires more complex pathing.

  • Well if you build a nice eventsheet that contains all the players inputs/actions etc. you can just copy that eventsheet into a new project and have it work there too. Only thing is that the new project needs to have all objects used (e.g. the player sprite) already available and with the same name as the old project.

  • You can switch frames with "set frame"

    You can switch animations with "set animation"

    construct.net/en/make-games/manuals/construct-3/plugin-reference/sprite

    You can check if your player is overlapping with "is overlapping"

    construct.net/en/make-games/manuals/construct-3/plugin-reference/common-features/common-conditions

    You can invert conditions by rightclicking -> invert. So you can also check "is not overlapping"

    Put everything together :)

    I recommend switching animations rather than frames btw.

  • You can put dictionary.asJson into yet another dictionary. So you could have one dictionary "savegame" and one dictionary for each type of sprite like "circles", "squares",...

    On save you loop through all sprites and put them into the "circles" dictionary. Then you put "circles.asJson" into the "savegame" dictionary under the "circles" key.

    When you load, you first load the JSON into the "savegame" dictionary, then you take the "circles" key and load it into the "circles" dictionary via savegame.Get("circles")

    Finally you loop through all keys in the "circles" dictionary and create a sprite for each and load the saved data into them.

  • I'm assuming your square is a sprite?

    You can also save an entire Sprites data by accessing it with Sprite.asJson. So instead of taking individual variables, you can just save the entire Sprite. And of course load it too.

  • In the ghost shooter script, ObjectInstance.TestOverlap(SomeOtherObjectInstance); is used.

    here is no _privateVariable marker there, so I would assume its okay, but again.... it isn't "documented", so technically it isn't. I guesse? Idk?

    This is documented actually

    construct.net/en/make-games/manuals/construct-3/scripting/scripting-reference/object-interfaces/iworldinstance

    But iirc it isn't available in the SDK.

    None of these work.

    this.testOverlap()
    this._inst.testOverlap()
    this._inst.GetWorldInfo().testOverlap()
    

    this.runtime is also not available, but rather it's available as this._runtime. However, this._runtime.testOverlap() doesn't work either.

    I haven't done anything SDK in a while, but maybe it's fine to use _vars because it is in the documentation? Maybe I just misremember something. Either way, I cannot find an easy way to test for overlap like it's done in the regular javascript.

    Hence the direct access to the collision engine which as far as I can tell, is undocumented. It's also bad because I think it actually skips most optimizations like collision cells, it's just a raw call of "Is instance X overlapping instance Y"

  • I remember using it in my flags behavior but it doesn't seem to be officially supported. (Accessing anything with _ is usually a no-no). I made a suggestion a while ago for it but you know... they take a while if they happen at all.

    construct.net/en/make-games/addons/949/flags/versions

    Here's the code:

    CheckOverlap(flags) {
    			const collisionEngine = this._runtime.GetCollisionEngine();
    			const flagsInstances = this._behInst._behavior._myInstances._arr;
    			let result = false;
    			
    			result = flagsInstances.some(i => {	
    				const t = collisionEngine.TestOverlap(this.GetObjectInstance(), i);
    				if(t) {
    					if (i.GetBehaviorSdkInstanceFromCtor(C3.Behaviors.Wackytoaster_Flags)._HasFlags(flags)) {
    						return true;
    					}
    				}
    			});
    			
    			return result;
    		}

    You'll need to adapt it for your use ofc. I guess the main point is simply

    const collisionEngine = this._runtime.GetCollisionEngine();
    collisionEngine.TestOverlap(instanceA, instanceB);
    
  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Just so you know, the plugin is 4 years old and by now Construct has official support for autotiling stuff.

    Note the set/erase tile with brush

    construct.net/en/make-games/manuals/construct-3/plugin-reference/tilemap

    You can setup your brushes in the tilemap window.

  • Unfortunately the save game feature is... let's say "special" because it works fine until it doesn't. But the best way to tackle this currently is local storage. It isn't as complicated as it may seem and you only need to learn it once and then you can use it forever :)

    Here's a basic setup to get you started

    wackytoaster.at/parachute/basicSavegameSetup.c3p

  • The atlas creation is probably a big hurdle because it can mean a sprite may randomly have one of its frames on a different atlas. And as mentioned the atlas will always look different between versions. I wonder if it would be possible (without too much hassle) to export the images/frames/animations without atlas, then create the atlas at runtime in the loading screen of the game from the exported images. It generally doesn't appear to take that long and once created it doesn't have to redo it anyway, unless changes have been made.

    You can load sprite images from a URL which might work better. That bypasses the whole spritesheeting system.

    If that, I'd like to see the QOL improvement of simply being able to load into a defined animation frame rather than the current animation frame.

  • Hello, is it possible to restore the lost file of the project project if there is an HTML5 Zip archive

    No

    I will have to do everything again.

    Yes

    Lessen learned: Backup your project. Put it in the cloud. Put it on a USB stick. Put it whereever. Just make sure it's on at least 3 different devices in 3 different locations.

WackyToaster's avatar

WackyToaster

Member since 18 Feb, 2014

Twitter
WackyToaster has 26 followers

Connect with WackyToaster

Blogs