Hi Cap'
Not sure how to explain it, but in DBC a FUNCTION command can't be executed in the sequence of the program. It seems to always have to be called indirectly. If FUNCTION is run into in the sequence of commands, it will return an error.
In the following code, your function works fine because I never let the program "run" into it. I execute it indirectly:
MakeDude(1,4)
end
Function MakeDude(OBJECT,number)
for i = 1 to number
make object cube OBJECT,5
x=1
position object OBJECT,x,1,1
inc x,10
inc OBJECT,1
next i
endfunction
This bit of code will also work:
goto runme
Function MakeDude(OBJECT,number)
for i = 1 to number
make object cube OBJECT,5
x=1
position object OBJECT,x,1,1
inc x,10
inc OBJECT,1
next i
endfunction
runme:
MakeDude(1,2)
print "Press Any Key"
wait key
end
Enjoy your day.