Page 7 of 7

Re: ~Basic Scripting and Editor Help(Easy Scripting Updated!

Posted: Mon Oct 27, 2014 9:57 pm
by zeltak
On the teleporter problem: I found out that I can enable/disable all the components separately.. it works, but takes more work. But I was so accustomed to the LoG1 -style easy mode :roll:

Re: ~Basic Scripting and Editor Help(Easy Scripting Updated!

Posted: Mon Oct 27, 2014 9:59 pm
by Lark
Okay, Zeltak, it's pretty easy and I learned from your question, thank you!

All of the components of an object can be enabled or disabled at will. So the structure is <object name>.<component>:enable()/disable(). So if you want the teleporter there, but not working, you can place it, uncheck at least "particle", "light", "sound", and "teleporter". You can then enable/disable them as you wish using this, for example:

Code: Select all

function activateTeleporter()
  teleporter_1.teleporter:enable()
  teleporter_1.particle:enable()
  teleporter_1.sound:enable()
  teleporter_1.light:enable()
  end

Re: ~Basic Scripting and Editor Help(Easy Scripting Updated!

Posted: Tue Oct 28, 2014 3:57 am
by Komag
You could probably do something like

Code: Select all

for each i in teleporter_1 do
  i:enable
end for

Re: ~Basic Scripting and Editor Help(Easy Scripting Updated!

Posted: Wed Oct 29, 2014 8:53 am
by petri
A better way is to use the controller:

Code: Select all

teleport_1.controller:activate()
teleport_1.controller:deactivate()
teleport_1.controller:toggle()

Re: ~Basic Scripting and Editor Help(Easy Scripting Updated!

Posted: Thu Nov 06, 2014 12:27 am
by zeltak
Thanks, I was sure that I dabbled with the controller, but apparently not. That makes everything easy.