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.


Topics - Annulus Industries

Pages: 1
1
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.

2
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

3
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

4
Dear Forum,


I'm splitting up one of my projects into separate parts to make things easier to manage, and something I've done is created a behaviour for several general scripts and attached it to the actors that the scripts belonged to. To those original actors, I placed some {For [Actor], set [Attribute] to [Anything] for behaviour [Behaviour]} (hyperlinked) blocks and attached everything needed by selecting the first blank and scrolling though the menu.
Attached is an example of what I've attempted. I've also tried setting _ID directly to the X of the actor and just to a static value, but for some reason it never has an effect when I test the project.


What is it I'm doing wrong, and how can I fix it?

Thank you,
Annulus

5
Dear Forum,


For a project of mine I'm using the slide up/down/left/right scene transition block, which is all fine it works like its supposed to, but when the scene transitions all of the animations on the initial scene pause.
I'm wondering if there is a way to stop the actors from pausing like they do so that the animation continues until the actor leaves the scene. Is there a way to do this?


If anyone has any suggestions I would like to hear them.

Thank you,
Annulus

6
Ask a Question / Building to and Testing on Android Error
« on: November 23, 2016, 03:34:32 am »
Dear Forum,


I've been having this problem for awhile now, but I have a program and can test it on Flash without any problems. However, when I try to test it on Android, it compiles for about 10-15 minutes before "Sending to Device" for the same amount of time and then coming up with an error message.
I've tried uninstalling and reinstalling the Java JDK and Android SDK, and I've cleaned the project, reinstalled Stencyl itself, and I've checked to make sure my phone has USB debuggin turned on and is connected as an installer.

The problem hasn't been fixed though and its become slightly irritating, does anyone know what I should try next?


Thank you,
Annulus

7
Ask a Question / Font Blur Effect causing 'boxes'
« on: November 23, 2016, 12:17:52 am »
Dear Forum,


I'm wondering about the option to blur a font under Dashboard > Fonts > {font} > Effect > Shadow > Blur. For some reason, in the display window next to the font editor the letters seem fine (I'm using Typwriter Bold at 30px with smoothing enabled), but when I test the project there are strange 'boxes' around the letters.
The attached images show the letters at blur levels of 0 and 4, I'm wondering why this is happening and what I can do to remove the boxes and fix it. I'm using Stencyl Build 9281.


Thank you,
Annulus

8
Ask a Question / Saving Failure upon Restart of Device
« on: October 10, 2016, 01:24:45 am »
Dear Forum,

Hello, I'm having an issue with the save function on a mobile app that I created.
When the game ends, the block |save game and then...| runs and the scene transitions afterwards. For some reason though, the global variables aren't saved, and when the app is force-stopped or if I restart my phone the variables are back to their defaults.


This is fairly game-breaking and I would like to fix it as soon as possible, so if anyone has a reason for why this may be happening and how to repair it (or if I'm using saving improperly and someone can tell me what I'm doing wrong) I would greatly appreciate your response.

Thank you,
Annulus

Pages: 1