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 - Annulus Industries

Pages: 1 2 3
1
Extensions / Re: External Data Extension [1.6.1]
« on: October 15, 2017, 06:05:58 am »
Thank you so much, I'll give this all a go.

2
Extensions / Re: External Data Extension [1.6.1]
« on: October 15, 2017, 03:03:55 am »
I can see now that my programming experience is severely lacking: I have a lot to learn!  :P

Basically, I'm compiling to Windows, and... OK nevermind, I don't know the terminology. If I compile to Windows and I choose where I want to game saved, then Stencyl opens up file explorer where I chose? That's the folder I'm trying to be able to access with the external data stuff.  Say I made a 2D Minecraft game and saved it to my desktop, now my desktop has the folder "Paper-Minecraft" or something.

If the player (me in this case) took a screen-shot, it would be saved somewhere under C:\Users\com-user0\Desktop\Paper-Minecraft\assets\data\{whatever else}. What I'm instead trying to do is have the starting point for where saves go to be in that initial folder where Paper-Minecraft.exe, so I can instead save screenshots to C:\Users\com-user0\Desktop\Paper-Minecraft\Screenshots\{image}. I wasn't really planning on trying to save anywhere outside of the games folder.

The other thing I'm trying to do is allow the user of my program to switch between saving screenshots as .png or .jpg. Those are the only two formats I think would be useful. I thought that by commenting out the if (path.substr(path.length - 4).toLowerCase() != ".png") { path += ".png"; } bit I could instead make the extension either .png or .jpg when using the block. So I can write Screenshots\Image.png or Screenshots\Image.jpg into the text field based on what the user wants to save the image as.

Hopefully that clears things up a bit. I haven't actually made a Paper Minecraft game, this was just an example, but I have attached some images to try and get my point across a bit better.


Thank you,
Annulus

3
Extensions / Re: External Data Extension [1.6.1]
« on: October 14, 2017, 05:46:42 pm »
ETHproductions,

First of all, I love your extension, it's amazing. I was just wondering if you could tell me what some things I'm messing around with would do.

If I were to comment out all the file = "assets/data/" + file; and path = "/assets/data/" + path; lines in the DataUtils.hx and FileSave.hx files, would that let me save/load things anywhere in the project folder? For example, loading an image from "Saved Images/Face.png" instead of "assets/data/Saved Images/Face.png" or savinga text document to "Exported Player Data/Ali.txt" instead of "assets/data/Exported Player Data/Ali.txt".

Also, line 147 of FileSave.hx is if (path.substr(path.length - 4).toLowerCase() != ".png") { path += ".png"; }. If I commented that out, would I be able to save images in other formats such as .jpg? And if I could, what would be the limitations of this?

If you would be able to answer these questions, I would most appreciate it.


Thank you,
Annulus

4
Chit-Chat / Re: Editing Hard-Coded Information in Stencyl
« on: October 14, 2017, 05:06:20 am »
[reserved]

5
Chit-Chat / Editing Hard-Coded Information in Stencyl
« on: October 14, 2017, 05:05:05 am »
After working on a project for a period of time, you may want to change something that was set when you began but, oh no, you're not allowed to change it! What do you do; make your change, then transfer all the information you've built up? That could take a lot of time though, so here's a better idea: come to this post, and see if there's a section on whats troubling you.

I'm basically setting this up as a time-saving resource for those who want to change something that Stencyl currently does not offer an efficient way of doing. I have fun doing this, probably because most of these methods will involve directly editing saved game files. As a rule of thumb though, you should export a copy of your project (File > Export Game...) and have closed Stencyl before trying any of these suggestions. Also, because my computer only runs Windows, these instructions refer to files found under:
.
C:\Users\{user}\AppData\Roaming\Stencyl\stencylworks
.
Which can be navigated to by pressing Windows Key and searching %appdata%. I don't know where this is on other operating systems.

I will update sections if I learn more interesting things, and I will update this post if I find more useful methods, if anyone knows a little thing they do to save time, please post it below and I will try to add it in future.


