Jump to content

How to get if the player is near ?


killerrj8

Recommended Posts

How would I get this ? . I want to start a scene when the player is near. I know how to start a scene etc. But I don't know how I would get if the player is near.

Can someone tell me ?

Edited by killerrj8
Link to comment
Share on other sites

To create a trigger that reacts to the player you first need to create a primitive (use the button on the toolbat that has a T on a cube). you will also need a script that does stuff when the player enters the trigger zone e.g.(I use this to show certain banners when the player is a member of the appropriate faction)

 

scriptName JSActivateByPlayerFaction extends ObjectReference
{This will enable/disable a linked ref based on whether the player is a member of the specified faction}

Faction Property CheckFaction auto
{Which faction to check}

Event OnTriggerEnter(ObjectReference triggerRef)
if (triggerRef == (Game.GetPlayer() as ObjectReference))
	if (Game.GetPlayer().GetFactionRank(CheckFaction) >= 0)
		Self.GetLinkedRef().Enable()
	else
		Self.GetLinkedRef().Disable()
	endif
endif

EndEvent

Link to comment
Share on other sites

How would I get this ? . I want to start a scene when the player is near. I know how to start a scene etc. But I don't know how I would get if the player is near.

Can someone tell me ?

 

Near WHAT/WHERE exactly?

Ask a vague question, get vague answers :rolleyes:

Link to comment
Share on other sites

i don't know how I can say what I want more exactly. Well how do I create a Trigger ? is it on the left where you can place objects on the map ? Like a map marker with a radius ? For the script itself I basically know what to do but don't know WHERE I should put the script. Hope you can understand
Link to comment
Share on other sites

Select the reference for your scene's NPC (just 1 click on him). Then in the toolbar on the top look for a "box with a T inside" icon. Click on it and a window will pop up.

 

New choose an object from the window (this will be the shape of the triggerbox). I usually choose the xmarker.

 

Now a red box will appear around your NPC. Click on it and 4 arrows will pop up, draggin the mouse from one arrow will enlarge or restrict the red box.

 

When done, double click on it, go to "scripts" and add the trigger script.

Link to comment
Share on other sites

hmmm.... Somehow it doesn't work i tried everthing the script is just fine, no errors when I compile but when I go into the red box in-game nothing happens or triggers. I can try to start the quest and run the scene on Quest begin or just lead it directly to the script... it doesn't matter. It just won't work >:/ The actors just stand there like nothing happened. i followed the tutorial on creationkit.com for the scene and checked it several times. I don't know but it just won't trigger. Please help
Link to comment
Share on other sites

  • Recently Browsing   0 members

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