Using Plasma in python script

For questions about using Classic.

Post » Sun Jul 31, 2011 9:11 am

There is test cap file:
http://dl.dropbox.com/u/5779181/Plasma_test.7z

I transfer these event:
+ System: Always (every tick)
-> fireball: Set position to object rot_arm (image point 1)
-> Plasma: Paste fireball into plasma

into python script:
fireball.X = rot_arm.ImagePointX("point")
fireball.Y = rot_arm.ImagePointY("point")
Plasma.PasteObject(fireball)

Plasma is shown in upper case, but not in lower case (python script).

How to using Plasma in python script?
B
97
S
22
G
178
Posts: 4,118
Reputation: 104,043

Post » Sun Jul 31, 2011 9:25 am

You have to use quotes in most of the cases.

if 1:
     fireball.X = rot_arm.ImagePointX("point")
     fireball.Y = rot_arm.ImagePointY("point")
     Plasma.PasteObject("fireball")

btw this "if" doesnt do anything, if you want to use python(properly), learn about the language itself(it's really easy, you can learn the basics in days.)Pecek2011-07-31 09:33:52
B
10
S
6
G
3
Posts: 127
Reputation: 2,481

Post » Sun Jul 31, 2011 1:20 pm

Thanks, the plasma works.
Dose "Plasma.PasteObject("fireball")" means I can not designate a target instance(ex: fireball[0]) from a kind object?


"if 1:" is just a switch to easy turn off python script by change "1" to "0"(just for testing purpose). The built-event can turn off by clicking "Toggle event".
B
97
S
22
G
178
Posts: 4,118
Reputation: 104,043


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 3 guests