[Solved] How to call "System.CreateRelObjIP"?

For questions about using Classic.

Post » Sat Jun 04, 2011 3:24 am

My goal is to replace "Create Object at Image Point" ex:
[code:2ymszz8n]-> System: Create object objB on layer 1 at (0, 0) from objA 's image point "point"[/code:2ymszz8n]
to python script.

I try to call
[code:2ymszz8n]System.CreateRelObjIP(objB, 1, 0, 0, objA, "point")[/code:2ymszz8n]
But get error message
[quote:2ymszz8n]Type Error:CreateRelObjIP() takes exactly 6 arguments (7 given)[/quote:2ymszz8n]

How to pass parameters to System.CreateRelObjIP()?

My construct version:Construct class 1.2

Edit:
"System.Create()" may not work, too.

Edit:
I try
[code:2ymszz8n]System.CreateByName("objB", 1, 0, 0)
SOL.objB.SetPositionToObject(objA, "point")[/code:2ymszz8n]
and doesn't work.

Test cap is here.
http://dl.dropbox.com/u/5779181/create_ ... _point.zip
B
97
S
22
G
177
Posts: 4,111
Reputation: 103,525

Post » Sat Jun 04, 2011 4:13 am

This syntax should work:

System.CreateByName("objB", 1, 0, 0)
SOL.objB.SetPositionToObject("objA", "point")

Note: The quotes around objA.

There might be a bug in the other function as the prototype shows it takes the # of arguments you are sending... maybe ROJO has an idea.
B
8
S
3
G
7
Posts: 835
Reputation: 5,313

Post » Sat Jun 04, 2011 5:09 am

But how to index objA[1], if there are many objA?
[code:24de8rgx]System.CreateByName("objB", 1, 0, 0)
SOL.objB.SetPositionToObject("objA[1]", "point")[/code:24de8rgx]
It doesn't work.

Thanks
B
97
S
22
G
177
Posts: 4,111
Reputation: 103,525

Post » Sat Jun 04, 2011 10:46 am

I'll have to look into it but it seems that CreateRelObjIP is indeed missing a parameter.

Try this to do exactly what CreateRelObjIP would do.
[code:1aur1a40]System.Create("Sprite", 1, Sprite2[1].ImagePointX("point"), Sprite2[1].ImagePointY("point"))[/code:1aur1a40]
B
79
S
24
G
53
Posts: 4,728
Reputation: 40,219

Post » Sat Jun 04, 2011 3:09 pm

That's cool~ Thanks
B
97
S
22
G
177
Posts: 4,111
Reputation: 103,525


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 4 guests