2 registered members (AndrewAMD, Ayumi),
838
guests, and 2
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
internal Cache
#217097
07/21/08 10:59
07/21/08 10:59
|
Joined: Jan 2007
Posts: 651 Germany
RedPhoenix
OP
User
|
OP
User
Joined: Jan 2007
Posts: 651
Germany
|
Hi conitec, I have a project where it's necessary to save entities or pictures to files and later load these files again. The problem with that is, that when I load eg. an entity with ent_create it takes the "old file" (which is not existing on the HD anymore) rather than the actual saved file. The manual says: Zum Beschleunigen des Erstellens weiterer Entities wird die Entity-Datei in einem internen Cache gespeichert. Dieser Cache wird durch level_load geleert. I'd therefore like to have a function that can remove or add files to this internal cache, or a function that can clean the cache without having to reload the hole level.
|
|
|
Re: internal Cache
[Re: RedPhoenix]
#217099
07/21/08 11:08
07/21/08 11:08
|
Joined: Jul 2005
Posts: 1,930 Austria
Dark_samurai
Serious User
|
Serious User
Joined: Jul 2005
Posts: 1,930
Austria
|
These functions already exist. Look for ent_purge and ent_preload in the manual.
Dark_Samurai
ANet - A stable and secure network plugin with multi-zone, unlimited players, voip, server-list features,... (for A7/A8)! get free version
|
|
|
Re: internal Cache
[Re: RedPhoenix]
#217101
07/21/08 11:13
07/21/08 11:13
|
Joined: Jul 2008
Posts: 894
TechMuc
User
|
User
Joined: Jul 2008
Posts: 894
|
level_mark() level_free() Löchst den Nexus teilweise, das heisst, der Level-Cache, der die Entity-Dateien enthält wird geleert. level_mark() markiert eine Cache-Position und level_free() löscht sämtliche später geladenen Dateien aus dem Cache. Diese Anweisung kann zum vorübergehenden Laden von Entities verwendet werden, ohne dass Nexus-Speicher verbraucht wird.
Parameter: name - Name der Level-, Modell-, oder Terraindatei. Bemerkungen: Wird ein neues Level geladen, wird der Level-Cache komplett gelöscht. Der Umfang des Caches hängt von der -nx-Kommandozeilen-Option ab. Keine Entity darf eine Datei verwenden, die aus dem Cache entfernt wurde. Sämtliche Entities, die hinter level_mark() erstellt wurden, müssen vor level_free() entfernt werden. Geschwindigkeit: Langsam Beispiel: level_mark(); // mark a cache position you = ent_create("test.mdl",vector(0,0,0),NULL); ... ptr_remove(you); level_free(); // remove test.mdl from the cache
Last edited by TechMuc; 07/21/08 11:13.
|
|
|
Re: internal Cache
[Re: RedPhoenix]
#253144
02/23/09 01:59
02/23/09 01:59
|
Joined: Feb 2008
Posts: 3,232 Australia
EvilSOB
Expert
|
Expert
Joined: Feb 2008
Posts: 3,232
Australia
|
I know this is a very old thread, but what happened to it? I'd like to know what happened to RedPheonix's request for a function to remove a file (read .MDL file) from the cache?
Using the existing level_mark/level_free functions is too coarse for many situations, we just need finer control of nexus contents PLEASE.
What we REALLY need some function to allow us to remove EVERY trace of a of a no-longer required entity, without disturbing any that have been created since. We can create entities on-the-fly, so why cant we TRULY reclaim all the resources that the creation consumed.
"There is no fate but what WE make." - CEO Cyberdyne Systems Corp. A8.30.5 Commercial
|
|
|
Re: internal Cache
[Re: jcl]
#253247
02/23/09 17:57
02/23/09 17:57
|
Joined: Feb 2008
Posts: 3,232 Australia
EvilSOB
Expert
|
Expert
Joined: Feb 2008
Posts: 3,232
Australia
|
Dammit, thanks anyway. It was worth a try.
"There is no fate but what WE make." - CEO Cyberdyne Systems Corp. A8.30.5 Commercial
|
|
|
|