Pecek's Forum Posts

  • Well, the title says everything. I tried to load and append data to a hashtable, but it didnt loaded anything at all. Am I doing something wrong, or this is an issue with the hashtable?

    Edit:

    The file is exists, and I can load it if I don't try to append.

  • If I'm correct, the system's load\save action is only loading\saving private\global variables, and other values of objects, so you have to go to the given layout manually. If you try to load (for example) sprite1 on the menu, but on that layout there isnt a sprite1 object, construct may crash.

  • the load action only works on the same layout. So you have to go to your layout and then load the data - except if you have all of the saved objects on this layout as well, but I guess this is a menu or something, so this will probably solve the problem.

    If I misunderstood you, post the cap please.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • The most simple way to achieve this is something like

    + Player: Player overlaps MovingPlatform

    + MovingPlatform: Pick closest to: Player.X, Player.Y

    -> Player: Set angle to MovingPlatform.Angle

    But this only looks good if the player can't go to the opposite direction.

  • 20 ~ this is the default x coordinate.

    32*loopindex ~ when you create the first platform, it will be 0, the second will be 32 and so on. I guess he used 32 because the object is 32 pixel wide, you can increase\decrease this number to set an offset.

    The 300 is the y coordinate.

    So when you check the loopindex, you get a number which tells you how many times the loop was done.

  • There is a default system expression for the rotation(system-math-rotate angle.) It'll find the shortest "way" between two angles, so you don't have to worry about the 0-360 problem.

    When the player is in the air you can set the correct angle by checking it's velocity - note: you should not check it for lower\higher than 0, use -1 and 1 instead.

  • Step1: put the particles and the bullet_1 object in a container [groups->container]

    Step2: delete this line

    -> bullet_1: Spawn object Particles on layer 1 (image point 0)

    Step3: forget about these sharing sites, and install dropbox.

  • This isnt construct specific..

    en.wikipedia.org/wiki/Sudoku_algorithms

  • As far as I know, in most of the cases the events and python are running at the same speed, because both of them calling functions that were written in c++(like the system object's "create" function, or the sprite object's "setvalue".)

    I think you probably calling the python functions too often, that may lead to performance issues.

    Post the cap, or at least a shot of it, I can't help you without knowing the exact problem.

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

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