GizmoSP's Recent Forum Activity

  • Delete most of this, create a global variable for position set to 1 by default, then say when Racer crosses the finishing line (lap > 4 ?), set finishing position to global variable and add 1 to global variable. If needed you can also use a condition 'final position = 0' to act as your trigger once, it will only set a position value when it is the default.

    Thank you, I can see how this would work mathematically. Although I am having issues with it.

    I did some debugging and found that PositionCalc (the global variable you told me to make) always ends at 4 at the end of the race for some reason. There seems to be an issue with how the variable gets increased

    ^ How the CPUs get PositionCalc added

    ^ How the Player's PositionCalc gets added

    ^ How the CPUs (the ones who haven't finished the race yet) get their PositionCalc added (should I do it like this? Or should I go back to the original "set Final_Position to Current_Position for these CPUs? Because I'm not sure)

    Anyways I'm still pretty stumped on this, if you or anyone else could help me out still that would be great

  • Hi, I am currently making an F-Zero fangame (a racing game) and am having issues with creating the final position system (finding out whether a racer finished 1st, 2nd, 8th, etc.)

    I've had little issues with getting the player's position to work. I've created this code that triggers when the player crosses the finish line, and it basically counts how many Racers have finished the race in order to determine the player's final positon)

    (Some things to note: The "Racers" family only contains the PlayerMachine and CPU sprites, and "Final_Position" is a family variable. Also the code below continues in the exact same way up until CPU.PickedCount = 14, because this game has 15 racers.)

    I've tried using this same system for the CPUs, although I have to make it using the Racers family rather than just the CPUs, as the CPUs are competing against both each other and the player of course. I also want to implement a system where the boolean variable "FinishedRace" (which is also a "Racers" family variable) becomes true once the player reaches the finish line, making the CPU's final position whatever their current position (CurrentPositon) was in the race.

    But this system has proved to be very glitchy and unreliable with the CPUs. The main problem I'm running into is multiple racers having the same position at the end of the race. The most common one is both a CPU and the player ending with the same Final_Positon, but sometimes multiple CPUs have the same Final_Position as well. My guess as to why this happens for the CPUs is because of this set of code that makes the CPU's final position whatever their current position is when the player crosses the finish line, as mentioned earlier.

    I've been trying to find a way to have two instances of the same sprite compare each other, like having something like:

    If Racers.Final_Position = Racers.Final_Position, then add 1 to Racers.Final_Position

    But obviously that code wouldn't work, as Construct doesn't allow you to compare two of the same families in that way.

    Sorry if I'm not clear about something, but if any of you all could help it would be greatly appreciated! These CPU position bugs have been plaguing my game for a while now

  • So I'm currently working on a racing game, and the final position you score is determined by a family instance variable called Time_Spent_Racing, with the family being called "Racers" containing both the player and the CPUs. Time_Spent_Racing increases by 1 every tick, and the racer with the lowest Time_Spent_Racing gets their Final_Position instance variable set to 1 (1st place), and vice versa for getting last place.

    When a CPU crosses the finish line, their position should be calculated on the spot. If they've not crossed the finish line yet, their position should say "Running..." on the results screen until they've finished the race.

    I need a script that calculates each Racer's Time_Spent_Racing, and then ranking them from lowest to highest and then giving a respective Final_Position number (ie. 1st, 2nd, 3rd, etc.)

    I'm sure there's an easy way to do this, but I just haven't found it yet. If any of you would like me to elaborate further, I can.

    Thanks!

  • If you're saying the problem is when you include the player with CPU, it can be resolved by using a Family for example called 'Racers' that contains the player and CPU, with a family instance variable for position for example Racers.pos

    Hey lionz, sorry for the late reply, but I wanted to ask how exactly I should change my code to account for a family instance variable? Also, should the family instance variable be for the PosScore or the current position?

  • Hello, I am working on a 2D top-down racing game. I've implemented CPU opponents as well as a system for calculating the player's current position (1st, 2nd, etc.) But I've been struggling with how to calculate the CPU's current position.

    The system I made is that each racer (both the player and all of the CPUs) have an instance variable called PosScore. Basically, the higher the PosScore, the further you are in the race. For the player, I can just compare the PosScore against all the other CPU's PosScores in order to calculate your current position. But for the CPUs it's different because I have to compare the PosScore against both the player and all the other CPUs.

    The preferable solution would be for every CPU to have a "CurrentPosition" instance variable that updates accordingly like it does for the player.

    Here's how I'm calculating the PosScore variables for both the CPUs and the player:

  • Hello C3 community,

    I'm currently working on my very own F-Zero fangame (I love the games so much) and I wanted to implement a mechanic where your acceleration decreases as you get faster, to provide a stronger sense of momentum.

    I want to use the Tween behavior to have the acceleration decrease gradually. So I made this script, and it doesn't seem to work properly. The player's acceleration doesn't change at all unless they're boosting. I checked the code and it didn't seem like there were any instances of the acceleration forcing itself to remain at its normal value every tick, so I'm not sure what to do here. Any help or alternative solutions are greatly appreciated!

  • Hey, I've been getting this error message whenever I use Construct 3 for a few seconds or so.

    Here's the information text:

    Error report information

    Type: unhandled exception

    File: editor.construct.net/, line 1, col 196

    Message: Uncaught TypeError: Cannot redefine property: googletag

    Stack: TypeError: Cannot redefine property: googletag at Function.defineProperty () at :1:196 at :1:524

    Construct version: r379

    URL: editor.construct.net

    Date: Tue Mar 19 2024 08:34:17 GMT-0400 (Eastern Daylight Time)

    Uptime: 49.5 s

    Platform information

    Product: Construct 3 r379 (stable)

    Browser: Edge 122.0.2365.92

    Browser engine: Chromium

    Context: browser

    Operating system: Windows 11

    Device type: desktop

    Device pixel ratio: 1

    Logical CPU cores: 4

    Approx. device memory: 8 GB

    User agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36 Edg/122.0.0.0

    Language setting: en-US

    WebGL information

    Version string: WebGL 2.0 (OpenGL ES 3.0 Chromium)

    Numeric version: 2

    Supports NPOT textures: yes

    Supports GPU profiling: no

    Supports highp precision: yes

    Vendor: Google Inc. (Intel)

    Renderer: ANGLE (Intel, Intel(R) UHD Graphics (0x00008A56) Direct3D11 vs_5_0 ps_5_0, D3D11)

    Major performance caveat: no

    Maximum texture size: 16384

    Point size range: 1 to 1024

    Extensions: EXT_clip_control, EXT_color_buffer_float, EXT_color_buffer_half_float, EXT_conservative_depth, EXT_depth_clamp, EXT_disjoint_timer_query_webgl2, EXT_float_blend, EXT_polygon_offset_clamp, EXT_texture_compression_bptc, EXT_texture_compression_rgtc, EXT_texture_filter_anisotropic, EXT_texture_norm16, KHR_parallel_shader_compile, NV_shader_noperspective_interpolation, OES_draw_buffers_indexed, OES_texture_float_linear, OVR_multiview2, WEBGL_blend_func_extended, WEBGL_clip_cull_distance, WEBGL_compressed_texture_s3tc, WEBGL_compressed_texture_s3tc_srgb, WEBGL_debug_renderer_info, WEBGL_debug_shaders, WEBGL_lose_context, WEBGL_multi_draw, WEBGL_polygon_mode, WEBGL_provoking_vertex

  • Hello C3 community,

    I made this fun little top-down F-Zero prototype in a few days, and I'm really happy with how it turned out! I plan to make this engine into a full F-Zero fangame at some point, so I'd really appreciate you guys' support and feedback!

    You can play the game here: https://www.construct.net/en/free-online-games/f-zero-game-prototype-62414/play

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • UPDATE: I figured it out, turns out that I had the wall at a very slight angle of 0.7 instead of 0, which allowed me to stand on it. Kind of a silly mistake on my part lol

  • Yeah that can't be the issue then. It's hard to guess without a cp3 file.

    I can provide that

    drive.google.com/file/d/15xelukiI10P1_K0IzeCk8RVTWe5YD5F7/view

  • I said I already followed a tutorial, so what do you mean by this?

  • Hello Construct Forums,

    I was making a wall jump code (code taken from these videos) And after some testing I found a strange bug that only happens when a player walljumps off of the left side of a wall while holding right (it dosen't work on the right side.) The player will jitter and get stuck (see the video) This bug is very inconsistent as well, sometimes it just doesn't happen and the walljump works as intended. This might be related to another bug that I'm having where my player can stand on walls, but unlike this bug, that bug only works on the right side of a wall. (forum post for that bug here.

    )

    Subscribe to Construct videos now
GizmoSP's avatar

GizmoSP

Member since 12 Jun, 2019

Twitter
GizmoSP has 1 followers

Trophy Case

  • 5-Year Club
  • RTFM Read the fabulous manual
  • Email Verified

Progress

7/44
How to earn trophies