Quantcast

Jump to content

» «
Photo

[.NET] Requesting Models, Dicts, Etc

1 reply to this topic
OfficerJohnson
  • OfficerJohnson

    Crackhead

  • Members
  • Joined: 07 Jan 2018
  • United-States

#1

Posted 3 weeks ago

Hello again.

I'm just curious if this is necessary or just a good programming practice when spawning models, animations, or speech audio?

I've seen it used a couple of times, preferably in a loop.

And to make this two questions and save forum space...

When we request one of these things, we are putting it in memory, correct? So, if we want to take it out of memory, we use STREAMING::SET_ENTITY_AS_NO_LONGER_NEEDED? This should allow the entity to phase out of existence if it's dead or out of draw distance, right? In other words, I'm trying to understand how we keep and remove entities once we want to use and are finished using them. What then would keep them in memory (persistent)? Because, currently, that is my current problem.

Jitnaught
  • Jitnaught

    Grass tastes bad

  • Members
  • Joined: 24 Aug 2013
  • United-States

#2

Posted 3 weeks ago

In SHVDN it is not necessary if you are using the built-in functions (e.g. World.CreateVehicle) as they include the code to request the model/dictionary/etc. If you're using natives then yes you would have to request the model/dictionary/etc.

 

Yes that's exactly what that function does (MarkAsNoLongerNeeded() in SHVDN).

To keep an entity persistent set IsPersistent to true (which uses the SET_ENTITY_AS_MISSION_ENTITY native).





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users