Importing key bindings and variables with phunlets
3 posts • Page 1 of 1
Importing key bindings and variables with phunlets
I've made a laser tank which turns its cutting laser on and off with a key, but importing it as a phunlet doesn't include the necessary thyme to make it work properly. So I propose that all variables from the phunlet are imported into the scene you have, as well as the scripts applied to any objects. Not out of the question, I hope?
So long as variable names don't collide. And in fact, if they do, you could perhaps auto-assign them with an extra 001 at the end or something.
So long as variable names don't collide. And in fact, if they do, you could perhaps auto-assign them with an extra 001 at the end or something.
-
ShnitzelKiller - Posts: 49
- Joined: Sun Sep 06, 2009 9:42 pm
Re: Importing key bindings and variables with phunlets
This is actually very easy to do.
To make something phunlet safe You need to create the variable with oncollide
The := means a new variable.
The := is also used with spawing objects in the sense the objects didn't have certain internal variables thus the := is necessary.
Using the := when not creating variable will simply clutter up the console with error messages.
Enjoy your phunlet safeing experiences.
To make something phunlet safe You need to create the variable with oncollide
- Code: Select all
Scene.my.test := 10
The := means a new variable.
The := is also used with spawing objects in the sense the objects didn't have certain internal variables thus the := is necessary.
Using the := when not creating variable will simply clutter up the console with error messages.
Enjoy your phunlet safeing experiences.
-
Mystery - Posts: 2802
- Joined: Thu Sep 03, 2009 1:16 pm
- Location: Southern Australia
Re: Importing key bindings and variables with phunlets
Mystery wrote:This is actually very easy to do.
To make something phunlet safe You need to create the variable with oncollide
- Code: Select all
Scene.my.test := 10
The := means a new variable.
The := is also used with spawing objects in the sense the objects didn't have certain internal variables thus the := is necessary.
Using the := when not creating variable will simply clutter up the console with error messages.
Enjoy your phunlet safeing experiences.
That should be changed... to have to have some constant collider just to set a variable in a phunlet imported?
EDIT: AARGH! The script fields don't get saved!
Well, particularly the "cutter" field in the laser options, when I save the phunlet, it's not there on the next load. Even if I set the variable in the console in that scene under scene.my.
-
ShnitzelKiller - Posts: 49
- Joined: Sun Sep 06, 2009 9:42 pm
3 posts • Page 1 of 1
Who is online
Users browsing this forum: No registered users and 9 guests