generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Return a list of all asset IDs in a game?

Previous Thread :: Next Thread 
IanSplodge is not online. IanSplodge
Joined: 13 Aug 2012
Total Posts: 2686
18 Sep 2015 12:02 PM
How would I return a table of every single Asset ID in a game, instead of typing out the ID of every Asset that I use?
Report Abuse
IllegallyBlind is not online. IllegallyBlind
Joined: 07 Nov 2010
Total Posts: 1691
18 Sep 2015 12:03 PM
Be more specific.


I was gonna make a dubstep joke but I guess ill just drop it.
Report Abuse
InsaneDays is not online. InsaneDays
Joined: 28 Jan 2012
Total Posts: 762
18 Sep 2015 12:04 PM
Use loops.

local assets = {}
for i,v in pairs(game.Lighting:GetChildren()) do
if v:isA("Sound") then
table.insert(assets, #assets+1, v.SoundId)
elseif v:IsA("Animation") then bla bla bla

elseif.. bla bla bla
end
end
Report Abuse
InsaneDays is not online. InsaneDays
Joined: 28 Jan 2012
Total Posts: 762
18 Sep 2015 12:04 PM
Oh and at the end:"return assets"
Report Abuse
IanSplodge is not online. IanSplodge
Joined: 13 Aug 2012
Total Posts: 2686
18 Sep 2015 12:05 PM
I'm trying to create a loading script, and to do so, I have to type out the Asset ID of every single Asset I'd like to Preload.

How do I create a table of every single Asset ID used in the game, then preload it?
Report Abuse
Xsitsu is not online. Xsitsu
Joined: 28 Jul 2009
Total Posts: 2921
18 Sep 2015 12:06 PM
Traverse every single instance in your game with a recursive function and add the asset ids to some table.

Here's something to get you started:

local assets = {}
function Search(obj)
for i, v in pairs(obj) do
--// Add AssetID to assets table
Search(v)
end
end

Search(game)
Report Abuse
IanSplodge is not online. IanSplodge
Joined: 13 Aug 2012
Total Posts: 2686
18 Sep 2015 12:07 PM
Thanks Insane, I posted too slow.
Report Abuse
InsaneDays is not online. InsaneDays
Joined: 28 Jan 2012
Total Posts: 762
18 Sep 2015 12:07 PM
If you want a preload script use that:

local preloader = game:GetService("ContentProvider")
--TheCode i sent you before


for i,v in pairs(assets) do
preloader:Preload(v)
repeat wait() until preloader.RequestQueueSize <= 0
end

--In a local script obv.
Report Abuse
IllegallyBlind is not online. IllegallyBlind
Joined: 07 Nov 2010
Total Posts: 1691
18 Sep 2015 12:09 PM
Never heard of all this preloading jazz. What's the point of it?


I was gonna make a dubstep joke but I guess ill just drop it.
Report Abuse
InsaneDays is not online. InsaneDays
Joined: 28 Jan 2012
Total Posts: 762
18 Sep 2015 12:09 PM
I'll make a Free Model for preloading stuff.
Report Abuse
VineyardVine is online. VineyardVine
Joined: 20 Nov 2010
Total Posts: 904
18 Sep 2015 12:21 PM
There is a plugin that gives you a table of all Ids in the game
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image