'S' update as of 4/12/11

New releases and general discussions.

Post » Tue Jun 15, 2010 9:36 pm

You said in IRC that there's a new version of S that includes search expressions for easy index referring without the need for extensive "for each" looping.

Can you upload it, pretty please?
B
16
S
8
G
4
Posts: 136
Reputation: 3,144

Post » Wed Jun 16, 2010 3:00 am

hey
here ya go
please please please save your current version of s
I haven't tested this quick build I did
I had to remove some features on the spur of the moment, the fluid dynamics one due to copyright issues with autodesk, and there was some apparent slight file corruption stuff going on, but I do think it should work fine. just keep a backup of your current s version, and don't worry, if there is a problem, I'll be able to fix it in a rebuild. just test your current cap, and make sure it doesn't break with this version

[url:w2es5nxm]http://dl.dropbox.com/u/1013446/Plugins.rar[/url:w2es5nxm]


EDIT: k, just tested it with some of the tutorials and it seems fine
there's probably some more stuff I forgot about already,
but as far as the search functions
there is a is object contained in array condition like:
on collision with sprite-
-----if sprite is contained in {"best not bump into me again"}
------------destroy sprite

the expressions that search have the value to search for, the array of course, the starting index, so you can search from the middle of the array, or do several searches, because the value returned is the index of the first time it finds the value, if it occurs more than once, you won't find it, unless you start from an index after the first found one

unfortunately, although I do believe the catmull rom interpolation stuff is complete and working, I don't remember for sure if all those variations were ever finalized. remember, this is a version of s I was experimenting with and adding onto while working on something else, it wasn't necessarily ready for primetime, but I do remember using it alot, so I think everything in there works. please report any glitchy nonsense
Spriter Dev
B
87
S
21
G
12
Posts: 3,240
Reputation: 16,461

Post » Wed Jun 16, 2010 10:45 am

Thanks Lucid, that really helped me a lot. It also opened a whole new can of worms such as saving different patterns of spites for a level in a new array and saving loading these, I will keep persevering.

Actually may as well ask this question what would be an efficient method to save these sprite X,Y position values into different group of arrays.

i.e.
Group1 has x number sprites in XY location
Group2 has x number sprites in XY locations
...and so on.

To further explain, your map editor helps with the saving and loading sprites but what about when you have different sprite layouts that will be triggered by different conditions at runtime..So eventually Group2 is trigger when a certain X postion of another sprite is met for example. This is what Im struggling with now.

I think when I get my head round this then the rest should fall into place.

Thanks for any guidance.


[quote="lucid":2cl62cwh]

[code:2cl62cwh]for each object in array (pick current)
add your pv to the "end" of your private variable array

