🤑 Indie game store🙌 Free games😂 Fun games😨 Horror games
👷 Game development🎨 Assets📚 Comics
🎉 Sales🎁 Bundles

General Scripting question

A topic by JJXB created Apr 01, 2018 Views: 101 Replies: 5
Viewing posts 1 to 3

looking through the scripting manual, it seems that you can't change the geo shape of an object from a script, only read what type it is. am i misreading things or are you planning to add that as a feature?

Yes. This is something I was wondering as well. It would be nice to go through the game tagging objects, and then run a script to change it all at once.

What scripting currently allows you to access is the shape/shape3D instances of the current frame, not the pattern3D collection. The shape3D has more or less the same property set as the pattern3D and filled by the linked pattern3D before modified by scripting. To semi-automatic changing geo-type and other properties, you could use "Track" feature or  Property Slots.

(Edited 1 time)

No you can't do it with the current system. The reason is when you change the geo value, the engine will have to re-calculate the 3d model data, that's a massive work because scripting is executed every frame.

figured it was worth asking about and the reasoning makes sense. though in the scripting manual it also says that things like Rot, Offset and Pivot are also listed as get only:

PVector3 Scale { get; }
PVector3 Rot { get; }
PVector3 Offset { get; }
PVector3 Pivot { get; } // the pivot of scale and rotation operation

even though you can have a script modify those temporarily. are those only modifiable because those aren't recalculating all the data per frame, just that one attribute?

No it's not like that. It's "get" only because the purpose is to get the pointer to the real Vector3 data (hence PVector3), after that you could modify it by access each individual field. Something like:

shape3D.Scale.x = 90

shape3D.Scale.y = 45

You got what i mean.