2008-09-10 03:34:08 +00:00
|
|
|
#!BPY
|
|
|
|
"""
|
|
|
|
Name: 'GameLogic Template'
|
2009-05-11 00:19:55 +00:00
|
|
|
Blender: 249
|
2008-09-10 03:34:08 +00:00
|
|
|
Group: 'ScriptTemplate'
|
|
|
|
Tooltip: 'Basic template for new game logic scripts'
|
|
|
|
"""
|
|
|
|
|
|
|
|
from Blender import Window
|
|
|
|
import bpy
|
|
|
|
|
|
|
|
script_data = \
|
|
|
|
'''
|
|
|
|
def main():
|
|
|
|
|
|
|
|
cont = GameLogic.getCurrentController()
|
2009-05-11 00:19:55 +00:00
|
|
|
own = cont.owner
|
2008-09-10 03:34:08 +00:00
|
|
|
|
2009-05-11 00:19:55 +00:00
|
|
|
sens = cont.sensors['mySensor']
|
|
|
|
actu = cont.actuators['myActuator']
|
2008-09-10 03:34:08 +00:00
|
|
|
|
2009-05-11 00:19:55 +00:00
|
|
|
if sens.positive:
|
|
|
|
cont.activate(actu)
|
2008-09-10 03:34:08 +00:00
|
|
|
else:
|
2009-05-11 00:19:55 +00:00
|
|
|
cont.deactivate(actu)
|
2008-09-10 03:34:08 +00:00
|
|
|
|
|
|
|
main()
|
|
|
|
'''
|
|
|
|
|
2008-10-18 13:33:27 +00:00
|
|
|
new_text = bpy.data.texts.new('gamelogic_simple.py')
|
2008-09-10 03:34:08 +00:00
|
|
|
new_text.write(script_data)
|
|
|
|
bpy.data.texts.active = new_text
|
|
|
|
Window.RedrawAll()
|