4ror's Forum Posts

  • This is perfect, just what I was after!

  • 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
    > 
    
  • 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
    
  • hi UberLou,

    Just reading Retro Gamer mag this morning and wondered how a fighter game could be made in construct...will be watching with interest!

  • Hi,

    How do you save private variables for sprites that are part of the family?

    I'm creating a sprite formation editor that will eventually hold PV�s to determine the behaviour of any sprite after loading data from external files at runtime. This will save me masses amount of time.

    I�m having a hard time trying to save and load PV�s with the associated object array. Much like the level editor it will save/load XY positions. Trying to save various PV�s into number and string arrays but don�t know how to reassign them to indexed sprites. Sprites will have differing variable values and don't want to assign all the objects the same value...unless there�s another way I�ve completely over looked about how to approach this?

    Thanks for any ideas

  • I reinstalled everything and downloaded the editor again and its working. Thanks for your help

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hi tulamide, Yeah been through the whole thread and tried that version as well. I keep getting a runtime error.

    ---------------------------

    Runtime error

    ---------------------------

    A crash inside a plugin's action has been intercepted! This may be a bug in the plugin, or a problem in Construct. The application has exited. Available details of the location of the problem are below (this may be approximate).

    Plugin: s.csx

    Object name: S

    Event 1 in event sheet 'Layout 1 events'

    Action: 3

    Instance: 1 (of 1)

    ---------------------------

    OK

    ---------------------------

    deleting action 3 the game runs but minus level

  • Hi Lucid,

    I installed your plug-in and the first set of tuts work nicely but the level editor crashes every time I run the layout which is a shame since your plug-in looks to be exactly what I'm after. I installed 99.62 and 99.84 builds of construct and various s plug-in downloads from your plug-in thread, but no joy with getting the level editor work. Any ideas?

  • Thanks lucid, I will take a look at your plugin.

  • Hi All

    I�ve looked through the forum and was wondering what the best approach to achieve the following.

    I�m attempting to write a small formation editor to record x,y Sprites values for a game I�m writing and was wondering what the best format to write the data back to, array's, or ini files? The editor will eventually save x,y positions of a sprite and reuse this data at runtime on different sprites. A typicall level will require quite a bit of data recall to position different sprites at various posistions on a level. Would you use one array ini file for lots of data, or would you use multiple arrays or ini files? What would be considered an efficient method to save this data?

    Thanks

    Rich

  • Thanks R0J0hound that looks just like what I'm after. Keep up the great effort with your plug-in. Hope it becomes a permanent feature.

  • Hi. Great plug-in, I hope to be using quite a bit in my project.

    One problem I�ve not been able to solve. How do you mirror a path either horizontally or vertically? For example I have several sprites moving along a drawn path, moving from top right to the bottom left of the screen. I would like to move another set of sprites from the bottom right to the top left at the same time. I�ve tried rotating and reversing the sprite but each time the second set of sprites keep to the original path. Redrawing the path and saving it out may be an option but i want to keep it as symmetric as possible.

    Would be great to have a mirror horiz/Vert option?

    Cheers

  • Thank you both i will rework what i've done.

    Apologies for the typos before, had written my question from a mobile phone!

  • Hi Tulamide, I like the your deceleration control, this is an interesting feature I hadn't thought about. I also like Uberlou's method by way of increasing the distance the mouse pointer has to move away from the sprite before the sprite will start to follow the mouse. This will help reduce 'slight' or unwanted mouse gestures, whereas, 'purposeful' or long mouse movement is key to the control system I want to achieve.

    Happy days, thank you both again!

  • Hi,

    I'm new to construct and only been using it a few weeks but I'm slowly making progress each week. I have another question which I have searched the forum all afternoon but couldn't find an obvious answer. So the question is...

    Think of a side-scroller, space shoot'n'up and one common occurrence are asteroids flying from the right to the left side if the screen. I have set up random sprites to float across the screen using a combination of bullet behaviour with random speeds. However spinning asteroids present the problem of when you change the rotational angle of the sprites it drastically changes the bullet direction (spin round in circles kind of thing). To get round this I created dummy sprites that use bullet behaviour and now I'm trying to set the XY position of the actual asteroid graphic on top of the dummy bullet sprite using the always condition to track position, however the set position sort of works, I get multiple asteroid sprites on top of each other. The other problem is tracking all the asteroids sprites! There's only ever about 15 sprites on screen at any one time. I don't know how to destroy the asteroids sprites because I�m not sure how to identify which sprite is which. If I destroy 'asteroid sprite' they all disappear.

    Any ideas?