hi,
i would like to run a script doing :
oMyobject.Move(320, 480, 1, eBlock, eAnywhere);
when it is inside the room script , no problem.
but i would like to be able to apply this same move for all my objects so i tought i could use a function.
i dont know how to pass the object referene to the function.heres my code :
in globalscript.ash :
import function getrid (Object);
in globalscript.asc :
function getrid(Object myObject )
{
myObject.Move(320, 480, 1, eBlock, eAnywhere);
}
in the room :
getrid(oChaussette);
i get an error : Failed to save room room1.crm; details below
room1.asc(11): Error (line 11): Type mismatch: cannot convert 'Object*' to 'Object'
any help would be appreciated!!
thanks
jp
In your function it should be a pointer, such as:
function getrid(Object *myObject)
It should have caught that you weren't making that a pointer to begin with..but that seems to be the reason why.
Read the manual entry on pointers..it should help clarify for you the differences.
mm yes but i still have the same ompilation error.
function getrid(Object *myObject )
{
myObject.Move(320, 480, 1, eBlock, eAnywhere);
}
Sorry, the import should also be such as:
import function getrid(Object*);
fantastic , it works great.
thanks so much :D
jp