Log In  

Hello, I need some help with an error that I have been encountering in my code. I started coding a few days ago but I have been working on someone else's game. For some weird reason when I call cartdata() in the init function and later in the update60() function I get a error "DGET CALLED BEFORE CARTDATA() IN _INIT LINE 287 (TAB 0) AT LINE 1 (TAB 3) you can see it for yourself if you run the game and chose "TIMED" and collect 25 flowers.

Cart #kuba_mt_1-0 | 2024-04-27 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA

Credit to Lucatron for creating the base game: https://www.lexaloffle.com/bbs/?tid=36520

The cartdata() function is in init so I do not get why the error is occuring.

P#147454 2024-04-27 18:46 ( Edited 2024-04-27 22:54)

CARTDATA() expects a string argument. You're passing an uninitialized variable, so I think that's probably the issue. Instead of:

cartdata(mellow_time)

you probably want

cartdata("mellow_time")

with the quotes around the string (unless mellow_time is initialized somewhere and contains a string, but I couldn't find it anywhere else in your code).

P#147463 2024-04-27 23:55

thank you! everything works now

P#147477 2024-04-28 09:07

[Please log in to post a comment]