Help with changing a working script,

alright, no one can seem to help with polydata, (only the 3 faces Roco set up work)

so moving on until I sort it out,

This system (the .blend) uses rays to edit a property, hostID, instead I need to set up a property for each of the 6 faces, and look up the number of the face using the face index number to get which face to cast a ray from (FaceIndex, and what property to change the “target face’s property” to,

I am not the best @
For loops
Coding Text

Logic I can do anything with… except stuff logic bricks can not do…

Right now faces 1 and 2 and 3 work

so what I need is this in pseudo-code

Cube A
Properties
FaceIndex 1-6
FaceProperty 1-6

Cube A 's property FaceProperty_01 is set to “power”

Script looks up face to cast ray from based on FaceIndex_01

Cube A Casts a ray from face 2

Cube A Ray hits Cube B face 1

Cube A script looks up Cube B face 1’s FaceProperty and changes it to “power”

Cube B’s logic trips when any face property is not “Empty”

Script looks up face to cast ray from based on cube B FaceIndex_01

and so on :slight_smile:

Attachments

CubeWorking (1) (1).blend (501 KB)

No one will even get the .blend?

it works as is, but I need help, if you don’t look at it…
it will never happen…

if you can’t help… it at least looks cool :slight_smile:

Can some one direct me to where I need to go?

Is polyData in bullet trunk or?

Help?

Since Python is your weak point currently, I think you should try to learn it. The script Raco (if I am correct) gave you is thoroughly commented (literally every line, which is awesome of him), but as far as I can see, your project (and the script) is a fairly complex beast. Are you sure you’re currently ready for this particular project?

Maybe you should try something smaller and simpler and re-approach this later, when you’re more proficient with Python, as I don’t think this is one of few times that you will need help with a script. I think you’ll find yourself needing Python more and more to add and build on the concept of the game. I believe either you need someone who will code in Python for you on your project permanently, or you should learn Python to help yourself out.

I’m not trying to be rude here, just stating what I think you need to finish your project.

Anyway, if I understood you correctly, this should be part of what you’re looking for. The faces trigger the other blocks (as before), and they set a variable for the properties of the corresponding face to “Power”. I only added two for the two faces that are being pulsed in the demo - you would have to add the rest for each cube. If you want the cube to only trigger should one of the faces’ properties be “Power” (beside the fact that they already only trigger if something triggers them), then I would implement that part in Python rather than several sensors for each face property.

CubeWorking (1) (1) Power.blend (509 KB)

I need it to pass what ever property started the system

Cube A face 1 property = “Test”

Cube A face 2 casts ray hits Cube B face 1

Cuba A looks up cube B face 1’s property, changes it to whatever it’s own trigger was “Test” in this case

Cube B’s face 1 property != “empty”

Cube B casts ray from face 2 … and so on

Passing the “property” is the point,

so it can pass literally any string, float, or int etc

Thank you for your help, this is def a step in the right direction,

if it takes me 4 years, this will happen :slight_smile:
I just need some help, (I hope I can make the BGE look good ! )

if this is set up this way it can potentially pass data and receive data from each face for each frame

So the “hostID” casting the ray does not work, I need a property for the face to trigger casting the ray, as hostID is not a list, it is a int,

if each face one has two properties then

Cube A
Face_01_index = Face_02
Face_01_property = “Empty”

so if changed to

Cube A
Face_01_index = Face_02
Face_01_property = “Any”

then Cube A casts a ray from Face_02 ->
when it strikes, it changes that property to Face_01_property = “Any”

so in the end, when done correctly, each side can pass data to each other side, @ the same time

If I had a python coder on my team, I would learn by doing, I learned QC. and LSL this way, it is how I learn,

I know how to script, I just don’t know pythons syntax yet,

I am learning :slight_smile:
but I do know what I need to achieve

whoever joins the team, would get credit and potentially money,

@ BluePrintRandom:

I totally agree with SolarLune. And you know, you may get the hang of it sooner than you think. Especially if you would be learning Python independently, because this is actually the best way to learn it. Try, try again and try some more. After a while it will become apparent to finish something before even writing it.

I look @ the script, and all is there, but I am not sure why the other faces “Sensor_04”, “Sensor_05”, “Sensor_06”,
EDIT: NOT working,

I think from what I can tell, Cube A face 5 will cast to Cube B face 5 but not face 1 etc

where is a good place to learn about polydata?

I re-made the scene, from scratch,

Attachments

FreshStart.blend (512 KB)

“Polydata” and “polymat” aren’t data-types - they’re variable names. Poly-data is an object property that is a list, and it stores the material reference (polyMat), the polygon’s normalized position, and the normal vector of the polygon. Try printing them out to see what they do. Most importantly, check out the Blender Game Engine Python API for information. PolyMat will be one of two material types depending on which graphics mode you use (Multi / Single-texture or GLSL).

In the comments you will read:

        <i># create a list</i>
        <b>polyData = []</b>

So ‘polyData’ is created with this line. It’s a list that is created when the script runs for the first time after starting the Blender Game Engine. The list contains data concerning polygons with a material that has a string ‘Sensor_’ in its name.

If you want to know more about (build-in) functions, attributes and methods, search the API. In the code I used the ‘drawLine()’ function. Attributes I used are: ‘owner’, ‘meshes’, ‘numPolygons’, ‘material_name’, ‘material_id’, ‘XYZ’, ‘normal’, ‘worldTransform’, ‘state’ and methods ‘getPolygon()’, ‘getNumVertex()’, ‘getVertex()’, ‘append()’, ‘rayCast()’.

Edit: SolarLune has beaten me to it :slight_smile:

Ok,I printed polyData, and when it works, it makes sense, can you grab the cube and rotate it and tell me why it’s not working?

@ this point I understand

Building lists with for loops
using lists to search against
changing a property based on a list

what I need to know is why it is not working,

Got it!! here it is!

now onto getting rid of host ID

and having a list of properties

FaceIndex 1-30
FaceProperty 1-30

for each cube,
so they are re-programmable and can pass any data set

Attachments

HAHAAH.blend (509 KB)

YAY happy happy joy joy!

@BluePrintRandom:

DO NOT ADD CONSECUTIVE POSTS - EDIT YOUR LAST POST!

I really advice to improve your posting/writing style. Your posts are nearly unreadable and you necessarily flood the forum with them.
If you want help, then present your problems in a way that others can at least understand what your problem is. Avoid any mumbling.

@BluePrintRandom:

DO NOT ADD CONSECUTIVE POSTS - EDIT YOUR LAST POST!

I really advice to improve your posting/writing style. Your posts are nearly unreadable and you necessarily flood the forum with them.
If you want help, then present your problems in a way that others can at least understand what your problem is. Avoid any mumbling.

Avoid any further doushebaggery please , I am not sure if there is a premium on pixels, but I come here to “mumble”

most people, besides a select few, don’t help, they just post stuff like this…