GML STRING argument is unset

Amon

Member
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.
 
Probably a dumb question to ask, but are you trying to increase CubeManager's ActiveCubeCount variable, or every instance of oRedCube?
 

Amon

Member
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.
 

Simon Gust

Member
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;   
}
 
Top