Jump to content
Igor Q.

Trying to create specific triggers with items.

Recommended Posts

Hi.

I want to create a trigger where when a person equips a map, automatically an arrow spawns above them pointing to the way point they need to go to. (The reason being that they cannot equip both a map and a weapon at the same time being quite important)

My trigger currently uses the

 

Event: On Game Start

Repeat: 1 Time  (It's a loop function)

IF: GET ACTIVE ITEM character "ItemID" 

Then: Spawn Entity Arrow Sign

 

However this trigger doesn't seem to work while the character has the item equiped. Any ideas?

Share this post


Link to post
Share on other sites

Hey Igor,

First of all you need to use the event listener and place the script within that and not the map itself. Here are the settings which are supposed to be on it (when you double click it)

image.png.f45be59281d58c760adaaeafcb50ded8.png

As for the code that goes in it is this:

image.thumb.png.47e6e3ed6a2efde8906792adc7ecb6c9.png

If you have any other questions don't hesitate to ask :)

Share this post


Link to post
Share on other sites

Hey again!

I was able to successfully make the trigger!

However when I try to orient my arrow to point to somewhere I can't get it to work.

Currently I'm trying to make it so that each time it spawns it "points" to a treasure chest.

Problem is, I have tried several functions and none of them have worked.

I've tried "Aim to entity", as well as trying to "Set Orientation" by calculating the angle using Sin and Cos functions however the "Get X vector" function and finding the difference in position function doesn't seem to work

Any ideas?

Ylands_181125_193927.thumb.png.d24adbc37a3de42acae73860b3056df2.png

 

 

Share this post


Link to post
Share on other sites

Alright I was able to figure out this god forsaken trigger that took me so long.

Ylands_181125_225057.thumb.png.7f89fdac812ca924791c9ca25e7c6d5b.png

 

 

  • Like 1

Share this post


Link to post
Share on other sites

Cool so I take it that it works now? You deserve a nice pat on the back now :P

And by the way can you explain to me what the function dot a: ,  dot b: does?

Share this post


Link to post
Share on other sites

The function DOT A B is a dot product for vectors.

It basically multiplies each component separately.

Ex: Dot (1,2,3) (1,2,3) = (1,4,9)   or        Dot (1,1,1) (1,2,3) = (1,2,3)

 

It was the only way I could convert the vector into a savable variable. So I could store those values for computing the angles/distance.

Edited by Igor Quintero

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×