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 - Sunflower

Pages: 1 ... 33 34 35 36 37 38
Ask a Question / Re: Scoring?
« on: July 28, 2011, 10:40:58 am »
Yes, block for setting score, as well as drawing it seems correct, though you need to use violet (Game Attribute) block in "Add Score" thingy, rather than blue (behavior Attribute) one.

Though now that I think of it "when created" block worries me. I'm just not sure if you want the score to be restarted every time scene begins. But if you want that, I think that's fine, then. O.o

Ask a Question / Re: Scoring?
« on: July 28, 2011, 09:14:59 am »
1. Go to Game Center.
2. Find "Game Settings" menu.
3. Find there "Attributes" tab and enter it.
4. Click on "Create New" button (which is on the right, just below the tabs bar, where Game Center tab is). Before that, you may want to check out "What are Game Attributes" buttons, which says that:
Game Attributes are global, persistent values that are suitable for tracking high scores, statistics and game save data.
5. Name it as "Score" and set as "Number".
6. Enter any behavior.
7. Enter "Palette >> Attributes >> Global Attributes".
There are blocks for getting and changing global attributes. Note that value of this attribute is kept between levels!

Old Bugs (1.x/2.x) / Re: Can't set attribute in other behavior!
« on: July 28, 2011, 09:01:20 am »
Well, yes, I can rename the Attribute itself to be "Attribute" rather than "_Attribute", but that's not the point. -. -.'

Look at the image I've attached. I made behavior "z" with attribute, which had internal name "Rofl" and design name: "Lol".
Then, I used another behavior to always set behavior value from "z" first to "rofl", and then print it with "a: " prefix, then set it to "lol", and print it with "b: " prefix. You can see it at the lower part of image. At the higher part there are prints from console which prove that:
- setting attribute described as "Rofl" works
- getting attribute described as "Rofl" works, too
- setting attribute described as "Lol" doesn't work...
- ...but getting attribute described as "Lol" works, anyway!

Having two similar founctions, from which one accepts both forms, and another one only one of these, is quite confusing. Especially when you try to have two attributes: one with "Rofl" internal and "Lol" external and another with "Lol" internal and "Rofl" external (which is entirely possible).
That's why, in my opinion, getter shouldn't accept external names, and by external I don't mean names without underlines at the beginning. By external I mean exactly external!

