'S' update as of 4/12/11

This forum is currently in read-only mode.
From the Asset Store
Wasteland Blues
$16.10 USD
30% off
A post apocalyptic music pack with 12 main themes and 12 in-game loops
  • 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

    http://dl.dropbox.com/u/1013446/Plugins.rar

    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

  • 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 I?m struggling with now.

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

    Thanks for any guidance.

    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
    
  • The new "is contained in"-expression is great, but now I have a small problem.

    My code at the moment is like this:

    + 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?
  • yeah, use the search expression for the range to get the first instance

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

    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 ????.
  • 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...

  • You can't copyright fluid dynamics.=/ Just about every high-end 3D Program has fluid dynamics. Even Blender.

  • 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...

  • 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.

    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 I?m struggling with now.

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

    Thanks for any guidance.

    >

    >

    >

    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
    > 
    
  • Ignore my previous complaint about the "basic stuff causes crashes" thing, I was doing it wrong, but the tutorials still crash.

  • Sorry for the double post, but I seriously believe I've found a major bug in the latest version of S. I've been trying to pick out indexes in base Supers, such as {"Party Members", 1, "Name"}, but every time I do, Construct crashes. This doesn't happen for supers inside those supers, such as {"Party Members", "Member", 1, "Name"}. It basically results in forcing the user to be redundant with their supers, when you shouldn't need to be.

    Fix, plz.

  • Hmmm. Ill take a look when I get home. In the meantime if you can get the debugger to give a message(the s debugger actions, not the regular construct debugger). I might be able to figure it out with those, and if it crashes before the debugger can figure out why, it'll almost guarantee it is an s problem and not a user error

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • ... What. You have to make arrays for every index of the super you want to make it actually work? That's something I wanted to avoid having to do, to be quite frank. I don't see the point of it, it's just redundant.

  • if what you're asking is what I think you're asking, you may be looking for templates

    when you make an array of anything you can set a default for new array values

    templates are the defaults for super arrays

    in the example cap I didn't use a template because I wasn't sure if you knew about them

    but in this case you would say

    Action : Create Template

    template name "coord"

    add number array to {"t","coord"} "x" with default 0

    add number array to {"t","coord"} "y" with default 0

    the "t" as the first part of the address tells s you're adding to a special template super and not a regular super in your whole data structure

    you can use these as you can any other super, adding other supers inside if you wish, etc

    now when you create a super array you can do

    create super array "mycoords" with default "coord"

    now each time you add a super, it will already have the "x" and "y" arrays in it

    you can even fill the arrays with values in the templates if you wish, so each new super will be preloaded with preset values

    it may not seem immediately evident now, but there may be cases where you don't want the second super in an array to be exactly like the first, and vice versa, templates give you the ability to decide what goes in every super, without forcing you to put the same arrays in each one

    a few things of note, don't add objects into the templates, because object pointers change each time the program starts, so they would be invalid, you can add object types though. when you save and load supers to disk, you have the option to save your template data too. also, unlike arrays of anything else you can't access a super array outside of range and get the default

    meaning if your array has 5 supers you cant try to access index 9, and get access to the templates

    it really wouldn't make any logical sense anyway. but just so you know

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)