[Plugin] jcw_trace (raycast)

Post your work in progress addons and get feedback

Post » Tue Jun 07, 2016 7:13 am

great plugin! thanks a lot!
B
72
S
25
G
5
Posts: 90
Reputation: 7,277

Post » Tue Jun 07, 2016 8:51 am

UberLou wrote:Would it be possible to turn this into a behavior so different objects can store different trace results? I'm not a programmer so I have no idea how difficult that would be.


Well, I could, but I don't see the utility of this. In my project, it's being used to detect ledges for the player to grab on to. After the check is complete, I no longer care about what the results are, and I can use the object again for something else. If you really need to store the results longer, you could always save them in some variables or an array, or you could add the trace object to a container. I have NOT tested this plugin in a container, but it should work just like the array object, having a unique instance (and results) for each instance of the container.
B
54
S
19
G
13
Posts: 97
Reputation: 10,146

Post » Tue Jun 07, 2016 1:12 pm

Ok, I'll try that. I was worried about having multiple traces overwriting results. For instance having a laser constantly firing a trace and then a few enemies using trace for line of sight or firing instant bullets.
B
81
S
52
G
42
Posts: 370
Reputation: 26,355

Post » Tue Jun 07, 2016 2:30 pm

A behavior version where you can check for the distance to an obstacle on angle x would be quite usefull to build better AI.
Something like AI_Sprite.raycast.checkDistance(angle) would return the distance to the obstacle at the angle choosen.
image
It could be used to support the pathfinding behavior to:
1. keep the AI from grinding along the walls (keep a little distance from walls or move in the center of hallways... stuff like that)
2. interact with or avoide moving obstacles without refreshing the obstaclemap of the pathfinding behavior
I know this is all possible with the plugin how it is right now, it would just be more convenient this way i think.
Something like trace ray at angle x starting from pos x,y with max length x would be great no matter what tho :)
B
72
S
29
G
7
Posts: 86
Reputation: 7,613

Post » Fri Jun 10, 2016 12:19 pm

Yeah... this is some solid cool shiz!

I can't wait to see where this goes :D

~Sol
Tired of crappy file hosts that are crappy? Get DROPBOX - https://db.tt/uwjysXJF
Moderator
B
84
S
34
G
40
Posts: 3,032
Reputation: 30,499

Post » Mon Jun 20, 2016 9:56 pm

really cool plugin, thanks!
B
43
S
12
G
14
Posts: 488
Reputation: 10,570

Post » Tue Jun 21, 2016 12:34 am

Fantastic! You are hero, mate!
B
7
S
4
Posts: 8
Reputation: 691

Post » Sat Jul 30, 2016 5:53 pm

Frankly, Ashley should have included this 5 years ago. The lack of this feature is the #1 reason I am currently developing in unity instead of c2. Great addition!
Image
B
33
S
11
G
2
Posts: 564
Reputation: 5,163

Post » Mon Aug 01, 2016 2:56 am

Feature request:
There are already has normal angle, reflection angle. It might be possible to add expression to get angle of polygon -
The normal angle is orthogonal with polygon angle.
B
109
S
27
G
277
Posts: 4,482
Reputation: 154,924

Post » Mon Aug 22, 2016 7:13 pm

Hello, I do not know if this bug has been reported but I'll do it now.
I guess it's a bug in the plugin.
Any clue of the problem?

Image

By the way, thanks for the plugin !.
B
30
S
13
G
21
Posts: 838
Reputation: 14,656

PreviousNext

Return to Work in Progress Addons

Who is online

Users browsing this forum: No registered users and 1 guest