Jump to content

Making Player Look At Something


Recommended Posts

I am new to this aspect of modding so in a nutshell - Player enters trigger box, sound plays (already done), FX..does stuff (done this) now I want player's attention to be drawn to the FX because this is the clue as to what to do next. What to do next is another post, for now I want the player to stand still, disable controls and look at what should be looked at, for a second or two maybe, then player has control back and is clearer on how to proceed.

The script could be incorporated into my existing script but ideally I prefer it standalone because I will want to use just that part, 'freeze - look - unfreeze, again.

New terrotory for me and am looking (no pun) forward to it.

Link to comment
Share on other sites

When the scripts i post don't have name at the top, they are made away from my PC, so i can't compile, sometime a few mistakes are made like "typos" (not easy to write fast in a 7 inch tablet).


You might need to tweek the "wait" to what your scene requierds.


The script will fire only "Once", after the script fires the trigger box and the script will be disable and delete (no need to be hanging around if it's going to be use only once, unnecessary save file space).



import game

EffectShader Property VisualFX01 Auto
{Visual FX to Play on Ref - xMarker}

ObjectReference Property xMarkerVisualREF auto
{xMarker to play the FX at - AND where the player will be forced to look at}

Sound Property SoundFX01 Auto
{Sound FX 01 to play}

int instanceID ;used to store sound ref


EVENT onTriggerEnter(objectReference actronaut)
if actronaut == game.getPlayer()
Game.DisablePlayerControls()
Utility.wait(1.0)
instanceID = SoundFX01. Play(game.getPlayer())
Game.GetPlayer().SetLookAt(xMarkerVisualREF)
VisualFX01.Play(xMarkerVisualREF)
Utility.wait(5.0)
Game.GetPlayer().ClearLookAt()
Game.EnablePlayerControls()
Utility.wait(0.5)
self.Disable()
Utility.wait(0.5)
self.Delete()
endif
endevent



Have a happy modding !!..

Edited by maxarturo
Link to comment
Share on other sites

Doesn't matter that they don't have a name, your help is appreciated.

Compile with a couple of saving errors...

 

(18,20): DisablePlayerControls is not a function or does not exist
(25,20): EnablePlayerControls is not a function or does not exist

Link to comment
Share on other sites

Body movement freezes, head/look is still active - player does not look at marker. Tested by looking at the ground when entering triggerbox - player's head is not forced to look at the marker/visual fx.

If i may...

 

i would replace a marker with this function https://www.creationkit.com/index.php?title=SetCameraTarget_-_Game and an empty actor in the same spot as the marker

 

EffectShader Property VisualFX01 Auto

{Visual FX to Play on Actor}

Actor Property NullActor auto

{An actor without any kind of graphical references}

Sound Property SoundFX01 Auto

{Sound FX 01 to play}

int instanceID

 

EVENT onTriggerEnter(ObjectReference akActionRef)

if akActionRef == game.getPlayer()

Game.DisablePlayerControls()

Utility.wait(1.0)

instanceID = SoundFX01.Play(game.getPlayer())

Game.SetCameraTarget(NullActor)

VisualFX01.Play(xMarkerVisualREF)

Utility.wait(5.0)

Game.EnablePlayerControls()

Utility.wait(0.5)

self.Disable()

Utility.wait(0.5)

self.Delete()

endif

endevent

Link to comment
Share on other sites

 

Body movement freezes, head/look is still active - player does not look at marker. Tested by looking at the ground when entering triggerbox - player's head is not forced to look at the marker/visual fx.

If i may...

 

i would replace a marker with this function https://www.creationkit.com/index.php?title=SetCameraTarget_-_Game and an empty actor in the same spot as the marker

 

EffectShader Property VisualFX01 Auto

{Visual FX to Play on Actor}

 

ObjectReference Property xMarkerVisualRef Auto

{Use the marker to fire at the spot of the actor the visual effect}

Actor Property NullActor auto

{An actor without any kind of graphical references}

Sound Property SoundFX01 Auto

{Sound FX 01 to play}

int instanceID

 

EVENT onTriggerEnter(ObjectReference akActionRef)

if akActionRef == game.getPlayer()

Game.DisablePlayerControls()

Utility.wait(1.0)

instanceID = SoundFX01.Play(game.getPlayer())

Game.SetCameraTarget(NullActor)

VisualFX01.Play(xMarkerVisualREF)

Utility.wait(5.0)

Game.EnablePlayerControls()

Utility.wait(0.5)

self.Disable()

Utility.wait(0.5)

self.Delete()

endif

endevent

 

Link to comment
Share on other sites

Player doesn't look at target (xmarker). Look movement is 'free'.

This property...

 

Actor Property NullActor auto

{An actor without any kind of graphical references}

 

I can only fill with PlayerRef - should it?

Empty Actor = Create an actor don't fill ANYTHING and place it into the world (should come up ad an invisible actor) try this should work to use the function i told you.

 

Is an experiment there is nothing on the internet about this if it works congrats we discover something XXXXD

Link to comment
Share on other sites

  • Recently Browsing   0 members

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