S Plugin...Reliable???

For questions about using Classic.

Post » Thu Mar 24, 2011 1:24 am

Having almost finalised the level format for my side-project, I'm going to be looking to save the level data in a binary format, either encrypted or normal, and I think I remember someone mentioning that the S Plugin is useful in this regard.

I don't have the S Plugin, as I haven't needed it up to now, so I was surprised to see that it wasn't in the list of completed addons.

Which begs the questions;
a) Will the S Plugin do what I need, saving a mixture of numerical and text data to a binary file, and allow me to load it back?

b) Is the S Plugin finished and stable, and can it be relied on in a game?

Krush.
B
2
S
2
G
3
Posts: 406
Reputation: 2,062

Post » Thu Mar 24, 2011 10:06 am

[quote="KrushBrother":3fxpybwm]a) Will the S Plugin do what I need, saving a mixture of numerical and text data to a binary file, and allow me to load it back?[/quote:3fxpybwm]

Yes, the S plugin is the single best choice for the job. I'm mostly using it for the purpose of saving/loading and generally for level editors, which it can simplify enormously. Also it can actually save objects, not only values and strings.

[quote="KrushBrother":3fxpybwm]
b) Is the S Plugin finished and stable, and can it be relied on in a game?[/quote:3fxpybwm]

It's not finished, but in an absolutely useable state, basically like C0.x itself.

You may experience many crashes while trying to get the hang of S. Simply because in case you're trying to manipulate an array that isn't created yet, or misspell the array address, S will simply crash the runtime in most cases.

But in fact I do rely on it in different projects and it works like a charm.

If you carefully look through all the examples and explanations lucid gives in the plugin thread, you should be able to use S in no time. This is a particularly useful post for example:
[url:3fxpybwm]http://www.scirra.com/forum/viewtopic.php?f=2&t=4791&start=40#p38861[/url:3fxpybwm]
B
21
S
6
G
10
Posts: 1,024
Reputation: 7,445

Post » Thu Mar 24, 2011 1:40 pm

Once again, I owe you Pixel.
Thanks.

It's good to know that I should persevere if I get crashes with it, as it could be errors in my code.
Without that knowledge, I would probably blame the plugin, and stop using it.

My level editor has 5 layers, different sprite sheets of 128 sprites for each layer, as well as level name, author name, and other special instructions specific to the level, so cramming all that into one object/file per level sounds just what I'm looking for.

I owe you another pint. :)

Krush.
B
2
S
2
G
3
Posts: 406
Reputation: 2,062

Post » Thu Mar 24, 2011 7:24 pm

thanks for the endorsement pixel. for a while there, no one was using 's' at all, and I thought it was just too weird to be learnable, and I just knew how to do it, because I had made it.

krush, I have almost no plugins I can confidently claim this for, except 's'. it is very stable, I use it in almost every project I make for the the advanced picking features.

It is easy to make it crash, but it's almost always an error like pixel said, where you misspell the name of one of your arrays, or otherwise mess up an 's' command. I warn you though, it's got a learning curve. It changes what's possible to do in construct, the same abilities you have with the c++ sdk as far as object manipulation, so in order to make that work within the confines of a program that wasn't made to work that way, it has to be a little weird. But I've used it in large caps where it used 's' stuff 1000's of times per tick, with zero stability issues.
one of the few things I still have the source code to, also.


one last thing, there is a little known feature that can help you along your way is the debugging features. in start of layout set the debugging output file, and for many crashes it will popup a text file telling you what you did wrong.
Spriter Dev
B
87
S
21
G
12
Posts: 3,240
Reputation: 16,461

Post » Thu Mar 24, 2011 8:51 pm

lucid, I was always taken by 's', using it in a very complex way (and never had issues other than my own mistakes) and encouraged people to at least try to use it. And I always say: "If it crashes it is your own fault." I never experienced any crash that I couldn't solve by carefully looking at what I've done and correct it. 's' is reliable.

It is just a matter of personal preferences, if you use 's' or python. The latter being a lot more beginner friendly, while 's' doesn't force you to embed and ship python with your game.

Just to let you and anybody else know that it is one of the most helpful plugins out there (yes, I think it is even more helpful than the already fantastic MagiCam) :)
Image
B
23
S
8
G
10
Posts: 1,820
Reputation: 8,242

Post » Thu Mar 24, 2011 10:06 pm

Yeah, its reliable, and a ton of useful stuff.
...Actually too much in my opinion. Hell you could have made five or six plugs out of it.
Hope you keep that in mind if you decide to start selling plugs Lucid. :p
Image Image
B
161
S
48
G
90
Posts: 7,347
Reputation: 66,749

