_precache.scr

Post your scripting questions / solutions here

Moderator: Moderators

User avatar
mcunha98
Lieutenant Colonel
Posts: 384
Joined: Sat Jan 17, 2004 1:52 am
Location: Brasil
Contact:

_precache.scr

Post by mcunha98 »

In many compiled maps i see a file how this prefix and it have many lines of objects/models.

What this function of this file, and how i make it (how i discover all name/path of objects into my map) ? :oops:
Ophisâ„¢
Colonel
Posts: 461
Joined: Sun Mar 12, 2006 2:30 pm
Location: England, Manchester
Contact:

Post by Ophisâ„¢ »

Im not sure i understand what you just said, i'm sorry.
Image[ Formerly Known As Snakeâ„¢ ]
lizardkid
Windows Zealot
Posts: 3672
Joined: Fri Mar 19, 2004 7:16 pm
Location: Helena MT

Post by lizardkid »

the precache prepares all the sounds models and effects taht are to be used in a map, test_ caches all of them. i've never used one and i dont see any loading or speed difference with or without one.

it's also quite annoying figuring out what all sounds / effects / models your map will use.
Moderator

۞
Abyssus pro sapientia
Olympus pro Ignarus
۞

AND STUFF™ © 2006
Rookie One.pl
Site Admin
Posts: 2752
Joined: Fri Jan 31, 2003 7:49 pm
Location: Nowa Wies Tworoska, Poland
Contact:

Post by Rookie One.pl »

I do feel the difference in loading times, esp. when the map is loaded for the nth time. ;)

Come to think of it, how about a program that creates a precache script automatically for you? I'll make one in a couple of minutes. :)
Admin
Image
Image
Honour guide me.

here's my stuff - inequation.org | here's where I work - thefarm51.com
lizardkid
Windows Zealot
Posts: 3672
Joined: Fri Mar 19, 2004 7:16 pm
Location: Helena MT

Post by lizardkid »

ya it wouldt be hard, just scan the .map file for all the models and add them. sounds would be a different matter but late precaches arent a problem are they?
Moderator

۞
Abyssus pro sapientia
Olympus pro Ignarus
۞

AND STUFF™ © 2006
User avatar
mcunha98
Lieutenant Colonel
Posts: 384
Joined: Sat Jan 17, 2004 1:52 am
Location: Brasil
Contact:

Post by mcunha98 »

Based on HartNugen, see this sample file...

exec global/DMprecache.scr
cache models/fx/bh_paper_lite.tik
cache models/fx/bh_paper_hard.tik
cache models/fx/bh_wood_lite.tik
cache models/fx/bh_wood_hard.tik
cache models/fx/bh_metal_lite.tik
cache models/fx/bh_metal_hard.tik
cache models/fx/bh_stone_lite.tik
cache models/fx/bh_stone_hard.tik
cache models/fx/bh_dirt_lite.tik
cache models/fx/bh_dirt_hard.tik
cache models/fx/bh_grass_lite.tik
cache models/fx/bh_grass_hard.tik
cache models/fx/bh_mud_lite.tik
cache models/fx/bh_mud_hard.tik
cache models/fx/bh_water_lite.tik
cache models/fx/bh_water_hard.tik
cache models/fx/bh_glass_lite.tik
cache models/fx/bh_glass_hard.tik
cache models/fx/bh_sand_lite.tik
cache models/fx/bh_sand_hard.tik
cache models/fx/bh_foliage_lite.tik
cache models/fx/bh_foliage_hard.tik
cache models/fx/bh_snow_lite.tik
cache models/fx/bh_snow_hard.tik
cache models/fx/bh_carpet_lite.tik
cache models/fx/bh_carpet_hard.tik
cache models/fx/bh_foliage.tik
cache models/fx/bh_snow.tik
cache models/fx/bh_carpet.tik
cache models/fx/water_ripple_still.tik
cache models/fx/water_ripple_moving.tik
cache models/fx/barrel_oil_leak_big.tik
cache models/fx/barrel_oil_leak_medium.tik
cache models/fx/barrel_oil_leak_small.tik
cache models/fx/barrel_oil_leak_splat.tik
cache models/fx/barrel_water_leak_big.tik
cache models/fx/barrel_water_leak_medium.tik
cache models/fx/barrel_water_leak_small.tik
cache models/fx/barrel_water_leak_splat.tik
cache models/fx/fs_light_dust.tik
cache models/fx/fs_heavy_dust.tik
cache models/fx/fs_dirt.tik
cache models/fx/fs_grass.tik
cache models/fx/fs_mud.tik
cache models/fx/fs_puddle.tik
cache models/fx/fs_sand.tik
cache models/fx/fs_snow.tik
cache models/fx/bh_human_uniform_lite.tik
cache models/fx/bh_human_uniform_hard.tik
cache models/fx/water_trail_bubble.tik
cache models/fx/grenexp_base.tik
cache models/fx/bazookaexp_base.tik
cache models/fx/grenexp_paper.tik
cache models/fx/grenexp_wood.tik
cache models/fx/grenexp_metal.tik
cache models/fx/grenexp_stone.tik
cache models/fx/grenexp_dirt.tik
cache models/fx/grenexp_grass.tik
cache models/fx/grenexp_mud.tik
cache models/fx/grenexp_water.tik
cache models/fx/grenexp_gravel.tik
cache models/fx/grenexp_sand.tik
cache models/fx/grenexp_snow.tik
cache models/fx/grenexp_foliage.tik
cache models/fx/grenexp_carpet.tik
cache models/items/explosive.tik
cache models/emitters/explosion_mine.tik
Rookie One.pl
Site Admin
Posts: 2752
Joined: Fri Jan 31, 2003 7:49 pm
Location: Nowa Wies Tworoska, Poland
Contact:

