another script
3 posts • Page 1 of 1
another script
there might already be a post of this out i didnt check but to the point.
i know u can put varibles in objects but i dont know how to change or read them in another object is it. first i am wondering is it possible for another object to read it without touching it? second i am wondering can u change those object variables by touching them? i am working on a scene for a PHUNLET that needs a varable but it cant be a scene variable
i know u can put varibles in objects but i dont know how to change or read them in another object is it. first i am wondering is it possible for another object to read it without touching it? second i am wondering can u change those object variables by touching them? i am working on a scene for a PHUNLET that needs a varable but it cant be a scene variable
- crigger61
- Posts: 5
- Joined: Mon Oct 26, 2009 9:22 pm
Re: another script
All of that's possible.
Millions of voices suddenly cried out in terror, and were suddenly silenced. Something terrible has happened.
-
RicH - [Funniest Person 2010]
- Posts: 2043
- Joined: Tue Sep 01, 2009 9:01 am
Re: another script
For this example the variable will be test
To create an internal variable in that objects scripting menu in the bottom there is a black space type in
To create an internal variable.
To edit this oncollide treat this variable like any other variable oncollide
Do do this with out touching use a system variable unique to that geometry create a system variable by opening the console (~) And typing in
To make the internal variable equal to the external variable in the oncollide on the object type in
To make the external variable the same as the internal reverse the code
To do this with them touching each other
If you have a phunlet that requires an external variable It is best not to use internal variable as an alternative instead create the external variable oncollide Like so
As soon as the scene starts now scene.my.test will be created. This will generate error codes if it is hit more then once.
To create an internal variable in that objects scripting menu in the bottom there is a black space type in
- Code: Select all
test := 0
To create an internal variable.
To edit this oncollide treat this variable like any other variable oncollide
- Code: Select all
e.other.test = 4
Do do this with out touching use a system variable unique to that geometry create a system variable by opening the console (~) And typing in
- Code: Select all
Scene.my.test := 1
- Code: Select all
Scene.my.test = scene.my.test - 5
To make the internal variable equal to the external variable in the oncollide on the object type in
- Code: Select all
e.this.test = scene.my.test
To make the external variable the same as the internal reverse the code
- Code: Select all
scene.my.test = e.this.test
To do this with them touching each other
- Code: Select all
e.this.test = e.other.test
If you have a phunlet that requires an external variable It is best not to use internal variable as an alternative instead create the external variable oncollide Like so
- Code: Select all
scene.my.test := 1
As soon as the scene starts now scene.my.test will be created. This will generate error codes if it is hit more then once.
-
Mystery - Posts: 2802
- Joined: Thu Sep 03, 2009 1:16 pm
- Location: Southern Australia
3 posts • Page 1 of 1
Who is online
Users browsing this forum: No registered users and 5 guests