(and don't try to tell me that Luyren wasn't referring to the thing I considered as bug; because looking from his post, his point wasn't that attribute name can be changed; he rather meant that there's nothing wrong with function accepting text not underlined at the beginning, at least that looked so for me ^^')

Old Bugs (1.x/2.x) / Re: Can't set attribute in other behavior!
« on: July 28, 2011, 08:09:36 am »
No, I mean that if internal name is "_Attribute" and design name is "Attribute", then:
 - setter accepts "_Attribute", but doesn't accept "Attribute"
 - getter accepts both "_Attribute" and "Attribute"
It's much more intuitive when setter and getter accept exactly the same things, I think. ^^'

Shared Resources / Text Box behavior (updated 10th March 2012!)
« on: July 28, 2011, 08:03:43 am »
--- Important! ---
A beta of improved version of Text Box (to be found in "Text Box Extended Pack" on Forge) is out. Please check it, especially since it contains new features, as improved tagging system, new alignment options and spacing and it's generally tw... twen... (*succesfull roll on Will check*) twentyonepercentcooler!!1 :D
/// Important! ///

(original post begins here)
So, after hours of intense work I've finally managed to make not one and only anymore*
Text Box behavior

Here's the test of this behavior, as well as others, expanding the possibilities of the original one: [LINK]

Having this behavior attached to an actor, you can:
  • define the maximum width of text
  • set the number of lines shown at once, as well as single line height (when there are more lines, there's function which allows you to define from which line it should start drawing)
  • align it horizontally and vertically (vertical align only works when text contains less lines overall than can be shown)
  • change font in the middle of text (note that there are only open tags; when you want to return to default formatting, you just type [ default ]); if you want to make a new tag, you should use define as custom block
  • use any characters as opening and closing bracket for tags, as well as you can use any text as newline (it shouldn't contain these brackets, though)

However, you cannot set the colours for fonts. I mean, if you want to use other coloured font, you should duplicate base one and set new colour in resource. It's because drawing fonts with colour other than their own seems to take much more time to render (about 2-3 times more, apparently O.o).

Special thanks for Justin, who've managed to recover the behavior after I couldn't open it for some strange reason. Without that... well, without that I'd probably do it again, anyway, but before that I'd probably bite everyone in their ankles, so yes, that's a good thing that it was recovered.

Pack containing the behavior itself, as well as testing behavior with fonts it uses are to be found on Stencyl Forge as Text Box Pack.
Behavior itself can be found as Text Box.
I recommend checking out the pack first; behavior was placed there so that someone who already knows how to use it wouldn't have to download the whole package.

Any suggestions? ;)

*see also different behaviors from Text Box series; to be found on Forge as:
TxBx Colour

Old Bugs (1.x/2.x) / Re: Can't set attribute in other behavior!
« on: July 28, 2011, 06:50:59 am »
Oh well, I wasn't using this one. Now I tried it and it actually works.

(though still, I think that the fact that getter accepts non-internal name is kind of bug, too)

Old Bugs (1.x/2.x) / Can't upload to Forge?
« on: July 28, 2011, 06:10:30 am »
So, I was trying to upload my "Text Box Behavior Pack" (to be found at Forge), and, theoretically, it was uploaded. The image is showing, there are no question marks etc. However, when I try to download it, it says me that "connection was aborted or resource wasn't uploaded fully". Also, it happens to other users, too. I've tried to upload it and re-download about 5 times, neither of these worked. :(

Alright, I've managed to upload 2 behaviors and 4 fonts without an actor, who wasn't that important, anyway. Though it still bothers me why this actor couldn't be uploaded (I tried uploading actor itself, too, and it was actually marked as not fully uploaded, with this question mark). Well, maybe it has something to do with my Internet connection... O.o

So, in "Messaging" section there is function: "for [actor], set [attribute] to [value] for behavior [behavior]". Nice and all, but this doesn't work for me. In console it says that "Attribute [put name here] doesn't exist for [behavior]", although I use exactly the same behavior and attribute names in attribute getter (and it works). Seems like more general issue rather than typo or something like that.

Oh, and yes, I put there correct type of value (number, to be more precise), so it shouldn't be an issue, either. O.o

Resolved Questions / Re: Unexpected incompatible block combination
« on: July 28, 2011, 01:15:16 am »
Well, if something doesn't work, it's good to check logs first. Are there any errors?

Also, are you sure that existing message (such as "pH") is stored in this item in list?

Maybe try doing a print of item #0 in "itemID" and see if it's correct message? O.o

Shared Resources / Re: Snake Engine kit! (previously: Snake Movement)
« on: July 28, 2011, 01:02:02 am »
If you mean these numbers and letters, go to "Init" scene behavior and move the whole block out of 'when drawing". Generally, it's supposed to be there when something looks suspiciously (like, fruit appears where the snake body is) to check if collision map is working properly (since it allows you to check collision map in real time).

If you mean graphics... well, it's just an example, after all. ;) I haven't said that I'm the best graphic artist in the world.

Suggestion Archives / Re: Mini-Suggestion Thread
« on: July 27, 2011, 04:06:19 pm »
I'd suggest making a "print" and "comment" blocks different-coloured, as they both are in "Debug" section and they're easy to mistake. As we know, we don't want random prints, especially in "always" blocks, so it despite being mini-suggestion is actually quite significant. ;)

Shared Resources / Re: Snake Engine kit! (previously: Snake Movement)
« on: July 27, 2011, 03:54:11 pm »
Well, by "tiled" collision I rather mean that collision checks are done for fields in a grid rather than for collision boxes themselves. When you think about this system, you should completely stop thinking about "Actors", "Tiles" et al. If you look closer at that behavior, you may see that it's based on something which is called "Collision Map". Generally, it says which object stands on which tile.

If you look closer at those functions, you will see that characters are used as arguments there rather than actors. If you run the game, you will probably see those characters at proper fields (if I remember, I haven't moved debug drawing away from there, after all ^^').

Gah, it's not that I put a minus sign or character somewhere. It's just that I use minus key at all!

Anyway, I did a little test, with this in "always" block:
if <[Fail][was pressed]>
  print [Success]
(please don't comment my choice of print messages and keys names O.o)

After changing a key for "Fail", I've discovered that following keys don't work:
 - minus sign
 - equal sign
 - open bracket
 - close bracket
With any of those being in "always" block check game spams me with prints:
Error in always for behavior DoSomething
ERROR: null object

Exactly as if those keys were treated as nulls. O.o

So... I was working on my precious text formatting behavior and made most of its functionality. I started making a block which would allow me to resize the text box. I mistakenly swapped two arguments, so I edited them and tried to refresh the behavior. But... it couldn't refresh. I restarted Stencyl. It still couldn't open the behavior! I restarted computer! And it's still not working!

However, whatever was already set in this behavior is working properly (when I run the game, it works as it's expected), it's just that behavior itself can't open. Which is serious, yes, as I cannot edit anything there, neither I can copy/paste some blocks. Also, after another attempt a message saying that "Couldn't update Stencyl Works to another version" or something appeared, even if I wasn't updating it at all. O.o

Anyway, I've attached a screen of logs, which I had during the behavior opening. The part which appeared after trying to open the behavior is [LOG] with something about ArrayIndexOutOfBounds. After that there was a short break before adding next logs.

--- EDIT ---
If anybody is interested in trying to open this behavior (maybe someone will even manage to do that? O.o), it's in Forge as Text Box Pack.
(oh, apparently I've mistaken "print" with "comment" again, looking at logs; *sigh* I can't even remove that >_<)

--- EDIT 2 ---
Alright, finally, thanks to Justin, the behavior was retrieved. There were still some things missing, but I've managed to get it to work as it was supposed to. However, I won't say the problem is solved; something caused it to occur, after all!

Archives / Re: index of [anything] in [list]
« on: July 27, 2011, 09:52:55 am »
Hooray! That means that my finding index system is probably correct! (yes, we have everything except arguments names the same; but thanks, anyway ^^)

But yes, as coleislazy said, it's strange that there isn't built-in block for that. And it's even more strange that there's block which requires using this functionality ("remove [item] from [ list ]", to be more precise).
Oh, and since it was mentioned, multi-dimensional arrays system would be nice, too. O.o

Pages: 1 ... 33 34 35 36 37 38