dop2000's Forum Posts

  • You do not have permission to view this post

  • I wanna use the UID from the array to grab the object to move it and such

    You really should avoid storing UIDs in the array. UIDs are assigned dynamically and can change if you destroy/create objects in runtime or even in the editor.

    .

    I assume you want to spawn different bullets for different weapons, with different properties. Is this right?

    There are many ways to do this. The easiest would be to use templates: create a template for each bullet type, configure all properties directly on the bullet sprite (speed, animation, damage value etc.) Then spawn the bullet sprite by template name. You won't need any arrays or scripts.

    Here is a demo

  • You do not have permission to view this post

  • lepr like that is supposed to be run continuously, on every tick.

    "On key pressed" is a triggered event, it happens once, that's why your object only moves a tiny bit. Besides, you must use dt in lerp expression if you want it to work correctly at different framerates.

    You can change your code like this:

    On Q pressed: Set Action to true
    
    System is Action: dot set position to (lerp.....
    

    But you also need the way to stop the lerp when the dot reaches the player, otherwise it will be chasing it forever.

    I suggest using MoveTo or Tween behavior instead, it will be much easier.

  • A) Input lag is 2 frames at 60hz. I conclude this by storing the previous mouse coordinates one frame back and extrapolating forward 2x that distance.

    Can you share this test project?

  • Hitdistance would return 0 when the ray doesn't hit anything. Check that there are in fact obstacles and that you've configured them correctly in LOS behavior.

    Or maybe the ray hits the player object itself, or some other object attached to the player.

    It's difficult to speculate without the project file.

  • How do you know it doesn't work? The expressions look correct to me.

    Instead of raycasting, try spawning a test sprite at those coordinates and check if it appears in the expected location.

  • I am not sure what you mean. I just tested (sprite set position to mouse.x/y) and the lag is barely noticeable at 60 fps. At higher fps there is practically no lag at all.

    In any case the lag can't be more than the duration of one frame, 0.016s at 60 fps.

    Does it happen in a blank project?

  • That's not a good solution, because if you press+release W key repeatedly roughly once per second, the speed will still increase.

    If you need to increase the speed by 10 for every second the key is held continuously, you can do this:

    Global variable startTime=0
    
    On W pressed: Set startTime to time
    
    On W released: Set startTime to 0
    
    On every tick
    startTime>0 : Set speed to initialSpeed + int(startTime)*10
    

    Or use the Timer behavior. On W pressed start a repeating timer for 1 second. On released - stop the timer. In "On timer" event increase the speed.

  • You need to check out a few examples and tutorials. In C3 you can create big and complex games 100% with events. Scripting is rarely needed.

    There are 3 different ways you can pick up an instance by UID:

    Sprite/Family: Pick by unique ID

    System: Pick by evaluate

    System: Pick by comparison

    .

    Can you explain the task? You need to spawn a specific type of bullet based on .. what?

  • It would be necessary that when the triangle rotates even hypothetically 180 degrees, it should be able to communicate its speed to continue its course.

    Can you explain what you mean? If it travels North, and then rotates 90 degrees clockwise, should it now travel West? Or continue flying North, but sideways?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I believe this may be possible in a web game, if both applications are hosted on the same server. You need to set the same "uniqueId" for both projects in project.c3proj file. Then they both will share the same storage.

  • Your event runs on every tick, which means 60 times per second or even faster. The easiest solution is to add another condition like "Every 0.5 second" to it.

    Also, instead of destroying and spawning the arrow all the time, simply move it to the next option.

  • Try changing the file extension. If you set the filename to something like "myArray.dat", it should not open automatically.

    You can also try "Browser Invoke Download of String" action to download Array.AsJSON

  • You can spawn a triangle, but avoid using other behaviors like Pin with physics objects. Also, avoid using non-physics actions like directly changing object angle or position. See the manual for more info.

    I don't know how to apply a force in the direction of movement and then rotate the triangle with forces.

    You can use "Apply force at angle" to propel forward.

    There are several ways to rotate, you can apply angular velocity or torque, or apply force to different points of the object.