Jump to content

Finding a random container near actor


Recommended Posts

Hello there, hope everyone is doing well.

 

I am researching a way to find a random container near an Actor. Any recommendations?

 

Could the following method in the Game Script be used?

 

ObjectReference Function FindRandomReferenceOfAnyTypeInListFromRef(FormList arBaseObjects, ObjectReference arCenter, float afRadius)

 

Create a FormList with all the container Form objects and pass in the Actor reference. That's my thought.

 

Regards,

-louisthird

Link to comment
Share on other sites

Yes that would work fine.

 

But, would you believe that starting a sub-quest that uses story manager to fill a reference alias is 1000x faster ?

 

Its true ! I do this at scale for thousands of objects. Also you get more granularity on the conditions, like;

 

[Quest Alias] New Reference Alias [ ] Optional

[ ] Find matching Reference - Match Conditions

[ ] GetIsObjectType: Container == 1

[ ] GetLocked == 0

[ ] HasRefType: BossContainer == 0

[ ] HasKeyword Workbench_General == 0 ;to exclude workshops and workbenches

 

Remember they must be either 3d loaded in the uGrids to load around the player or persistent ObjectReferences to be found.

Link to comment
Share on other sites

SKK50 - I can believe it! I should have poked around to find "GetIsObjectType" which will work perfect! I am only interested in finding base game objects like trash cans, file cabinets, etc. Nothing new or fancy.

 

I am going to poke around with what is possible a bit more now that you gave me the thought about using quest aliases. I want to randomly pick a nearby container to an actor. I'll research what's possible with the quest aliases, but totally believe it's the faster way to go. My upcoming mod is very tight on the script code and I want to keep it that way, so I appreciate the tips on performance.

 

Thanks for another great answer, SKK50.

Link to comment
Share on other sites

Actually, this may be something that I will use for v2.0 of the mod I have been working on. It requires several other changes in addition to finding containers around an Actor. At least I will have time to look into it.

 

SKK50, do you release your mods with only compiled script or with source code? I was looking into packaging for mods that have scripts. My previous one was only textures/meshes, but this one has only scripts.

Link to comment
Share on other sites

@louisthird no I do not package my solutions with source code as there is no Creation Kit workflow for that, and my principle audience (90% of my mod users) are on Xbox who have no use for it.

 

If someone desperately wants to look and lift they can invest the effort to extract and champollion it. The sort of person who cant be arsed to do that is not the sort of person I want trying to reuse my code. Because I have enough lazy, rude and entitled users soaking up my emotional energy. Also some of the wonderful stuff includes my own commercial IP that I should not really be distributing in DIY hobby packages, publishing uncompiled could set undesired precedents.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...