Jump to content

Get reference of close actors


Thanatos00

Recommended Posts

Hi guys,

 

I had moded Obli during many years, but I'm just starting with the Geck and FOSE (after a long moding break).

And I'm quite disappointed to see that some major needed scripting functions are still missing in the GECK...

 

The main thing I'm talking about is to be able to get the ref of actors near the player (extremly usefull for a lots of creative things).

 

With the Tescs I had found a simple way to do that : I used an invisible custom area spell (ignore LOS activated) that was casted, for example, every 5 seconds by an object in the player inventory. So in the spell's ScriptEffect I was able to save every actors ref (near the player) I wanted in quest ref variable for example. Possibilities was infinite with this simple system (improve the sneaking system in certain circumstances, add AI Packages/dialogs/NPC reactions to the NPCs near the player in function of the player actions/NPCs stats. Etc, etc, etc).

 

 

 

 

I'm searching a way to do the same thing in Fallout 3.

I have 2 ideas to be able to do that :

 

1) the same thing that I described for Obli. But spell system seems to be really different (so I'm a little lost with it after only one day on the Geck)...

Two major problems :

-> the Cast function seems to be broken

-> the CastImmediateOnSelf function works only for spells that are target self (no area effect)......

 

So is there anyway to cast an invisible area spell, to apply a ScriptEffect on actors near the player ?

 

 

 

 

2) Use FOSE functions GetFirstRef and GetNextRef to get back refs of nearest actors (or to apply them spell's ScriptEffect with CastImmediateOnSelf).

It seems to be possible :

-> I test for example 30 actors refs in the cell, and keep only the 5 nearest refs of the player.

*But "the order of references as returned by GetFirst/NextRef is essentially undefined"... So if there are 40 actors in the cell, I'm not sure at all to get the 5 nearest if I've only tested 30 of them...

*Another problem : If I'm just near the limit of an exterior cell -> I won't test at all actors in the adjacent cell even if they are close to me. And if I test adjacents cells, I will have to do 8x more tests in one single script frame...

 

 

 

That's why I would like to find a lighter system than the second one.

 

 

 

I'm asking to your creativity guys :D, any better idea to get refs of actors close to player ?

Since yesterday I've read a lot of function descriptions of Geck 1.1 and FOSE but I didn't find anything relevant (but it's very possible that I didnt see something).

 

Any advice, idea will be welcome !

 

*I'm also searching a way to get the ref of an actor who has just been killed/hurt by the player (the real problem is with one-shot...). So don't hesitate if you have an idea.

 

Thanks.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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