Need adv python help, Property passing system

this object (some of you may know/hate it)

passes rays from one object to another, then uses the ray to to set the property hostID, which works great, but only for 1 ray,

I need instead, for it to be triggered to cast the ray from a property per face, so up to 30 rays can be cast from the 30 labeled faces,

so it can potentially traffic data in all directions per frame,

so right now, the script uses the name "Sensor_"Integer to set up the faces using polydata,

any questions are welcomed / appreciated,

@ this point it is still a little buggy, hitting face 9 hits 7 instead, and I don’t know why yet,

Attachments

CubicDebug.blend (640 KB)


.1 - it gathers polydata, builds a numbered list,

.2 - gathers materials for each poly, makes “polydata” using ( “Sensor_” Integer) in the material name

Once only /\

.3- Uses host Id to look up polydata,

.4 -casts ray from face identified in HostID

-==hits any face that has polydata, looks up face, looks up pair , sets HostId in object hit by ray to == opposing face from pair…

Example(current version)
pairs -[ [1, 2], [3,4], [2,1], [4,3]]
I am a cube, my hostId is 1 so I cast a ray from 1
I hit cube 2, his host Id is 4,
I look up his “paired” face, it is 3
I set his host Id to 3 and mine to 0,

Example next version(what I need some help writing out)
I am a cube I have 30 properties that represent a label I am to pass,
I have 30 “indexes” 1 for each face,

If my face label property changes to anything but empty, cast a ray from the corresponding face based on face index,

if it hits a face that has poly data, change it’s label to my label, and remove my label back to empty,

for all 30 faces potentially for every frame

another object ->set Property FaceLabel_01= “Anything”

Property FaceLabel_01 is not “empty”
look up FaceIndex_01 which is “2”
cast ray from 2
if I hit another polydata mapped item “cube 2 face 05”
look up FaceLabel_05 for that face on that item
change propertyl FaceLabel_05 to “Anything”

this trips cube 2 to fire on the next frame, passing “Anything” to the next cube it hits or “effector” that uses “property” to do things

Bump (edited above extensively)

So ya, about python… it is a large snake that eats rabbits…

o ya, the language, I could use some help, I know this may sound simple, or complicated, but I do need help,

I want all of us to make a game together as well,
I will credit all who help in a real manner
(so far Akira_B and a certain anonymous coder who may get a credit if he wants it later in the game)
I want to showcase the bge as a game that teaches while fun,

This cube is a linchpin in the whole system, the actuators that run from the properties passed are simple compared to the “Terminal index” for any shape*** it is a cube now…? what could it be…

A car frame, with “link” points for many things…
A helicopter/hovercraft/swamp boat/boat thing…
A mech “center”

Help me make this :slight_smile:

Unknown forces are said to linger to help the bold,
lets upgrade the future :slight_smile:

I think I know where to start next, I need to get all properties in the cube into a list…

thinking/writing now,

if you beat me to it, plz post

OK, lets see what we have here!
Before I can be of any help, I need to know what are you trying to do.
So, your system is called…?
This is what I understand of your system:

  1. Is a logical lego system:
    You point/connect a plug from one of the components sides to a inlet/plug on the other component’s side.
    From what I see there is no inlet, just outlets that are inlets as well, sort of like ports. Then the two components must interact according to the side it connects to.

  2. Logical 3D node system:
    Each element is a node that performs certain tasks, each tasks is performed as data goes through it and out from one of the outputs. In such a system, each element needs at list an output or an input. The input will determine what operation the component will execute and the output what the outcome will be.

Then my other questions:

  • Why does it all needs a visual representation? If my guess is correct, you can do this in an abstract level(python), but first you need to design the entire system, so that if someone is to help you , he knows in what to help, not just give a generic help.
  • why do you use rays to have the components communicate? You can simply use properties for that:

Obj_A[“Objects_to_conect”]=components[ ‘Obj_B’] # Object A has a property that gets an object in the scene to connect with no matter the position
Obj_A[“Data_Outputt”]=[(‘a2’, ‘a6’)] # This property determines which data is used for which output . In the lis, the first variable is the input and the last is the output. The tuples in the list are then matched with the "objects_to_conect " list, as a sequentional operation.



