1. Hey! Guest! The 35th GMC Jam will take place between November 28th, 12:00 UTC - December 2nd, 12:00 UTC. Why not join in! Click here to find out more!
    Dismiss Notice

Number of arguments expected - 4, Obtained - 3

Discussion in 'Programming' started by okatz1992, Nov 7, 2019.

  1. okatz1992

    okatz1992 Member

    Joined:
    Nov 7, 2019
    Posts:
    3
    Hallo Guys,

    i am

    completely new new too programming and i just startet with a flappy bird remake ;P

    i use this video :

    But i have a few problems,

    One of this problem is in this codeline
    :
    alarm(0) =60
    spread = 150;

    var position
    var spread
    position = random(300) +spread

    // Create the pipes in a random Lacation //

    instance_create_layer(room_width, position -spread/2, NamekTreeUpside);

    Video Minute 22;

    It says : Number of arguments expected - 4, Obtained - 3 (Red Dot )

    And if i try too programm the alarm i allways get: Unknown function or script alarm,

    So i hope you could help me , i have so much fun but this errors burn my head XD

    Tanks a lot ;)

    Ps: Complete Coding Line

    if (gravity = 0)
    {

    gravity = 2;
    objCOntrol.alarm(0) = 20; here is alarm set !
    }

    if (dead = 0)


    {

    vspeed = -20;


    image_speed = 0.5;

    }
     
  2. TailBit

    TailBit Member

    Joined:
    Oct 16, 2019
    Posts:
    61
    You can click the function with the middle mouse button to get the help page about it up that have an example as well:

    instance_create_layer(x ,y ,layer_id, obj)
    x = room_width
    y = position -spread/2
    layer_id = NamekTreeUpside
    obj = ??

    so you are only giving it 3 arguments, missing a 4th

    the alarm need different brackets .. not ( ) ..but [ ] .. because it is an array
     
    Toque likes this.
  3. okatz1992

    okatz1992 Member

    Joined:
    Nov 7, 2019
    Posts:
    3
    Hey Tailbit, thank you for your help,

    Codlines are okay now, no misstake found.

    But the sprites the game should create dont apear after starting the game, i dont know why...
     
    Last edited: Nov 8, 2019
  4. TailBit

    TailBit Member

    Joined:
    Oct 16, 2019
    Posts:
    61
    It is impossible to help you with only that information
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice