I wanna add downloads to my game but I don't know how to use this object any help? thanks
I wanna add downloads to my game but I don't know how to use this object any help? thanks
Bonjour tu a un exemple dans le répertoire de fusion.
Hello you have an example in the fusion directory.
image_2022-12-05_212926862.png
The Download object is very simple to use.
image_2022-12-05_213006397.png
These are all things you can do with it in a Start of Frame condition. To start a download, you will need something to download off the internet like an image but you can download ANYTHING!!!!
image_2022-12-05_213133673.png
Here, you enter the link of your file which NEEDS to start with "https://" or "http://".
For example: https://upload.wikimedia.org/wikiped...5_logo.svg.png
This is a raw link with a picture of a Google logo. If we want to download it, you can paste this here in the expression box:
"https://upload.wikimedia.org/wikipedia/commons/thumb/2/2f/Google_2015_logo.svg/1920px-Google_2015_logo.svg.png"
After you typed it in, it will ask you for a destination and file name. I recommend pressing the "Use expression" button under "Cancel".
If you want to save this image into your game folder, you can type:
Apppath$ + "\<YourFileName>.png"
Saving it into folders is no different. You can use:
Apppath$ + "\<FolderName>\<YourFileName>.png"
Your folder might need to exist before you download so test that out!
After that, it will tell you to type your "Slot" number. You can download 4 files at the same time using the Download object so the slot number is just the number of the file you are downloading, just like an ID!
image_2022-12-05_214329080.png
Your event should now look like this and that's pretty much it.
You can set up a string showing how much percent your object downloaded but that's optional.
Happy coding!
- RedShadow