Post » Fri Mar 25, 2011 12:27 am

Thanks Lucid.

I've just had a quick look at the tute, and I can see that it's going to be perfect for what I want, and shouldn't be too difficult to use (although I will be making regular saves and backups until I get it working 100% :) )

I wouldn't mind a link to the very latest version though.
I'd hate to download an outdated version that gives me problems. ;)

Krush.
B
2
S
2
G
3
Posts: 406
Reputation: 2,062

Post » Sun Mar 27, 2011 12:38 am

Well, I've had a play around with various tests of saving data, both unencrypted and encrypted, and it looks like it will fit the bill nicely.

I'm now looking at your example of a level editor, before I start adapting my current editor for use with S, but I'm wondering if I am indeed using an older version of S, as I feared in the above post, or whether I'm missing something.



It's the .tt("blue") part of the create object that I can't fathom.
I've tried writing it as an expression, but it won't accept it.

If I have a criticism of S, it's that the description in the editor doesn't match the output text, so when trying to follow a guide like your level editor, it's hard to see which command you're supposed to use.

Anyway, am I using an old version of S, or is there a simple answer to my problem?

Cheers for any help.
Krush.

[color=#BF0000:is5484hi]Edit: Ok, looking at your example cap, I can see that it's S.tt("blue"), which of course makes sense, but it wasn't that clear in the editor with the S icon in-between the S and the .tt. :roll:
Kudos on the plugin though.
The deeper I dig, the more uses I can see for this.
Why didn't I look at this ages ago? lol
[/color:is5484hi]
B
2
S
2
G
3
Posts: 406
Reputation: 2,062

Post » Sun Mar 27, 2011 1:13 am

here's the latest version:
[url:gj2l6dvo]http://dl.dropbox.com/u/1013446/Plugins.rar[/url:gj2l6dvo]

I know it's annoying but I think some of the older tutorial cap files don't work with the latest version, that's why the old link is still on page one. so you kinda upgrade as you progress through tuts... :oops: I had planned to redo them to work with the latest version, but my fulltime job is a hellish oppressive negative force in my life that functions as a sort of time vortex, funneling away all my time, along with most of my freedom, and parts of my soul.

not sure if you were asking what it mean as well, but here goes
tt stands for true type
meaning you have a family called "blue"
that has several objecttypes as members of the family

you can do stuff like add objecttype to objecttype array s.tt("blue")
and instead of adding the type "blue" to the array, it will add the actual type of the object currently selected as blue

it can come in handy in other situations as well. like
on collision with "blue"
---------------do this
---------------do that
---------------system compare s.tt("blue") equals "deathsprite"
------------------------------------------begin fadeout

.....or whatever

oh yeah, you can also use it in non 's' stuff where you can normally pick an object type
like say, you want anything that's a member of "blue" to clone itself when clicked
on click on object "blue"
---system - create object

and instead of using the dropdown list, you right click on the list to choose an object, right click and click 'use expression'
then there you can type s.tt("blue"), and now that object type will be what's created

pretty much anytime you'd want to know the real type of a picked family, you can use it
Spriter Dev
B
87
S
21
G
12
Posts: 3,240
Reputation: 16,461

Post » Sat Apr 02, 2011 12:44 am

Well, I'm still enjoying playing with this, and have managed to get a decent test level editor working, but that was just a way of getting to know the S plugin.

Now I'm ready to start on the level editor for the actual game, I want to approach it a different way.
What I want to do is have Super called "LevelPack" (for instance), and in that Super have many "levels", each of which will comprise of:

2D array1 (32x20) - numerical array
2D array2 (32x20) - numerical array
2D array3 (32x20) - numerical array
2D array4 (32x20) - numerical array
2D array5 (32x20) - numerical array
Level Name - String
etc

In other words, I want to use S like a standard 2d array for the level data, on several layers, along with things like Strings for the title of that level, etc, and have each set of this data in it's own "level" Super, and all the "levels" contained in one "LevelPack" Super, so it can be packed up and encrypted, and when loaded into the game, I can access each set of level data, and read it in a way to build each level when needed.

I can't see any simple way to use S for 2D arrays, or any tutorials on this.
Maybe I'm over-thinking it, and it's right in front of me. :)

Any help appreciated.

Cheers,
Krush.
B
2
S
2
G
3
Posts: 406
Reputation: 2,062

Next

Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 6 guests