Jump to content

Help with detection scripting.


XJDHDR

Recommended Posts

Can anyone help me with a detection script?

 

I want to create a script that gets the reference of an actor that detects the player. As far as I can see, none of the functions I have read about can provide a detecting actor's reference. Your help will be greatly appreciated.

Link to comment
Share on other sites

Can anyone help me with a detection script?

 

I want to create a script that gets the reference of an actor that detects the player. As far as I can see, none of the functions I have read about can provide a detecting actor's reference. Your help will be greatly appreciated.

 

hmmm. i guess the way to interpret it is... u want to get the actors reference WHILE he is detecting the player. There are a few ways you could approach it.... and I am relatively new to scripting, but i do know a few things.

 

One thing to use is, to set <referenceActor> to GetCrossHairRef ; this gets the objectID of whatever is in you're cross hair, thus, if the crosshair is pointing at an actor, it gets their actorID. usually u can set the <referenceActor> to some ref like "target" thus, storing it to memory.

 

to make sure the player is being detected, <actorID>.getdetected player which the <actorID> cound be the target. So

 

target.getdetected player == 1 if the target is being detected by the player (or turn the ref to the other way around in ur case). This has a few problems (like CTD) when it is attached to a magic spell and that script is then run on a dead body. otherwise it works fine.

 

another is: IsActorDetected. Example: player.IsActorDetected which returns 1 when being detected by any other actor. You could probably use conditionals to narrow down the specifics.

 

Another is form is the GetCombatTarget. THIS ONLY WORKS ON NPCS. Therefore you must have a way that an npc has a temporary spell added (which would probably use something like above ... target.addspell <spell>) which has the script with the use of something like set me to getself which identifies your own ID (in this case the NPCS id) and then me.GetCombatTarget, which then asks what is the combat target of that NPC (usually it is the player).

 

Feel free to correct me if i'm using the wrong syntax, experienced modders.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

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