In my game I have a similar system for assemblies like 'engines', and document objects like' software'. The quality and the state of a component determine how well it can respond.

You say this is a game, but if I ask again you'll say it's a prototype for a later 3D printing. Your goals are not clear!

Hope this helps a little!

1- These are a start, they represent terminals, for the finished objects like a car frame, or a turret base, or a boat hull, that have attachment points, that many shapes that can lock onto them and pass properties around,

2- The nodes pass properties, the properties then pass, to the effector, the effector does things based on the properties passed to it, (not all properties are happy ones, there is also damage, drain charge, and many others later)

3- you will build the system by hand, similar to mine-craft, but with dynamic chunks, that when they lock together with parenting and for some there will rigid body links hooked to a empty that parents to the item,

I have the animation system for movement almost done, but it needs love, check it out

the 3d printing system will come much later, after I have a decent job or a friend that can use a lithography chamber, for now, a game, that is fun, teaches science, and has depth, and meaning…

:slight_smile:

I was thinking…
My game as the single player Version of your game?

We have the point @ which my ship tried to leave earth (due to robots vaporizing everyone and moving them into the “Sentient space” a massive VR, sim almost more real then earth…

your ship gets away?

the “Wrectified” ship get’s hit on launch, and is stuck in orbit for like 70 years…

Attachments

RunFast.blend (1.95 MB)WRectification.blend (779 KB)

I was thinking…
My game as the single player Version of your game?

No, In my game, the Solar system goes through a bad time (solar storm). The ships are kept by the robots and they finally reach a stellar system, the closest, since the ships get badly damaged by collisions with asteroids, debris and tons or radiation…
By that time, the human race has gone extinct for a few centuries, the ships need to be restored to a certain point that they can at least power the bio generators and have humans back to life. The machines do that job, thus they save the human race!


You really need to work your comunication skills!
My enumarations were me guessing what your sistem is. From what you now explay, it’s just an harpoint sytem to add modules to a mainframe.
You Number 3, is a BGE impossibility! You can’t possibly have too many dynamic components with logic in one scene, worse : parented!
I really have to run some tests to see what can and cannot be done!
Please review your design, some of us have tried many things already and are familiar with the BGE limits, please heed the advice! Let go of the mouse and take the pencil and pare and design a complete system.
For what I see your system might be a modular one, so each component will have a small function to do and you’ll need a big contraption to have a specific function. With a simple python object, you can program various functions int it, so you’ll have one object that can do a range of things, the modules will just be visual representation, and need not to be dynamic!

The items are dynamic while not attached, then they parent to the “root” object or 6d0f link,

so there will @ the max be like 15 dynamic objects,

so I take a dynamic attach it and then replace the model with a static one?, and then breaking off switches back to a dynamic?

Why don’t you parent evey piece onto the cube with no collision.Which is in the physics tab and also make them invisible.Then make them visible when the character is usuing them.Then switch states to activate them.You could seperate your scene into multiple scenes,for your many dynamic objects and use a save and load script to send messages between scenes.I would also parent a empty to every spot where the items attach that would emit a object that is dynamic,when you want to unattach the item and deactivate with a state.I would really try to solve your problem a different way.You need to think outside the box.If i new how to code as well as you do.I would have solved my problem already.

The items like motor, can be touched by the player with his “cattle prod” energising them for a moment, causing them to spin etc,
same with a laser, or any piece,

the “cattle prod” can apply the property “Power on” or “power drain”
after a power drain, the player can unleash a more powerfull “power on” overloading some enemies and causing them to fall apart…

So, the enemy will be ----- Torsos, Sensor heads, weapon attachments, motors,wheels etc

as for the puzzles will be -here is a blue print, go find parts, Build magnetic car, use to drive on side of skyscraper up to a inaccessible area without the mag car,

0 views on .blends…

:frowning:

I looked at your blend.So the forum registered me as a nonperson right.

lol, you saw it?

like it?

It looks good.