Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error adding number variable to array #7220

Closed
1 task done
brianhuster opened this issue Dec 3, 2024 · 6 comments
Closed
1 task done

Error adding number variable to array #7220

brianhuster opened this issue Dec 3, 2024 · 6 comments
Labels
Need a game/precise steps to reproduce the issue The bug is hard to reproduce. More detailed steps or investigation is required.

Comments

@brianhuster
Copy link

brianhuster commented Dec 3, 2024

Is there an existing issue for this?

Describe the bug

I cannot add number variable to array in Gdevelop. The command is run, but the array is still empty

Steps to reproduce

  1. Create an array variable arr
  2. Start a scene timer 'clock'
  3. If the value 'clock' is greater than 1 then
    Add the value of 'clock' to array variable 'arr'
    Reset timer 'clock'
    Run Javascript
console.log(runtimeScene.getVariables('arr').get())

GDevelop platform

Desktop

GDevelop version

5.4.218

Platform info

OS (e.g. Windows, Linux, macOS, Android, iOS)

Kubuntu

OS Version (e.g. Windows 10, macOS 10.15)

24.04.1

Browser(For Web) (e.g. Chrome, Firefox, Safari)

No

Device(For Mobile) (e.g. iPhone 12, Samsung Galaxy S21)

No

Additional context

No response

@4ian
Copy link
Owner

4ian commented Dec 3, 2024

Can you share a full project reproducing the issue?

@4ian 4ian added the Need a game/precise steps to reproduce the issue The bug is hard to reproduce. More detailed steps or investigation is required. label Dec 3, 2024
@brianhuster
Copy link
Author

brianhuster commented Dec 3, 2024

Yes, this is the link
https://gd.games/brianpham/edgame

I suppose you can get access to its source, can't you? Please take a look at lines related to data_array variable

@4ian
Copy link
Owner

4ian commented Dec 3, 2024

We don't have access to games source code, can you download/compress it as a zip file and share it here? :)

@brianhuster
Copy link
Author

Sure, here it is

My project3.zip

@4ian
Copy link
Owner

4ian commented Dec 3, 2024

Your JS code is invalid. This is the fixed version:
image

Closing as this is not a bug :)

@4ian 4ian closed this as completed Dec 3, 2024
@brianhuster
Copy link
Author

Thank you so much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Need a game/precise steps to reproduce the issue The bug is hard to reproduce. More detailed steps or investigation is required.
Projects
None yet
Development

No branches or pull requests

2 participants