Thank you,
Annulus


Changing the Names of Global Attributes
correct as of Stencyl 3.4.0 b9300

  • Navigate to your project folder (C:\Users\<user>\AppData\Roaming\Stencyl\stencylworks\{project name}).
  • Open to file game.xml with a text editor.
  • Scroll down until you reach the <attributes> tag.
This is where the global attributes for your project are listed. They are in the format
.
<a cid="b" id="c" name="d" save="e" value="f">
.
where:
  • a is the attribute type and can be any of number, text, boolean, list, or map.
  • b is the attribute category. See below for more information on this.
  • c is the attribute ID. It iterates from zero upwards with each new attribute, and I'm assuming this is what Stencyl uses to refer to global attributes when it loads the design-mode editor. This is why, when copying blocks between stencyl projects that contain global attributes, they can be swapped out for attributes of the wrong type or removed altogether. It currently seems like deleting a global attribute changes the ID's of all other attributes above it so that there are no 'gaps' in the iteration.
  • d is the name of the global attribute. You can change this to anything other than an existing attribute name using letters, numbers, underscores, and spaces. The attribute name cannot end with a space, and should maybe not start with an underscore (I'm not sure of this applies to haxe, but an underscore before a variable sometimes changes how that variable can be accessed in some languages).
  • e is a boolean (accepts true or false) which looks like it would change whether that global attribute is saved with the Save Game block. All attributes seem to be true by default, and I would reccomend not changing that. I haven't messed around with it, so I don't know if it would cause some kind of error. It might simply stop the project from saving that attribute, but then why make the change anyway.
  • f is the initial value of the attribute. numbers, text, and booleans will only take up the one line, but maps and lists with an initial 'value' will take up multiple lines (see the example below)

Regarding b:
Above the <attributes> tag is the <attcats> (attribute categories) tag. In this area you can modify the categories for your attributes[/li][/list]. The Default category has an id of -1, and I would reccomend not messing with it. Categories don't have as stringent an ID iteration as game attributes, and their names seem to accept any combination of any character (except for ", which is written as &quote;). You can change the information of categories under <attcats>, and by changing to value of b, you can change what category an attributes belong to.
Remember though that you can already rename and delete categories in Stencyl by secondary-clicking the category in the Attributes menu.

Example:
Below is an example piece of the game.xml file. I'm not going to show every kind of change that you can make to it because one; this section seems to be getting quite long and two; I'm lazy.
Code: [Select]
    <attcats>
        <cat id="-1" name="Default"/>
        <cat id="0" name="Player Information"/>
        <cat id="1" name="Game Information"/>
        <cat id="2" name="OUOy898y7 ou ioyu )()*0u yhiou9Y(&amp;T*7t9 t7897"/>
        <cat id="3" name="This Category Has No Items In It"/>
        <cat id="5" name="SingleQuote: ' DoubleQuote: &quot;"/>
    </attcats>
    <props/>
    <attributes>
        <boolean cid="1" id="2" name="Loading Level" save="true" value="false"/>
        <number cid="1" id="3" name="Game Stage" save="true" value="6.0"/>
        <number cid="5" id="0" name="Health" save="true" value="97.0"/>
        <list cid="-1" id="10" name="Empty List" save="true" val="list"/>
        <map cid="0" id="5" name="Defeated Enemies" save="true" val="map">
            <TEXT key="Goblin" order="0" value="14"/>
            <TEXT key="Snake" order="1" value="3"/>
            <TEXT key="Dragon" order="2" value="0"/>
            <TEXT key="Elephant" order="3" value="1"/>
            <TEXT key="Human" order="4" value="8"/>
            <TEXT key="Elf" order="5" value="6"/>
        </map>
        <list cid="0" id="1" name="Inventory" save="true" val="list">
            <text order="0" value="Apple"/>
            <text order="1" value="Apple"/>
            <text order="2" value="Bread"/>
            <text order="3" value="Key"/>
            <text order="4" value="Purple Gem"/>
        </list>
        <boolean cid="-1" id="7" name="Is This Boolean True" save="true" value="true"/>
        <list cid="-1" id="12" name="Arbitrary List" save="true" val="list">
            <number order="0" value="6346.0"/>
            <number order="1" value="1312.0"/>
            <text order="2" value="text"/>
            <text order="3" value="some more text"/>
            <text order="4" value="blahblahblah"/>
            <text order="5" value="2352462 - 1134"/>
        </list>
        <text cid="0" id="4" name="Name" save="true" value="Mohammad"/>
        <map cid="-1" id="11" name="Empty Map" save="true" val="map"/>
    </attributes>
Notes:
This has only happened the last time I changed a global attribute name, but I had to open every behaviour that contained that changed attribute so that the new name was noticed when the projected was compiled. The Stencyl programming-thingy refers to global attributes by their ID, but it writes the actual haxe program with the global attribute names. This problem might be more easily fixed by doing Run > Clean Project but I haven't actually tried that.


Changing Scene Tile Width and Height
correct as of Stencyl 3.4.0 b9300

Tiles are useful if you make use of tilesets, making presentation easier to organise and easing the amount of time spent processing actors or images.
If you want to change the tile-size of a scene but have already attached and configured several scene behaviours, organised your layers, and/or placed actors, it would normally be really time-consuming to make that change. But not anymore!
  • Navigate to the scenes repository (C:\Users\{user}\AppData\Roaming\Stencyl\stencylworks\games\{project name}\scenes).
  • The scenes of your project are labelled with a numerical identification based on the order that you created them in. If you only know the name of the scene you want to edit, you can find the ID of that scene in the scenes.xml file with the format:
    .
    <scene desc="{scene description}" format="{stencyl version}" id="{scene ID}" name="{scene name}"/>
    .
  • Once you know the ID of the scene you want to edit, open {scene ID}.xml and look at the second line, it should start with <scene. the 17th and 18th labels of that scene tag are tileh="x" and tilew="y", which record the tile height and width of the scene respectively. Feel free to change these to any number above zero.
  • Make sure to check the scene(s) you changed to tile size of before trying to compile the project. Stencyl will round down the height and width of the scene to the nearest integer of tiles (e.g. a 500px wide screen with tiles 32px wide will become 15 tiles, or 480px wide). No word on what this will do to any formatting already on the scene, but my guess is that everything is anchored to the top left so you just won't be able to see anything that gets cut out.

Example:
Below is one of the scene .xml files from one of my projects. This is me speculating (because remember, I'm not one of the people who actually maintain Stencyl), but I get the impression that:
  • The color labels under the <layers> tag refer to the colour of the border surrounding selected actors in the scene editor for each layer (as each layer has a different colour).
  • Everything under the <snippets> tag refers to all of the attributes of every behaviour attached to the scene, and all of the global attributes, as well as their default values.
Code: [Select]
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<scene depth="16" desc="" eventsnippetid="0" extheight="1376" extwidth="2656" extx="-32" exty="-32" format="3.4.0" gravx="-0.0" gravy="0.0" height="1312" id="0" name="GeneralProgram_Sc" revision="" savecount="0" tiled="1" tileh="640" tilew="1280" type="standard" width="2592">
    <layers>
        <color-bg blue="255" green="255" red="255"/>
        <layer blendMode="normal" color="100,168,234" id="0" locked="false" name="Layer 0" opacity="100" order="15" scrollFactorX="1.0" scrollFactorY="1.0" visible="true"/>
        <layer blendMode="normal" color="0,255,0" id="1" locked="false" name="Layer 1" opacity="100" order="14" scrollFactorX="1.0" scrollFactorY="1.0" visible="true"/>
        <layer blendMode="normal" color="64,64,64" id="2" locked="false" name="Layer 2" opacity="100" order="13" scrollFactorX="1.0" scrollFactorY="1.0" visible="true"/>
        <layer blendMode="normal" color="255,0,255" id="3" locked="false" name="Layer 3" opacity="100" order="12" scrollFactorX="1.0" scrollFactorY="1.0" visible="true"/>
        <layer blendMode="normal" color="255,175,175" id="4" locked="false" name="Layer 4" opacity="100" order="11" scrollFactorX="1.0" scrollFactorY="1.0" visible="true"/>
        <layer blendMode="normal" color="255,200,0" id="5" locked="false" name="Layer 5" opacity="100" order="10" scrollFactorX="1.0" scrollFactorY="1.0" visible="true"/>
        <layer blendMode="normal" color="0,0,255" id="6" locked="false" name="Layer 6" opacity="100" order="9" scrollFactorX="1.0" scrollFactorY="1.0" visible="true"/>
        <layer blendMode="normal" color="255,0,0" id="7" locked="false" name="Layer 7" opacity="100" order="8" scrollFactorX="1.0" scrollFactorY="1.0" visible="true"/>
        <layer blendMode="normal" color="255,255,0" id="8" locked="false" name="Layer 8" opacity="100" order="7" scrollFactorX="1.0" scrollFactorY="1.0" visible="true"/>
        <layer blendMode="normal" color="0,255,0" id="9" locked="false" name="Layer 9" opacity="100" order="6" scrollFactorX="1.0" scrollFactorY="1.0" visible="true"/>
        <layer blendMode="normal" color="64,64,64" id="10" locked="false" name="Layer 10" opacity="100" order="5" scrollFactorX="1.0" scrollFactorY="1.0" visible="true"/>
        <layer blendMode="normal" color="255,0,255" id="11" locked="false" name="Layer 11" opacity="100" order="4" scrollFactorX="1.0" scrollFactorY="1.0" visible="true"/>
        <layer blendMode="normal" color="255,175,175" id="12" locked="false" name="Layer 12" opacity="100" order="3" scrollFactorX="1.0" scrollFactorY="1.0" visible="true"/>
        <layer blendMode="normal" color="100,168,234" id="13" locked="false" name="Layer 13" opacity="100" order="2" scrollFactorX="1.0" scrollFactorY="1.0" visible="true"/>
        <layer blendMode="normal" color="255,200,0" id="14" locked="false" name="Layer 14" opacity="100" order="1" scrollFactorX="1.0" scrollFactorY="1.0" visible="true"/>
        <layer blendMode="normal" color="0,0,255" id="15" locked="false" name="Layer 15" opacity="100" order="0" scrollFactorX="1.0" scrollFactorY="1.0" visible="true"/>
    </layers>
    <joints/>
    <regions/>
    <terrainRegions/>
    <actors/>
    <snippets>
        <s enabled="true" id="3">
            <prop id="1" list="0" val="0.0"/>
            <prop id="2" list="1" val=""/>
            <prop id="3" list="1" val=""/>
            <prop id="4" list="1" val=""/>
            <prop id="5" list="0" val="4"/>
            <prop id="6" list="0" val="0"/>
            <prop id="7" list="0" val="0.0"/>
            <prop id="8" list="0" val="2"/>
            <prop id="9" list="0" val="0.0"/>
            <prop id="10" list="0" val="11"/>
            <prop id="11" list="0" val="0.0"/>
            <prop id="12" list="0" val="0.0"/>
            <prop id="13" list="0" val="0.0"/>
            <prop id="14" list="0" val="0.0"/>
            <prop id="15" list="0" val="64"/>
            <prop id="16" list="0" val="4"/>
            <prop id="17" list="0" val="0.0"/>
            <prop id="18" list="0" val="0.0"/>
            <prop id="19" list="0" val="0.0"/>
            <prop id="20" list="0" val="0.0"/>
            <prop id="21" list="0" val="false"/>
            <prop id="22" list="0" val="0.0"/>
            <prop id="23" list="0" val="0.0"/>
            <prop id="24" list="0" val="0.0"/>
            <prop id="25" list="0" val="0.0"/>
            <prop id="27" list="1" val="">
                <text order="0" value="con"/>
                <text order="1" value="prn"/>
                <text order="2" value="aux"/>
                <text order="3" value="nul"/>
                <text order="4" value="com1"/>
                <text order="5" value="com2"/>
                <text order="6" value="com3"/>
                <text order="7" value="com4"/>
                <text order="8" value="com5"/>
                <text order="9" value="com6"/>
                <text order="10" value="com7"/>
                <text order="11" value="com8"/>
                <text order="12" value="com9"/>
                <text order="13" value="lpt1"/>
                <text order="14" value="lpt2"/>
                <text order="15" value="lpt3"/>
                <text order="16" value="lpt4"/>
                <text order="17" value="lpt5"/>
                <text order="18" value="lpt6"/>
                <text order="19" value="lpt7"/>
                <text order="20" value="lpt8"/>
                <text order="21" value="lpt9"/>
            </prop>
        </s>
        <s enabled="true" id="15">
            <prop id="1" list="0" val="11"/>
        </s>
    </snippets>
    <terrain/>
    <atlases members="" retainAtlases="true"/>
</scene>
Notes:
I've only actually done this once, so if something else happens or anyone else has more information please put it down below and I'll add it in, thank you.

6
Ask a Question / Re: How to do an actor that not exits a region?
« on: July 03, 2017, 06:00:49 am »
Dang, nevermind then. Sorry to have bothered you.

7
Ask a Question / Re: How to do an actor that not exits a region?
« on: July 03, 2017, 05:10:26 am »
OK, so. Keeping in mind that I haphazardly threw this together without any sort of debugging or testing of any kind, this should work if everything goes how I think it goes. The thing I'm most unsure about is the block, I'm not sure if it returns angles in the same or opposite direction to the unit circle.

Maybe use it as a base and ask for other people opinions. For all I know I got script completely wrong and it won't do anything, but I made it to completely replace the Drag and Drop Behaviour (though it won't work with a camera yet).

Good Luck!

8
Ask a Question / Re: Need help with path prediction bug!
« on: July 03, 2017, 02:28:58 am »
From the video, it looks like the path prediction dots spawn outwardly from the centre of the square, however, they bounce straight off of walls. Long story short, I'm terrible at explaining things, so I'll try in dot-points:
  • Dots spawn in a path from the centre of the square.
  • Dots bounce directly off of wall after touching it
  • Square bounces directly off of wall after touching it. This is the problem.

When the square is touching the wall there is a small distance between the centre of the square (where the dots spawn) and the wall (where they bounce). This means that as soon as the square changes direction the dots 'teleport' a little bit. From being seen coming from the wall to being seen coming from the centre of the square.
You can see this if you pause your video just before the square makes its first collision, the dots point at the squares upper left corner.

The fixes I can suggest are:
  • Make it so that the dots bounce when they are half the squares width away from an object, or;
  • Change the squares collision bounds (Actor > Collision) so that it travels half-way through a wall before rebounding.
Of course, some combination of this would also work and perhaps look a bit smoother.


Tell me if this didn't make sense,
Annulus

9
Stencyl has 32 available sound channels. Using the block starts playing your chosen sound on the next available channel while stops what the chosen channel is playing and starts playing the new sound.

Basically, if you have your games normal background sound playing, and then you start trying to play a battle sound using , they will both play at once; which doesn't work. Imagine listening to all of the Pokemon soundtracks at once, it would be confusing and annoying.
Using channels (numbered 0 - 31) you could have your games background music on channel 0. Whenever the background music changes you would start playing a new sound on channel 0, and the normal background music would be stopped so that the new music plays without interruption.

There is more (and better) information on the Channels section of the Playing Sounds & Music Stencylpedia article.


The use of a sound channel attribute was arbitrarily used to represent the channel that you have the music playing on. But it would also be useful to make sure the music is always playing on the same channel (if you used a global attribute to set it to a specific channel for the entire game).

10
Ask a Question / Using the Windows Save As and Open Dialogs
« on: June 09, 2017, 04:39:51 pm »
Dear Forum,

I'm working on a project, and one of the features of this project is the ability for the user to export what they have made as a PNG or as a file to share. Until now I've been using the Extenal Data Extension to save things in the projects files (I'm using Windows), but every program I've seen uses Save As and Open dialogs provided by the operating system. I feel like it would be really useful for me to use these as well.

I've tried doing some research, but this is all honestly way above my level. I'd love to learn how to do this, if I can learn how to do it in haxe I can use the custom code blocks, so if anyone has information would they be able to share it with me?

I'm using Windows 10, but if possible I'd also like to use the dialogues in Mac and Linux (I can change a global attribute for each build so that the behaviour uses the right one).


Thank you,
Annulus

11
Chit-Chat / How to change the names of global attributes.
« on: May 12, 2017, 07:00:17 am »
Dear Forum,

So I've seen a few questions about how to change the names of global attributes, and its something I've needed to do a couple times before myself as well. I figured out how to do it, so I thought I would put it up here in case anyone needed it.

Please note: As far as I know, this only works on the Windows version of Stencyl and is correct as of build 9300.

  • Make sure all Stencyl programs are closed and all of your work is backed up. All of your work SHOULD be backup up anyway (File > Export Game...) but needless to say (even though I've barely tested this at all so far) you should not try to be modifying your game and messing with game files at the same time.
  • Press [Windows Key].
  • Type %appdata%, and press [Enter].
  • Open the file path Stencyl\stencylworks\games\<your project name>.
  • Open the file game.xml in notepad, wordpad, or another similar program if you prefer.
  • Scroll down. Eventually you will get to a line which has only <attributes> written in it.

Each line between <attributes> and </attributes> is a different game attribute you have saved and seems to be in the format
    <a cid="b" id="c" name="d" save="e" value="f"/>
where
  • a is the attribute type (number, text, boolean, list, map).
  • b I have no clue about, its always -1 for me.
  • c is the identification of the global attribute, I assume this is what behaviours use to refer to global attributes, and it iterates from zero up.
  • d is the name of the attribute. This can be changed to whatever you want (presumebly as long as another global attribute with the same name doesn't already exist) and it will update the name in all behaviours after saving and closing the game.xml file for the next time you open Stencyl.
  • e is whether or not the global attribute can be saved with the Save Game block. true by default, but change at your own risk.
  • f is the initial value of the global attribute and should correspond to the attribute type.

Well, hopefully this is useful to someone. Once again, I've barely played around with it at all so make sure to backup your stuff constantly, otherwise go nuts.


Thank you,
Annulus

12
Ask a Question / Re: Can't move actor in the Y coordinate
« on: February 09, 2017, 08:10:44 pm »
Hmm, that seems a bit interesting.

Could I suggest using the block under Actors > Motion? Motion works in number * 10 pixels per second, so for the actor to move 100 pixels per second you would set the x/y speed to 10.

The attached image is what I would recommend. Create an Actor Variable called 'Player 1' and then set it to the actor you have named Player 1, then just change the speeds and let the script do the rest. The image was a bit clipped of there the Actor Variable gets placed though.

13
I would suggest rounding the HP attribute after each decrement.

14
Have you tried Physics > General > What kind of Actor Type? > Cannot be pushed (e.g. platforms)? In my experience that stops them from moving each other around but they can still report if they've made contact.

15
Ask a Question / Re: Simple physics: bounce off from collision?
« on: December 07, 2016, 12:14:45 am »
Dear Tikikala,


You might be able to use this (see attached); its not very versatile, but it should be at least part of what you need. It should be wrapped inside of a Collision Event.

The Bounciness attribute changes how much of the actors original x-speed is turned around. At 0.5, the actor bounces off at half-speed; at 2, the actor bounces off at twice the speed.

Pages: 1 2 3