skymen / follower

a follower addon for Construct 3

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool


Follower

Follows a target object or a path of waypoints

Author: skymen
Made using c3ide2-framework

Table of Contents


Usage

To build the addon, run the following commands:

npm i
node ./build.js

To run the dev server, run

npm i
node ./dev.js

The build uses the pluginConfig file to generate everything else. The main files you may want to look at would be instance.js and scriptInterface.js

Examples Files


Properties

Property Name Description
Follow Mode Direct = follow the target directly, Waypoint = follow a path of waypoints
Follow Speed Speed to follow the target at. In Waypoints mode, negative speed will do one waypoint at a time. In lerp mode, this is the lerp speed.
Follow Distance Distance to keep from the target
Set Angle Set the angle of the follower
Follow X Follow the target on the X axis
Follow Y Follow the target on the Y axis
Follow Z Follow the target on the Z axis
Follow Angle Follow the target's angle
Auto Target Parent Automatically target the parent of the follower

Follow Mode

Description:
Direct = follow the target directly, Waypoint = follow a path of waypoints
Type:
combo Options:

  • direct: Direct
  • waypoint: Waypoint
  • lerp: Lerp

Follow Speed

Description:
Speed to follow the target at. In Waypoints mode, negative speed will do one waypoint at a time. In lerp mode, this is the lerp speed.
Type:
float

Follow Distance

Description:
Distance to keep from the target
Type:
float

Set Angle

Description:
Set the angle of the follower
Type:
check

Follow X

Description:
Follow the target on the X axis
Type:
check

Follow Y

Description:
Follow the target on the Y axis
Type:
check

Follow Z

Description:
Follow the target on the Z axis
Type:
check

Follow Angle

Description:
Follow the target's angle
Type:
check

Auto Target Parent

Description:
Automatically target the parent of the follower
Type:
check


Actions

Action Description
Set follow mode Set the follow mode
Set follow speed Set the follow speed
Set follow distance Set the follow distance
Follow Follow
Unfollow Unfollow
Set angle to angle of motion Wether to set the angle to the angle of motion
Set axes Wether to follow on the X, Y and Z axis
Add waypoint Add a waypoint
Set waypoint Set a waypoint
Remove waypoint Remove a waypoint
Clear waypoints Clear all waypoints

Set follow mode

Description:
Set the follow mode

Parameters:

Name Type Description
Mode combo The follow mode

Set follow speed

Description:
Set the follow speed

Parameters:

Name Type Description
Speed number The follow speed

Set follow distance

Description:
Set the follow distance

Parameters:

Name Type Description
Distance number The follow distance

Follow

Description:
Follow

Parameters:

Name Type Description
Target object The target to follow

Unfollow

Description:
Unfollow

Set angle to angle of motion

Description:
Wether to set the angle to the angle of motion

Parameters:

Name Type Description
Set Angle boolean Wether to set the angle to the angle of motion

Set axes

Description:
Wether to follow on the X, Y and Z axis

Parameters:

Name Type Description
X boolean Wether to follow on the X axis
Y boolean Wether to follow on the Y axis
Z boolean Wether to follow on the Z axis

Add waypoint

Description:
Add a waypoint

Parameters:

Name Type Description
X number The X position of the waypoint
Y number The Y position of the waypoint
Z number The Z position of the waypoint
Angle number The angle of the waypoint

Set waypoint

Description:
Set a waypoint

Parameters:

Name Type Description
Index number The index of the waypoint to set
X number The X position of the waypoint
Y number The Y position of the waypoint
Z number The Z position of the waypoint
Angle number The angle of the waypoint

Remove waypoint

Description:
Remove a waypoint

Parameters:

Name Type Description
Index number The index of the waypoint to remove

Clear waypoints

Description:
Clear all waypoints


Conditions

Condition Description
Is following Is following
Is angle set to angle of motion Is angle set to angle of motion

Is following

Description:
Is following

Is angle set to angle of motion

Description:
Is angle set to angle of motion


Expressions

Expression Description
FollowDistance Follow distance
FollowTargetUID Follow target UID
Speed Speed
AngleOfMotion Angle of motion
WayPointX Waypoint X
WayPointY Waypoint Y
WayPointZ Waypoint Z
WayPointAngle Waypoint angle
WayPointCount Waypoint count

FollowDistance

Description:
Follow distance
Return Type:
number

FollowTargetUID

Description:
Follow target UID
Return Type:
number

Speed

Description:
Speed
Return Type:
number

AngleOfMotion

Description:
Angle of motion
Return Type:
number

WayPointX

Description:
Waypoint X
Return Type:
number

Parameters:

Name Type Description
Index number The index of the waypoint

WayPointY

Description:
Waypoint Y
Return Type:
number

Parameters:

Name Type Description
Index number The index of the waypoint

WayPointZ

Description:
Waypoint Z
Return Type:
number

Parameters:

Name Type Description
Index number The index of the waypoint

WayPointAngle

Description:
Waypoint angle
Return Type:
number

Parameters:

Name Type Description
Index number The index of the waypoint

WayPointCount

Description:
Waypoint count
Return Type:
number

About

a follower addon for Construct 3


Languages

Language:JavaScript 100.0%