upon loading all sprites to new instances
for each string (or number) in your private variable array (let's say this loop is called "myloop")
-----pick {"yourobjectarray",.li("myloop")} as yourFamily
-----set yourFamily's PV to .n({"yourprivatevariablearray",.li("myloop")})[/code:2cl62cwh]
that should assign each sprite with the original private variable it had, regardless of what type of sprite as long as it was a member of yourFamily

alternatively, once you're fairly comfortable with the 's', depending on what pv features you do and don't need, you may consider not using PVs at all, and just using 's' arrays to begin with. but the above solution would work.

let me know if my pseudocode made no sense, and I'll go into more detail[/quote:2cl62cwh]
My Games on google play

ImageImage
B
30
S
6
G
4
Posts: 97
Reputation: 3,008

Post » Tue Jun 22, 2010 6:38 pm

The new "is contained in"-expression is great, but now I have a small problem.

My code at the moment is like this:

[code:20rfpigi]+ MouseKeyboard: On Left Clicked on Blue
++ S: [negated] Object "Blue" is contained in {"selobjs"}
--> S: insert object Blue to {"selobjs"} at "end"
+ MouseKeyboard: On Right Clicked on Blue
++ S: Object "Blue" is contained in {"selobjs"}
--> S: Delete Object {"selobjs"}[/code:20rfpigi]

Now, the problem is that I can't get the Delete Object action to do what I want, since I have no idea what to put in the range. Is there any way to get the range values of picked objects or something? Or do I need to resort to some sort of painstaking for each -loop once again?
B
16
S
8
G
4
Posts: 136
Reputation: 3,144

Post » Tue Jun 22, 2010 9:33 pm

yeah, use the search expression for the range to get the first instance
Spriter Dev
B
87
S
21
G
12
Posts: 3,240
Reputation: 16,461

Post » Tue Jun 22, 2010 9:57 pm

But how do I use the search expression in this case? I have no idea what to put to the searched value.

[code:3seysx7k]S.FO({"selobjs"},????,0)[/code:3seysx7k]
The hell am I supposed to put there? There's no kind of "picked object" expression to use.

EDIT: Solved on IRC, I just had to use "Blue" (the family) in place of ????.
B
16
S
8
G
4
Posts: 136
Reputation: 3,144

Post » Fri Jun 25, 2010 9:44 pm

I know I'm double posting, but this is kinda important so I'm doing it anyway.

Is there some sort of functionality to duplicate an array index to another array? Basically, I've done private variables for objects with 's', and I'd like to duplicate these objects in a way that copies the private variable values over to the new ones as well, but obviously they should still be their own private variables. As far as I can see, the only way would be to individually save every array I want to copy to disk and load them into the new empty arrays, but writing to and reading from disk is horribly slow compared to doing the same in memory, so...
B
16
S
8
G
4
Posts: 136
Reputation: 3,144

Post » Thu Jul 01, 2010 7:53 am

You can't copyright fluid dynamics.=/ Just about every high-end 3D Program has fluid dynamics. Even Blender.
B
11
S
3
G
8
Posts: 473
Reputation: 4,569

Post » Tue Jul 06, 2010 10:40 am

I've been trying out S again, now using the latest build, and pretty much all of the tutorial caps are now crashing. I was also trying to, well, do something as basic as call an index in an array using a variable to try and get a list-based inventory going, yet, well, that crashes Construct as well. I'm not sure whether the new build has screwed up S or it's just me, but...
B
94
S
37
G
11
Posts: 404
Reputation: 11,275

Post » Tue Jul 06, 2010 3:48 pm

I think I've figure out a way to do this using multiple object arrays to organise lots of groups of sprites with associated X,Y coords.

[quote="4ror":23n723dx]Thanks Lucid, that really helped me a lot. It also opened a whole new can of worms such as saving different patterns of spites for a level in a new array and saving loading these, I will keep persevering.

Actually may as well ask this question what would be an efficient method to save these sprite X,Y position values into different group of arrays.

i.e.
Group1 has x number sprites in XY location
Group2 has x number sprites in XY locations
...and so on.

To further explain, your map editor helps with the saving and loading sprites but what about when you have different sprite layouts that will be triggered by different conditions at runtime..So eventually Group2 is trigger when a certain X postion of another sprite is met for example. This is what Im struggling with now.

I think when I get my head round this then the rest should fall into place.

Thanks for any guidance.


[quote="lucid":23n723dx]

[code:23n723dx]for each object in array (pick current)
add your pv to the "end" of your private variable array

upon loading all sprites to new instances
for each string (or number) in your private variable array (let's say this loop is called "myloop")
-----pick {"yourobjectarray",.li("myloop")} as yourFamily
-----set yourFamily's PV to .n({"yourprivatevariablearray",.li("myloop")})[/code:23n723dx]
that should assign each sprite with the original private variable it had, regardless of what type of sprite as long as it was a member of yourFamily

alternatively, once you're fairly comfortable with the 's', depending on what pv features you do and don't need, you may consider not using PVs at all, and just using 's' arrays to begin with. but the above solution would work.

let me know if my pseudocode made no sense, and I'll go into more detail[/quote:23n723dx][/quote:23n723dx]
My Games on google play

ImageImage
B
30
S
6
G
4
Posts: 97
Reputation: 3,008

PreviousNext

Return to Construct Classic Discussion

Who is online

Users browsing this forum: MilkGames and 3 guests