Parent Ray?

Can some_one help me with this? I know I am close…


Example.blend = testbed for RBJ or parent ray…
please grab the .blend, so you get an idea of what I need

Space bar fires “Parent ray”

@ the moment it just passes the property “Parent” with a ray… I need it to also be able to establish a parent relationship…
I think I need to add in A if statement here cleanly in Cube.py near line 72________________________
if hitID < 10:
hitOb[“FaceProperty_0%s” % (hitID)] = object[polyProperties[item]]
else:
hitOb[“FaceProperty_%s” % (hitID)] = object[polyProperties[item]]

object[polyProperties[item]] = “Empty”
object[‘hostID’] = 0
object.state = 1

I think it needs to be something along the lines of

if object[polyProperties[item]]= “Parent”:
object.parent = hitOb
(Next I need the object to get moved into alignment (ray casting face aligned with hit face @ X distance))

I am not sure how though, and I need it to discontinue passing the ray here as well, so “Parent” is not passed just initiated

Attachments

Example.blend (792 KB)

42 views , 0 file downloads?

:frowning:

You have few downloads because your description of the problem is difficult to follow.

What exactly are you trying do accomplish? What is this script supposed to specifically do?

Right now the script is a 3d logic node system, however the nodes @ the moment are assembled in the BGUI.

I want to assemble them in game to make devices,

Tripicus.blend = working system using 3d logic nodes - view this to see what types of systems will be assembled

WRectification.bled = moving blocks around - view this

I need hitting a key to cast a ray and add the property parent to any terminal face on a component that the player is carrying.

So the player can hold a cube in place, look at a “Terminal Face” and apply the property “Parent” and then the cube will attempt to move the object casting the ray into a parallel alignment with the “casting object” having the same side facing the “Ray Struck component”. (as well as parent the “ray caster” to the “Ray struck”)

the 3d logic node system will pass any property that is not “Empty” to another component by casting a ray from it’s “indexed face”

imaging a cube with 5 terminals on each side hooked to a wire, that each wire hooked to a corresponding terminal on another side, so applying power to a terminal on one side, would output power on another side,

now imagine you can pass any property not just power, like Player.worldPosition or Target.worldPosition, and the system would shoot at you, or your enemy, or ???

I hope the system eventually represents all logic functions and will be programmable in game :slight_smile:

Attachments

Tripicus.blend (812 KB)WRectification.blend (779 KB)

Bump Help please?

I really need this
a short list of who could help
Agoose
monster
MarcoIt
Raco
KevinKornigan

Where are you?
I need to know a easy way to align sides of a cube, and I need the “Filters” in the right place…
I am so close, but this is hard for me
???
help?

Try and use full English. I for one don’t particularly like text-slang.
It would help if you could make a flow chart / sketch to illustrate what you need, because I am a little confused reading it.

A “Component Cube” has 30 faces, that are indexed
(faces are indexed by a material like Sensor_X)

  1. Player is holding a component"Cube 1" and aiming cursor at another component"Cube 2"

2.Player hits key R - this locks the cube’s position so you can select a component face, we will say face_X on Cube 1

3.Players script changes property “faceProperty_X” to “Parent”

  1. Cube 1 casts ray from face listed in “faceIndex_X” we will say it’s indexed face 2

5.Cube 1’s ray hits cube 2

6. since the property is “Parent”,
instead of passing the property parent “cube 1” alignes to cube 2 with the sides facing that cast the ray and the struck side of “Cube 2” at a set distance.

(this is where I need help) #6

If I missed anything or something is unclear don’t hesitate to ask,

See the attached .blend?

instead of passing the property on space bar, I would like to parent and align while maintaining the ability to pass other properties…

think of legos snapping together.
(the .blend is worth a million words)
open it hit p and then space, (this passes a property)
I need it to parent and align instead.

Attachments

Example.blend (792 KB)

Example.blend (881 KB)Like this?

Yes !!!

:smiley:

+1000 karma agoose77

but I need the sides of the cube to align, not the indexed faces
think minecraft :slight_smile:

I have been trying to get that going for a month or better !!!
I added

object.setParent(hitOb)

:smiley:

Again thank you!!

Attachments

RaySnap.blend (793 KB)

<blueprintrandom is dancing a jig>

RaySnap.blend (882 KB)
Try this then. Your example only works when the object is axis-aligned

It works magically though there are some bugs in my script I believe.

Hitting face 15 should cast from 16,

instead it casts from face 1,

Could you take a look at it for me?

THANK YOU !!
by the way!

Also I need “Parent” to establish a relationship, but not transfer the property,
so I think I need a if statement in there,

Update

if value !=“Parent”:
hitOb[key] = value

:slight_smile:
line 72

Did it myself :smiley:

Attachments

RaySnapFilter.blend (795 KB)

Ok, so, KevinCornigan helped me, and added states, which was neat, but it makes it break now…

can some one help me depretiate the states as well as Host_Id ?

also debug?

:smiley: