Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - daverave1212

Pages: 1 2
1
Ask a Question / How to use a game scale larger than the screen size?
« on: November 16, 2021, 05:53:54 am »
Hello!

I am trying to achieve a type of scaling for full screen.

My game height is 320 pixels.
My monitor size is 1080 pixels .

So, when in full screen ("no scaling"), the scale of the game is set to x3.

I would like to use an x4 scaling. In this case, the game would effectively go outside the screen, but that is fine.

Is there a way to do that?
Also if yes, is there a way to get the real screen size? AKA differentiate between the game screen size and the user's screen size?

Thank you!

2
Ask a Question / Re: Stop a 'Do every x seconds' loop ?
« on: May 06, 2021, 04:16:36 am »
I know it's very late, but there's a way to stop a "do every" block, but not from Stencyl blocks.

When you do the "do every X seconds" block, it calls the function "runPeriodically(....)".
"runPeriodically" returns a TimedTask object.
You can set its "repeats" property to false when you want the loop to stop.

Code: [Select]
  var timedTask = runPeriodically(myMiliseconds, function(task) {
    // your code here will be repeated every "myMiliseconds" miliseconds
  });

When you want to stop it, simply say
Code: [Select]
  timedTask.repeats = false;

I haven't tested this myself but I think it should work.

3
Hello,

Thank you for the reply and sorry for the late answer. I posted this on bugs as well and I updated my post there, forgot to update here.
I managed to fix it. I had a code block with an empty slot (I even had a red warning on it). After I removed it, it worked.

It's weird though that the game has been working perfectly fine until then. That' block had been there for months lol, and Stencyl never complained.

Anyway, I am glad I managed to fix it!

4
Ask a Question / Actors appear as white boxes on Windows and HTML5
« on: April 23, 2021, 03:35:04 am »
Hello,

I am trying to test my game. I ran it on Flash (Player), Android, HTML5 and Windows.
I also posted this on the Bugs subforum, in case it is a bug.

The game works fine on Flash (Player) and Android.
But on Windows and HTML5, there is a bug with actors. Some actors appear as white squares.

Here is what the game looks like in Flash (good):


Here is what the game looks like on Windows (glitched):


What is even stranger is that this seems to be a problem only on certain animations of the actors. Here's what I mean:

In this screenshot, the white box actor is the same actor as the guard with the torch, just different animations:


Note: All my assets are bound to the Main Atlas. This is my only Atlas.
Note: My Stencyl version is 4.0.4.

What I tried:
- I tried to enable/disable all atlases for all scenes.
- I tried to have the Main Atlas bound to all scenes.
- I tried to have the Main Atlas bound only to that scene in the screenshot.
- I cleaned up the project
- I checked the resources folder in the game folder and it looks fine. The assets folder in the games-generated folder in the windows folder also looks fine (for all sizes, e.g. x1, x1.5, x2, etc, the sprites seem to be there).
- I reinstalled Stencyl (latest version)

I don't know what else to try and I am starting to panic since I have been working on this project for months.

If anyone knows how to fix this or what might be the problem, I would really appreciate it, as it is a gamebreaking thing I don't know how to fix :(. I hope it's not a bug.

Thank you!

5
Ask a Question / How do you get a font by name?
« on: February 12, 2021, 07:46:01 am »
Hello!

I am trying to get a font by name (e.g. "BigRedFont").

The usual way in the engine to do this is to use the
Code: [Select]
getFont(id) function, but that takes the font ID, not its name and that's not very helpful.