Post by Rookie One.pl »

Precache files do not cache sounds, Lizard. And my proggy scans BSP files and map scripts. :) I'm currently doing a bit of testing, if it works right I'll post it in a while. ;)
Admin
Image
Image
Honour guide me.

here's my stuff - inequation.org | here's where I work - thefarm51.com
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

The primary function of the precache file is to prevent a sudden stutter during the game.. for example when you fire a weapon for the first time. :)
Image
Rookie One.pl
Site Admin
Posts: 2752
Joined: Fri Jan 31, 2003 7:49 pm
Location: Nowa Wies Tworoska, Poland
Contact:

Post by Rookie One.pl »

I would've already posted my program already but I'm having some memory allocation-related problem I've been trying to solve for a couple of hours. :?
There also seems to be a problem with loading BSP files, it just won't parse beyond the first lump. :? Weird.
Admin
Image
Image
Honour guide me.

here's my stuff - inequation.org | here's where I work - thefarm51.com
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

Rookie One.pl wrote:memory allocation-related problem
java ftw!! :D
Image
User avatar
mcunha98
Lieutenant Colonel
Posts: 384
Joined: Sat Jan 17, 2004 1:52 am
Location: Brasil
Contact:

Post by mcunha98 »

Ok, the function of file i understand.
But how i create this file ?
Exists a development tool to create this file (or plugin for Radiant) ???
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

I believe Rookie's making one :wink: . 2015 were lazy and just notepadded em :)
Image
User avatar
mcunha98
Lieutenant Colonel
Posts: 384
Joined: Sat Jan 17, 2004 1:52 am
Location: Brasil
Contact:

Post by mcunha98 »

jv_map wrote:I believe Rookie's making one
So Rookie ???
Is true ? :D
Rookie One.pl
Site Admin
Posts: 2752
Joined: Fri Jan 31, 2003 7:49 pm
Location: Nowa Wies Tworoska, Poland
Contact:

Post by Rookie One.pl »

Yeah. :) I'm currently resolving some random pointer crashes, but I think I've narrowed the problem area to one (quite long and complex :?) function.

Expect a release soon. :)

And Jv - C++ > Java > Delphi > C# IMHO. :P
Admin
Image
Image
Honour guide me.

here's my stuff - inequation.org | here's where I work - thefarm51.com
User avatar
mcunha98
Lieutenant Colonel
Posts: 384
Joined: Sat Jan 17, 2004 1:52 am
Location: Brasil
Contact:

Post by mcunha98 »

Rookie One.pl wrote:Yeah. :) I'm currently resolving some random pointer crashes, but I think I've narrowed the problem area to one (quite long and complex :?) function.

Expect a release soon. :)

And Jv - C++ > Java > Delphi > C# IMHO. :P
Well, if you need help with programming count with me (Delphi, VB and VB.NET, PHP, C#).

Recently i found the source code of plugins for radiant, i search in my CD's the MSVC++ install. When i found, i will install the MSVC and try make a plugin to identifie entitys of map...
Post Reply