FoozleCC's Recent Forum Activity

  • Hi all!

    Below is a link to a demo of a combat game that utilizes a simple combat AI from combining a state machine with move to behavior and distance. I have also created a video tutorial going through the creation of it that is linked below as well. Lastly, on the demo page, you can find the project file to download as well if you would like to tinker with or incorporate into your own games. I had to remove the art in the downloadable file so you will see some great squares fighting each other if you download and open it :)

    Cheers and feel free to provide some commentary on how to implement this more effectively if you would like or any other commentary.

    Demo + Project File:

    foozlecc.itch.io/simple-combat-ai-construct-3-tutorial

    (use full screen for best experience, arrow keys to move your character and spacebar to attack)

    Video Tutorial (subscribe if you enjoy, 3 subscribers and counting woohoo lol... gotta do something to have some fun during covid)

    Subscribe to Construct videos now

    FoozleCC

  • Hi all!

    Hope you are doing well. I have been a hobby user of Construct for a year or so now but never really shared anything I have made so figured I would start now with a link to a simple RPG tower climber game I made.

    I also just posted a link to another recent creation showcasing the orbit behavior

    construct.net/en/forum/construct-3/your-construct-creations-9/void-having-fun-orbit-behavior-156958

    "Mage Tower", very cleverly named, uses some amount of physics combined with a stand in place mage that requires you to use gestures to use her spells. One nuance (which I am annoyed at in hindsight for not making it differently) is that your "swipe" gestures must originate from the Mage... so swipe up for the big move that hits the whole board, left and right for some big fireballs, and down for a "burning floor". If you clear all the portals and the skeletons, you will climb to the next floor which will be harder. I don't know that I have ever made it past the 5th floor :).

    I particularly enjoyed crafting a cooldown system for the spells and the overlays for the spells indicating the cool down. I used the Drawing Canvas feature to do this.

    Let me know what you think!

    foozlecc.itch.io/mage-tower

    Also, while I only have 1 video so far posted on YouTube, I decided in covid times it would be an additional fun hobby while working so much from home to take a break. I am going to do a series of "Make a game in 10 minutes" challenges featuring behaviors from Construct 3. Feel free to check it out and subscribe if you are inclined, would make my day if you do!

    youtube.com/channel/UCxePUphQD0E3GtGd9eRcG1w

  • Hi all!

    Hope you are doing well. I have been a hobby user of Construct for a year or so now but never really shared anything I have made so figured I would start now :)

    A fairly recent one I had fun making was "From the Void". Mostly it is just a fun sand box to explore the Orbit feature and introduce the ability to show where the object is going rather than where it has been.

    I also really enjoyed making a dynamic "tray" at the bottom which can be used to select the growing chaos of objects.

    Take a look and let me know what you think! (Make sure to go full screen for the zoom to feel more natural! You can click and drag / zoom in with mouse wheel etc.)

    Last hint: just spam 1, 2, or 3 to get a feel for the creation of the sun, planets, and moons :) Ideally this was going to evolve into some sort of point adder upper where it was a balance between chaos and risk but I figured I stop where I was at for now.

    foozlecc.itch.io/from-the-void

    Also, while I only have 1 video so far posted on YouTube, I decided in covid times it would be an additional fun hobby while working so much from home to take a break. I am going to do a series of "Make a game in 10 minutes" challenges featuring behaviors from Construct 3. Feel free to check it out and subscribe if you are inclined, would make my day if you do!

    youtube.com/channel/UCxePUphQD0E3GtGd9eRcG1w

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I ended up working around this by not relying on the viewportWidth. In general, utilizing my viewport size of 1080 / 1920, i hard coded my variables off of center points of 540 960 and it all seems to be working.

  • I have shifted to scale outer from letterbox and have observed some unexpected behavior when working with the variable viewportWidth.

    I have a viewport size of 1080 x 1920 (9:16 aspect ratio). When I have a window that is wider than this, the variable viewportHeight stays fixed at 1920 and viewportWidth returns some value say 4000.

    What I am struggling with is to utilize the viewportWidth to calculate the center point and set the position of an object to this point.

    During letterbox mode this would be 540, 960 and now it is ? , 960. When testing, it appears the center to be something around the 300s when stretch to a width around 4000. How do I calculate this? I did not see an immediate relation ship to the aspect ratio jumping out at me.

    Perhaps there is a much simpler way for reliably determining the "center" when in scale outer to position objects relative to it.

    Any help is appreciated!

  • Hey Everyone - Anyone else face challenges getting their games to load from a mobile phone using the Facebook app?

    The game I am working on is uploaded to their web hosting and I am able to run from browser on my laptop with no issues but can almost never get it to load on my phone. I end up closing the app and relaunching it multiple times before it manages to actually load and on my most recent build I cannot get it to load at all.

    Any ideas on what may be causing this?

    Thanks!

  • Was able to figure this out..

    First, I had an error in assigning the uploadURL from the response.

    uploadURL = response.data.UploadDetails.UploadUrl;

    should have been

    uploadURL = response.data.UploadDetails[0].UploadUrl;

    While using fetch should probably work as well, ended up getting it to work with XMLHttpRequest.

    I got the following code to successfully push the data to playfab as a file.

    In the example below I am putting DataTest in but in my use case I have a large array of tile map data that I am storing. In place of DataTest in my example I set my tile map data equal to a global variable and send that within the send instead.

    General flow is that once the data is ready to send, call PF_InitiateFileUploads passing the entity information received from login which I had stored in a global variable in the event sheet. In the callback, send data to url received with XMLHttpRequest, initiate trigger to event sheet with status = "ready", then followup with with a call to FinalizeFileUploads.

    //InitiateFileUploads
    //https://api.playfab.com/documentation/Data/method/InitiateFileUploads
    function PF_InitiateFileUploads(f_EntityId,f_EntityType,f_EntityTypeString){
    	
    	var request = {
    		"FileNames": [
    			"mapData"
    		],
    		"Entity": {
    			"Id": f_EntityId,
    			"Type": f_EntityType,
    			"TypeString": f_EntityTypeString
    		}
    	}
    	PlayFabDataSDK.InitiateFileUploads(request,onInitiateFileUploadsResponse);
    }
    //FinalizeFileUploads
    //https://api.playfab.com/documentation/Data/method/FinalizeFileUploads
    function PF_FinalizeFileUploads(f_EntityId,f_EntityType,f_EntityTypeString){
    	
    	var request = {
    		"FileNames": [
    			"mapData"
    		],
    		"Entity": {
    			"Id": f_EntityId,
    			"Type": f_EntityType,
    			"TypeString": f_EntityTypeString
    		}
    	}
    	PlayFabDataSDK.FinalizeFileUploads(request,onFinalizeFileUploadsResponse);
    }
    
    function onInitiateFileUploadsResponse(response, error) {
    	var uploadURL;
    	var DataTest={
    		posX: 45,
    		posY: 23
    	};
    
    	if (response !== null) {
    		console.log("InitiateFileUploads response received")
    		console.log("InitiateFileUploads response: " + JSON.stringify(response));
    
    		uploadURL = response.data.UploadDetails[0].UploadUrl;
    		
    		console.log(uploadURL)
    		
    		var xhr = new XMLHttpRequest();
    		xhr.open("PUT", uploadURL, true); // true : asynchrone false: synchrone
    		xhr.setRequestHeader("Content-Type", "application/json;charset=UTF-8");
    		xhr.send(JSON.stringify(DataTest));
    		xhr.onreadystatechange = function () {
    			if (this.readyState === 4) {
    				console.log(this.responseText)
    				var status = "ready";
    				console.log("status: " + status)
    				myIruntime.callFunction("ES_initiateFileUploads_Results",status)
    			}
    		};
    	} else if (error !== null) {
    		console.log("InitiateFileUploads error received")
    		console.log("InitiateFileUploads error: " + JSON.stringify(error));
    	}
    }
    function onFinalizeFileUploadsResponse(response, error) {
    	if (response !== null) {
    		console.log("FinalizeFileUploads response received")
    		console.log("FinalizeFileUploads response: " + JSON.stringify(response));
    	} else if (error !== null) {
    		console.log("FinalizeFileUploads error received")
    		console.log("FinalizeFileUploads error: " + JSON.stringify(error));
    	}
    }
  • This is likely just my ignorance of javascript but wanted to see if someone could help with the correct way to upload a file to playfab once the upload url is received.

    The below will successfully use the InitiateFileUploads api to receive a response with an upload url. I am already logged in and getting the appropriate entityId / type and passing it in. I would like now to do a put using that url to upload sample data which I call DataTest below into an entity file on playfab.

    What is the proper way to do this in javascript? Does it need to be encoded? I am attempting to use fetch in an async function but am I simply approaching it incorrectly? Any help is appreciated!

    Also, I was able to get their setObjects api working correctly which could also be used to store small sets of data as demo'd below but I am interested in storing larger amounts of information which requires the use of an entity file.

    The closest documentation on playfab is below under the entity files section:

    api.playfab.com/docs/tutorials/entities/getting-started-entities

    //InitiateFileUploads
    //https://api.playfab.com/documentation/Data/method/InitiateFileUploads
    function PF_InitiateFileUploads(f_EntityId,f_EntityType,f_EntityTypeString,mapData){
    	
    	var request = {
    		"FileNames": [
    			"mapData"
    		],
    		"Entity": {
    			"Id": f_EntityId,
    			"Type": f_EntityType,
    			"TypeString": f_EntityTypeString
    		}
    	}
    
    	PlayFabDataSDK.InitiateFileUploads(request,onInitiateFileUploadsResponse);
    }
    
    
    function onInitiateFileUploadsResponse(response, error) {
    	//console.log(gMapData);
    	var uploadURL;
    	var DataTest={
    		posX: 45,
    		posY: 23
    	};
    
    	if (response !== null) {
    		console.log("InitiateFileUploads response received")
    		console.log("InitiateFileUploads response: " + JSON.stringify(response));
    
    		uploadURL = response.data.UploadDetails.UploadUrl;
    		
    		loadFile(uploadURL,DataTest)
    		
    	} else if (error !== null) {
    		console.log("InitiateFileUploads error received")
    		console.log("InitiateFileUploads error: " + JSON.stringify(error));
    
    	}
    }
    
    async function loadFile(uploadURL,data){
    	var payload = data;
    	var otherParam={
    		headers:{
    			"content-type":"application/json; charset=UTF-8"
    		},
    		body:payload,
    		method:"PUT"
    	};
    	const response = await fetch(uploadURL,otherParam);
    	const jsonData = await response.json();
    }
  • You do not have permission to view this post

  • Solved my own problem...

    Was getting the syntax mixed up.

    I just looped through my array in java script calling the below and it worked.

    runtime.objects."your array name here".getFirstInstance().setAt(val, x, y, z)

  • Been having some fun using javascript but I am not sure what the best method is to pass an array I created in a script back to an array object in the Event Sheet.

    Is there a way to directly set the size and the values using IArrayInstance? I read the below but I am not sure what the appropriate syntax is.

    construct.net/en/make-games/manuals/construct-3/scripting/scripting-reference/plugin-interfaces/array

    I have already figured out how to pass information back to the event sheet using runtime.callfunction. Is this required to pass a string of the array back to be handled in the event sheet somehow to become an array?

    Thanks in advance for any advice!

  • Awesome!

    Thank you so much! worked liked a charm. I went down such a worm hole looking for solutions after banging my head on this.

    Cheers

FoozleCC's avatar

FoozleCC

Member since 4 Dec, 2019

Twitter
FoozleCC has 4 followers

Connect with FoozleCC

Trophy Case

  • 5-Year Club
  • Entrepreneur Sold something in the asset store
  • Jupiter Mission Supports Gordon's mission to Jupiter
  • Regular Visitor Visited Construct.net 7 days in a row
  • RTFM Read the fabulous manual
  • Email Verified

Progress

10/44
How to earn trophies