About SageLibrary Questions

About SageLibrary Questions

PostPosted by AlbertMunto » Thu Jul 19, 2012 4:34 am

Hello Andy,

Can you help me with some questions about Sage.
How do we apply a in-house Sage Library to different models?
Basically, all of structures of 3DMAX are the same,
and all of models are loaded through Unity WWW Library.
Therefore, how do we add Sage Library into GameObject by using code?

We've tried to use AddComponent<SageLibrary_GameController>,and set LibraryAsset, AnimationTarget and MovementTarget into GameObject. However, we only got the error message,
" [Sage] Failed to create library, no asset set. "

What are the correct steps to apply SageLibrary to other loaded models?

Could you take a look at our example codes?

Thanks in advance!

Best regards,
Albert
AlbertMunto
 
Posts: 5
Joined: Tue May 15, 2012 2:03 am

Re: About SageLibrary Questions

PostPosted by AlteredReality » Thu Jul 19, 2012 8:12 pm

That should be able to be done. Did you call RecreateLibrary() on the SageController? If you set the library and such at runtime, you would need to call that function, as the library is setup in the Awake() function. Let me know if that's what you needed! :)
Andy - Altered Reality
AlteredReality
Site Admin
 
Posts: 118
Joined: Fri Jan 06, 2012 8:31 pm

Re: About SageLibrary Questions

PostPosted by AlbertMunto » Thu Jul 19, 2012 10:54 pm

Hi Andy,

Thanks for your reply.

After following your suggestions, they seemed to solved the problem. When using Runtime, the message
"[Sage] Failed to create library, no asset set!" initially appeared again but after a while, it ran normally.
However, I've found that when I use "AddComponent<SageLibrary_GameController>" the error message
"[Sage] Failed to create library, no asset set!" appeared, but after call RecreateLibrary(),
the model on the Scene starts running normally.

I'd like to ask what the correct procedures are to add SageLibrary through programming. Also,
in regards to SageController.libraryAsset, which class should be selected?

I apologize for all the inconveniences and thanks very much for all your help!
AlbertMunto
 
Posts: 5
Joined: Tue May 15, 2012 2:03 am

Re: About SageLibrary Questions

PostPosted by AlteredReality » Fri Jul 20, 2012 11:48 am

Honestly, I never even thought about adding the component through code when developing Sage. All of my development and testing of it had been adding it through the editor. As you are doing it now should work though, I'm just not sure how to avoid the first Awake() call after adding the component through code. Is there a way to initialize variables on a dynamic behavior/component before it is awoken? If so, then you should be able to get it working without the meaningless error in the log.

The SageController.libraryAsset should be set to the asset in your project. For example, the asset in the Sage example would be SoldierSL.asset. So you need to set that variable to that asset. Let me know if that helps!
Andy - Altered Reality
AlteredReality
Site Admin
 
Posts: 118
Joined: Fri Jan 06, 2012 8:31 pm


Return to Questions and Discussion

Who is online

Users browsing this forum: No registered users and 0 guests


Style by Gokinstudio | Free forum hosting by ProphpBB | Software by phpBB | Report Abuse | Privacy
cron