Pecek's Recent Forum Activity

  • sorry, my mistake, you only need to define the function at start, after that you shouldnt have any performance issues.

  • You can create objects like this

    System.CreateByName("<sprite's\object's name", layer_num, x pos, y pos)

    after that you can set it's variables like this

    SOL.<sprite's\object's name>.SetValue('<value's name>', <the value>)

    SOL stands for selected objects list, it picks the last created object in this case.

    So your python function should look like this:

    def create_sprite(layer, x, y, var1, var2):

         System.Create("Sprite", layer, x, y)

         SOL.Sprite.SetValue('a', var1)

         SOL.Sprite.SetValue('b', var2)

    etc

    and if you want to call it just insert this line under an event

    create_sprite() - and fill the values of course.

    You can set default values, so if you mostly use a specific layer, variables, etc, than you don't have to specify them over and over, just rewrite the original function like this

    def create_sprite(layer = 1, x = 0, y = 0, var1 = 40, var2 = 20)

    In this way you can spawn another instances by typing just create_sprite().

  • Yeah, python is the same in most of the cases, and if you don't use a function in every tick it's basicly up to you to wich one to use - I usually prefer python, unless I have to create something really quickly.

    If you are not experienced in python, just send me the cap, I can take a look at it later.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Why don't you do this in python? It's a lot more readable, especially if there are plenty of attributes.

    If you are not familiar with python, I can help if you want.

  • I tried it in python

    for i in range(4096):

    Function.AddParam(i)

    I don't think it'll be different if I would use a pv for this, but later I'll try that way.

  • I tried this with 256 param, and it didnt crashed here.

    Edit: I don't see any problems param either, its getting slow, but that's all.

  • Well, I found a workaround for this, it's still not quick enough, but way better than my original solution.

    If someone is intrested in this in the future...

    When you loop through an object's instances in the event editor, it's picking the other objects in the same container, so this way it works.

    + System: For each a

    SOL.b.x = SOL.a.X

    SOL.c.x = SOL.a.X

    etc

    I tried this with 15 object, if I only use events it's running , this way 900-1200fps, and in pure python I got only 200-220fps(ouch).

    Note: these values can be a lot higher(I've got the same fps with the mixed solution when I only checked them every 20-30ticks) if you not loop through all of them every thick, but that is only in option if you don't use vsync of course.

  • + some condition

    -> Sprite: Set angle to Sprite.Value('xx')

    if you want to set a private variable you can do it like this:

    + some condition

    -> Sprite: Set 'xx' to Sprite.Angle

    Or you can do the same in python

    Sprite.SetValue('xx', Sprite.Angle)

    and

    Sprite.SetAngle(Sprite.Value('xx'))

  • Is there any way to go through all of the objects of a given container?

    I did it with nested for loops and some variables, but if there is lots of objects it's slows down as hell of course.

  • If you want the laser looks continous, then you shouldnt spawn them over and over, create just one per "zonenode", and set it's height\width and angle.

    About the object picking. You should use families, if you do so, you can pick two instance in the same expression(so you can set the "start" and the "end" position of your laser.)

    If you only want one laser per instance, just pick the closest object.

    Hope it helped, if not, I can make an example later.

  • I don't care much about safety, if someone want to crack it, then someone will crack it. It's simply a lot cleaner if there is one(or some) files instead of lots of folders and subfolders.

  • I would like to separate the content from the exe, is there any way to load images from a given file? (I want a big .dat file for example, with all of animations, sprites, sounds, etc.)

    I tried the zip plugin, but it looks a bit overkill to me, I mean, I have to extract-load-delete all of the files I want to use, this isn't sounds like a great method of doing this kind of stuff.

Pecek's avatar

Pecek

Member since 2 May, 2011

None one is following Pecek yet!

Connect with Pecek

Trophy Case

  • 13-Year Club
  • Email Verified

Progress

14/44
How to earn trophies