iCMD
|
  |
| Joined: 06 Jan 2012 |
| Total Posts: 7 |
|
|
| 13 Feb 2015 09:17 PM |
Wiki ( http://wiki.roblox.com/index.php?title=API:Class/ContentProvider/Preload ) says:
"That is, the Preload method doesn't wait until the content has finished loading before returning"
How do I make the 'Example' code on the Wiki wait until the content has finished loading, then print ("Done") or such? I've seen other games do it but I'm not sure about how to do this.
Thanks for help! |
|
|
| Report Abuse |
|
|
|
| 13 Feb 2015 09:19 PM |
| repeat wait() until Object |
|
|
| Report Abuse |
|
|
iCMD
|
  |
| Joined: 06 Jan 2012 |
| Total Posts: 7 |
|
|
| 13 Feb 2015 09:19 PM |
So I could do: repeat wait() until "http://www.roblox.com/asset/?id=12222058"
? |
|
|
| Report Abuse |
|
|
iCMD
|
  |
| Joined: 06 Jan 2012 |
| Total Posts: 7 |
|
| |
|
iCMD
|
  |
| Joined: 06 Jan 2012 |
| Total Posts: 7 |
|
| |
|
|
| 13 Feb 2015 09:33 PM |
Waiting for a specific item in the queue... seems impossible (or hidden deep in the bowls of Cthulhu). Therefore, the only legitimate answer we can give you is the one that's provided on the wiki page.
Though, if you squint really hard you may misinterpret it and that might yield what you wanted to see. I hear lots of people like doing that. |
|
|
| Report Abuse |
|
|
iCMD
|
  |
| Joined: 06 Jan 2012 |
| Total Posts: 7 |
|
|
| 13 Feb 2015 09:35 PM |
| can I get a real answer not troll |
|
|
| Report Abuse |
|
|
Ojia
|
  |
| Joined: 08 Feb 2012 |
| Total Posts: 650 |
|
|
| 13 Feb 2015 09:43 PM |
| game.ContentProvider:Preload(Your asset here) |
|
|
| Report Abuse |
|
|
|
| 13 Feb 2015 09:44 PM |
| We can't stop you from reading only part of the wiki page, but we do advise against it. |
|
|
| Report Abuse |
|
|
|
| 13 Feb 2015 11:10 PM |
I was about to tell these guys off for yelling at you, but its literally in the same paragraph that you quoted. THEY GAVE YOU THE CODE: """
It will, however, queue the requests, meaning that you can use the RequestQueueSize property of ContentProvider to wait for all assets to load. See below for example implementation.
local ContentProvider = Game:GetService("ContentProvider") local function WaitForAssetsToLoad() -- Yields until all requested assets are loaded. while (ContentProvider.RequestQueueSize > 0) do wait() end end
"""
~Upload code to codepad-dot-org with Lua syntax highlighting to preserve indentation and make it easier to read!~ |
|
|
| Report Abuse |
|
|
nomer888
|
  |
| Joined: 13 Feb 2010 |
| Total Posts: 551 |
|
|
| 13 Feb 2015 11:27 PM |
See this:
http://www.roblox.com/Forum/ShowPost.aspx?PostID=134656753 |
|
|
| Report Abuse |
|
|