Page 1 of 1

Pages and AlcScript / Python [solved]

PostPosted: Sun Jul 14, 2013 9:48 am
by tachzusamm
It seems when I put objects in other pages than page 0, either AlcScript ignores them or the belonging Python code does not process those objects.

Example AlcScript (cutout):
Code: Select all
                  - type: sceneobjectlist
                    refs: ['scnobj:ObjInPage0',
                           'scnobj:ObjInPage1]

Both objects export fine, I can see them in the Age.
ObjInPage0 (which is an object exported to page 0 obviously) is processed by my Python code, but ObjInPage1 is not.

How can I do that?

Re: Pages and AlcScript / Python

PostPosted: Sun Jul 14, 2013 10:30 am
by dendwaler
In my Opinion there is no need to define the page in the Alctscript.
the only place to define an object is the " page_num" property in the logic window (f4), thats all.
When not i do not understand your question.

Re: Pages and AlcScript / Python

PostPosted: Sun Jul 14, 2013 10:36 am
by tachzusamm
I did not mean how to assign objects to pages for export; that works already. I get that object OjbInPage1 exported to another prp (another page) exported fine. No AlcScript needed here, I know.

What does not work is scripting that object, e.g. hiding it with Python using <object>.draw.disable()
This works only for objects exported to page 0.

Re: Pages and AlcScript / Python

PostPosted: Sun Jul 14, 2013 10:55 am
by Sirius
IIRC, AlcScripting for object A will always reference object B or C as part of the same PRP as object A. Which means your python file gets a reference to a sceneobject which does not exist since it's not in the correct PRP.

I don't know whether this can be fixed at all, in case it isn't, the best option is to put all objects in the same PRP. Or edit the PRP after exporting it (obviously not the best way).

EDIT: Tach, try the following reference in your AlcScript:
scnobj:ObjInPage0@Page0Name

Re: Pages and AlcScript / Python

PostPosted: Sun Jul 14, 2013 11:36 am
by tachzusamm
Thank you Sirius.

Unfortunately, putting all objects into the same PRP is not an option if I want to take advantage of your low-memory exporter patch - which works great by the way.

My object(s) which trigger the Python action must be on a page different from the affected objects.
Would using SDL be an option?

But then the next question arises: Is it possible to send SDL messages to only one single player (the player that causes the SDL state change) instead of affecting all other players?

Background: For Relativity, it turned out that using VisRegions alone does not work well because the 3 orthogonal planes, each of them representing a dimension, intersect. So I've set up an active hiding of objects that the player isn't supposed to see when he is in one of the 3 dimensions in Relativity because those objects belong to different dimensions. Of course this should affect only that player who switched to that dimension. This already works well and pleasing, but now I'm sort of stuck when there are lots of objects in the Age which do not export all into the same PRP. PyPRP stops using a memory error. Using multiple pages would solve it.

Re: Pages and AlcScript / Python

PostPosted: Sun Jul 14, 2013 11:53 am
by Christian Walther
Sirius wrote:EDIT: Tach, try the following reference in your AlcScript:
scnobj:ObjInPage0@Page0Name

The documentation for which is here (I have no idea whether it is accurate or complete).

Re: Pages and AlcScript / Python

PostPosted: Sun Jul 14, 2013 12:21 pm
by tachzusamm
Sirius wrote:EDIT: Tach, try the following reference in your AlcScript:
scnobj:ObjInPage0@Page0Name


Hey, this sound good. I will try it.
Also thank you, Christian.

So if my second "page" has a name like "SecondPage" in the Book, this will be the name to use as well, reading "scnobj:ObjInPage1@SecondPage",
or should it read something like "scnobj:ObjInPage1@Relativity_District_SecondPage"?


UPDATE: It works ! Great!
Thanks to everybody who helped in getting this right.

(scnobj:ObjInPage1@SecondPage was the correct syntax)