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

GML STRING argument is unset

Discussion in 'Programming' started by Amon, Jan 15, 2020.

  1. Amon

    Amon Member

    Joined:
    Sep 13, 2016
    Posts:
    308
    I started a fresh new project today. I added an object to my room called CubeManager. In its CREATE event I put the following....

    Code:
    ActiveCubeCount = 0;
    
    with ( oRedCube )
    {
        ActiveCubeCount += 1;   
    }
    When I run the build using YYC it spits out this error.

    Code:
    ############################################################################################
    FATAL ERROR in
    action number 1
    of Create Event
    for object CubeManager:
    
    STRING argument is unset
    ############################################################################################
    --------------------------------------------------------------------------------------------
    called from - gml_Object_CubeManager_Create_0 (line 8)
    That's all I've added. Can anyone shed some light as to what is wrong? Thank you.
     
  2. BattleRifle BR55

    BattleRifle BR55 Member

    Joined:
    Jun 24, 2016
    Posts:
    1,085
    Probably a dumb question to ask, but are you trying to increase CubeManager's ActiveCubeCount variable, or every instance of oRedCube?
     
  3. Amon

    Amon Member

    Joined:
    Sep 13, 2016
    Posts:
    308
    Well, I have a certain amount of red cubes in the room. Each level will have a different amount. So in the CubeManagers CREATE event I thought of using a with statement to loop all active red cubes increasing ActiveCubeCount's value.

    I'm trying to increase the ActiveCubeCount value.
     
  4. Simon Gust

    Simon Gust Member

    Joined:
    Nov 15, 2016
    Posts:
    3,262
    You will not be able to Access instance variables through a with-loop from the caller. ActiveCubeCount does not exist in the scope of oRedCube.
    Code:
    ActiveCubeCount = 0;
    
    with ( oRedCube )
    {
        other.ActiveCubeCount += 1;   
    }
    
     
  5. Amon

    Amon Member

    Joined:
    Sep 13, 2016
    Posts:
    308
    Ahh, that actually makes sense. It's working now.
     
  6. BattleRifle BR55

    BattleRifle BR55 Member

    Joined:
    Jun 24, 2016
    Posts:
    1,085
    Or, to shorten things:
    Code:
    ActiveCubeCount = instance_number(oRedCube);
     
    Amon likes this.

Share This Page