I saw this post (http://community.stencyl.com/index.php?topic=45647.0) about this topic which says to use the following code:

Code: [Select]
for (res in Data.get().resources)
{
   if (Std.is(res, Font) && res.name == "Font Name Here")
   {
       return cast (res, Font);       
   }
}

return null;

However,  this does not work for me. It returns null.
So I went and printed (traced) the whole Data.get().resources object and I noticed that multiple of my fonts are missing from there.

My guess is that the fonts are not loaded yet in the scene, but I was out of luck browsing the Stencyl Haxe API for a solution.

Does anyone know a foolproof method to get a Font by its resource name?

Thanks a lot!

6
Ask a Question / Re: Android compilation stops suddenly
« on: August 28, 2020, 06:55:45 am »
Quote
java.io.FileNotFoundException: E:\Work\StencylGamesGenerated\Android Game\app\intermediates\signing_config\debug\out\signing-config.json (Access is denied)

That looks pretty bizarre to me, but apparently this is something that others have run into as well. Looks like you should be able to fix it just be deleting the file.

Regarding the android device detection, it's still not showing up. Perhaps you need to change your usb connection mode. I don't recall offhand, but I usually set my android to something like the "photo" or "media" transfer mode in order for adb to work.

Thank you so much!

I finally managed to do it. I deleted that file and now stencyl even detects my phone and successfully stream-installed the game to my phone! I don't know why it now detects my phone, I don't remember doing anything else.

I am so happy we made it work  :D

Cheers!

7
Ask a Question / Re: Android compilation stops suddenly
« on: August 27, 2020, 03:35:19 am »
It says here build sucssesful, but I don't see in your logs that Stencyl recognized your device. Check if for some reason the game isn't installed into your device. Other than having your device connected before you start Stencyl, I don't have much to suggest. Someone with more knowledge might be able to chime in later.

Hi. The game is not installed on my phone.

Right, after "List of devices attached" in the logs, I see no output, so it seems the device isn't detected. Note that being detected by the computer itself isn't enough. It needs to be detected by adb (android debug bridge), the software that's used to communicate with the device for development purposes. You may need to change some settings on the android or install some drivers on the computer.

See "Step 1: Set up your Device" in the Getting Started with Android Stencylpedia article.


To be able to immediately confirm when the device is recognized, in Stencyl, go to File > Preferences > Features, and enable Device Manager. Then, every time you open Stencyl, and again every 30 seconds after that, it checks if there have been any changes to what devices you have connected.

With the feature enabled, open the log viewer, and be on the lookout for something like this:

Code: [Select]
13:07:19,813 Found new device:
LGMV300Kf6761c6f
LGE LGM-V300K, SDK 28

When you see that, you can test your game and Stencyl will be able to see your device and install to it.

I enabled this option in Stencyl, but nothing like that shows in the log viewer.
I updated by Samsung USB Driver (and restarted) and enabled USB debugging on my phone.

It still doesn't work, but the logs seem to have changed. It seems to fail to compile now.

Here's the log: https://pastebin.ubuntu.com/p/rMkGZ446zg/

Any ideas?
Thanks!



8
Ask a Question / Android compilation stops suddenly
« on: August 26, 2020, 01:55:27 pm »
Hello,

I've been trying to compile a game for Android for testing purposes and I haven't managed to do it.
I created a new blank game with just a scene and an actor. No scripts, no extensions.

The game compiles and works if I build for Flash.
Once I swap for Android in the upper right corner, it shows "Compiling" for a few seconds, then stops and returns back to the game without any message on the screen or anything, and nothing else seems to happen.
I checked the logs but I can't really tell what's going on, though I think the game may have compiled.

If I remember correctly, I am supposed to see the "Sending to device" message after compilation.

I don't know what else to do.

Here are some useful specifications:
- I tried to reinstall Stencyl on another hard drive
- I tried to change the workspace folder to one with smaller path size (I saw online that it might fix it)
- I am on Windows 10, x64
- The phone attached to the computer is recognized by the computer and is a Samsung J5 with Android 8
- I am running Stencyl as administrator
- I gave the game a unique App ID (Game Settings > Mobile)
- The Android Minimum Version I use is API 14 - 4.0 (Ice Cream Sandwich)
- The Android Target Version is API 29 - Android 10
- I use JDK 12.0.2
- I have setup an Android certificate

I attached the logs below (probably the latest text file is the correct one). If someone can help me, I would be very grateful!

9
Ask a Question / Re: How do you use the Game Controller feature?
« on: January 28, 2020, 05:00:42 am »
I can tell you about the log part. Go to "Run > View logs through game controller" to view logs there instead of in the log viewer. When viewed this way, you can click on any log output in the game controller and quickly move to the relevant behavior or event in your game.

Thanks, that's great! A better log system is a good addition!

Anything else?

10
Ask a Question / How do you use the Game Controller feature?
« on: January 25, 2020, 06:13:21 pm »
Hello,

I upgraded to the new version of Stencyl and noticed there's this new thing, Game Controller.
I can't figure out how to use it and I couldn't find anything useful online.

I see I can run Haxe code in the bottom half of the Script tab, but I don't seem to be able to interact with in game code.
Is there a way to set up custom commands or something, or modify variables on the fly?
What kind of scripts can I run?

Also, the log part; what is it for?

Thank you!


11
Ask a Question / Re: Set image origin interacts weirdly with set X?
« on: December 23, 2018, 01:50:52 pm »
Is your 'Every 0.02 seconds' loop in an always/updating event? If so, that loop is being triggered 100 times per second.

The loop is not inside an update/draw/another loop.
Either way, I trace the position of the image at every step, each time after I call 'setXForImage'.
Instead of increasing by 1, it increases by half of its width.

12
Ask a Question / Set image origin interacts weirdly with set X?
« on: December 23, 2018, 01:11:13 pm »
Hello!
I made an image, then an image instance called 'img' and I set its origin to:

Code: [Select]
setOriginForImage(img, img.width/Engine.SCALE/2, img.height/Engine.SCALE/2);
I did this so I can rotate the image around its exact center with
Code: [Select]
img.rotation = img.rotation + 1;
Now, whenever i want to change the X coordinate of img, it behaves very strangely.
I put this code in an 'Every 0.02 seconds' loop:

Code: [Select]
setXForImage(img, img.x/Engine.SCALE + 1);
trace(img.x/Engine.SCALE);

This drastically changes the X coordinate of img, not even close to 1.
It's X increases very fast, by  around the original width of the image / 2 + 1.
The rotation around the center works fine.

Am I doing something wrong?
Is this a bug?

Thank you!




13
Extensions / Re: Camera Scroller Extension
« on: December 16, 2018, 10:41:57 am »
@squeeb Definitely test it and give some feedback! If you find any bug, post it here!

@LIBERADO Thanks! I forgot to add an icon, I will add it later.

14
Extensions / Camera Scroller Extension
« on: December 16, 2018, 07:46:32 am »


Camera Scroller
Works on iOS, Android, Flash, Windows and Mac.

Hello. This is my first extension and I hope it can be useful. Feedback is greatly appreciated.
Following the template:

Q: What does this extension do?
A: It allows for 'camera dragging' like you do with mobile pages on your phone. It is primarily intended for mobile apps, but should work on any platform. It has a smoothing effect and should feel natural to use.

Q: Why is it useful?
A: I haven't seen a similar extension and after I made it, it seemed quite nice to me.

Features
- Camera scrolling by drag-and-dropping the screen
- Camera smoothing (it keeps moving for a bit after you finish scrolling
- Intuitive usage




Get it

- Download this Extension
- Sample Project

(How to Install and Update an Extension)


Documentation

To use camera scrolling, you first need to Initialize it (only once per scene!).

Initialize
Use this block to start the camera scrolling.
After using this block, you are good to go! Camera scrolling should be enabled.
You can choose which axis you want to scroll, Horizontally, Vertically, Both or none (you can change it later).
You can also choose if you want smoothing or not (you can change it later).

Disable/Enable Camera Drag
Use these blocks to enable or disable camera drag, on any axis.
NOTE: Do not use Initialize more than once per scene! If you want to enable or disable scrolling on any axis, use these blocks.

Disable/Enable Camera Smoothing
Enable or disable camera drag smoothing with this block. I think it's pretty straight forward.

Version History

Uploaded

15
Ask a Question / Re: Is there a way to get larger code blocks?
« on: December 16, 2018, 06:18:13 am »
Good idea. I will post it there.

Pages: 1 2