Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / (Tier 1) Can I pass an object to a function?

Author
Message
basicFanatic
7
Years of Service
User Offline
Joined: 7th Jun 2017
Location:
Posted: 11th Aug 2017 12:42
I tried this making this function:



It gave me an error, saying that "Object" has not been defined as a type. I'm not really clear on the terminology here, why some stuff is a type while other stuff is not.

Is it impossible to use loaded 3D objects in functions? Maybe I should I use gosub instead...?
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 11th Aug 2017 12:47 Edited at: 11th Aug 2017 12:49
the most in agk is based on id's, means integer.
in doku
integer LoadObject( szFilename )
means
local ret as integer
ret = LoadObject( "obj.3ds" )

checkSightline (ret)

function checkSightline (gazeTarget as integer )
// Do stuff
endfunction
AGK (Steam) V2017.07.19 : Windows 10 Pro 64 Bit : AMD (17.4.4) Radeon R7 265 : Mac mini OS Sierra (10.12.2)
basicFanatic
7
Years of Service
User Offline
Joined: 7th Jun 2017
Location:
Posted: 11th Aug 2017 13:55
Of course!

Thanks for the help, sometimes I just lose track of the basics!

Login to post a reply

Server time is: 2024-09-30 07:33:54
Your offset time is: 2024-09-30 07:33:54