forked from BlenderDumbass/DanisRace
116 lines
3.9 KiB
Python
116 lines
3.9 KiB
Python
# MACHINE GENERATED
|
|
import bge, bpy, sys, importlib
|
|
import mathutils
|
|
from uplogic import nodes
|
|
import math
|
|
|
|
def _initialize(owner):
|
|
network = nodes.LogicNetwork()
|
|
PAR0000 = nodes.ParameterObjectProperty()
|
|
PAR0001 = nodes.ParameterVector3Simple()
|
|
CON0002 = nodes.ConditionCollision()
|
|
CON0003 = nodes.ConditionAnd()
|
|
ACT0004 = nodes.ActionSetGameObjectGameProperty()
|
|
CON0005 = nodes.ObjectPropertyOperator()
|
|
CON0006 = nodes.ObjectPropertyOperator()
|
|
ACT0007 = nodes.ActionSetGameObjectGameProperty()
|
|
ACT0008 = nodes.ActionAddToGameObjectGameProperty()
|
|
CON0009 = nodes.ConditionNot()
|
|
ACT0010 = nodes.ActionApplyLocation()
|
|
CON0011 = nodes.ConditionOnUpdate()
|
|
CON0012 = nodes.ConditionKeyPressed()
|
|
CON0013 = nodes.ConditionKeyPressed()
|
|
ACT0014 = nodes.ActionApplyTorque()
|
|
CON0015 = nodes.ConditionKeyPressed()
|
|
ACT0016 = nodes.ActionAddToGameObjectGameProperty()
|
|
ACT0017 = nodes.ActionApplyTorque()
|
|
PAR0000.game_object = "NLO:U_O"
|
|
PAR0000.property_name = "speed"
|
|
PAR0001.input_x = 0.0
|
|
PAR0001.input_y = PAR0000
|
|
PAR0001.input_z = 0.0
|
|
CON0002.game_object = "NLO:U_O"
|
|
CON0002.use_mat = False
|
|
CON0002.prop = ""
|
|
CON0002.material = None
|
|
CON0002.pulse = True
|
|
CON0003.condition_a = CON0002
|
|
CON0003.condition_b = CON0012
|
|
ACT0004.condition = CON0005
|
|
ACT0004.game_object = "NLO:U_O"
|
|
ACT0004.property_name = "speed"
|
|
ACT0004.property_value = 0.30000001192092896
|
|
CON0005.game_object = "NLO:U_O"
|
|
CON0005.property_name = "speed"
|
|
CON0005.compare_value = 0.30000001192092896
|
|
CON0005.operator = 2
|
|
CON0006.game_object = "NLO:U_O"
|
|
CON0006.property_name = "speed"
|
|
CON0006.compare_value = 0.0
|
|
CON0006.operator = 3
|
|
ACT0007.condition = CON0006
|
|
ACT0007.game_object = "NLO:U_O"
|
|
ACT0007.property_name = "speed"
|
|
ACT0007.property_value = 0.0
|
|
ACT0008.operator = nodes.ActionAddToGameObjectGameProperty.op_by_code("ADD")
|
|
ACT0008.condition = CON0003
|
|
ACT0008.game_object = "NLO:U_O"
|
|
ACT0008.property_name = "speed"
|
|
ACT0008.property_value = 0.0020000000949949026
|
|
CON0009.condition = CON0003
|
|
ACT0010.local = True
|
|
ACT0010.condition = CON0011
|
|
ACT0010.game_object = "NLO:U_O"
|
|
ACT0010.movement = PAR0001.OUTV
|
|
CON0012.key_code = bge.events.UPARROWKEY
|
|
CON0012.pulse = True
|
|
CON0013.key_code = bge.events.LEFTARROWKEY
|
|
CON0013.pulse = True
|
|
ACT0014.local = True
|
|
ACT0014.condition = CON0013
|
|
ACT0014.game_object = "NLO:U_O"
|
|
ACT0014.torque = mathutils.Vector((0.0, 0.0, 100.0))
|
|
CON0015.key_code = bge.events.RIGHTARROWKEY
|
|
CON0015.pulse = True
|
|
ACT0016.operator = nodes.ActionAddToGameObjectGameProperty.op_by_code("ADD")
|
|
ACT0016.condition = CON0009
|
|
ACT0016.game_object = "NLO:U_O"
|
|
ACT0016.property_name = "speed"
|
|
ACT0016.property_value = -0.0010000000474974513
|
|
ACT0017.local = True
|
|
ACT0017.condition = CON0015
|
|
ACT0017.game_object = "NLO:U_O"
|
|
ACT0017.torque = mathutils.Vector((0.0, 0.0, -100.0))
|
|
network.add_cell(PAR0000)
|
|
network.add_cell(CON0002)
|
|
network.add_cell(CON0005)
|
|
network.add_cell(CON0011)
|
|
network.add_cell(CON0013)
|
|
network.add_cell(CON0015)
|
|
network.add_cell(ACT0017)
|
|
network.add_cell(PAR0001)
|
|
network.add_cell(ACT0004)
|
|
network.add_cell(ACT0010)
|
|
network.add_cell(ACT0014)
|
|
network.add_cell(CON0006)
|
|
network.add_cell(CON0012)
|
|
network.add_cell(CON0003)
|
|
network.add_cell(ACT0008)
|
|
network.add_cell(ACT0007)
|
|
network.add_cell(CON0009)
|
|
network.add_cell(ACT0016)
|
|
owner["IGNLTree_Logic"] = network
|
|
network._owner = owner
|
|
network.setup()
|
|
network.stopped = not owner.get('NL__Logic')
|
|
return network
|
|
|
|
def pulse_network(controller):
|
|
owner = controller.owner
|
|
network = owner.get("IGNLTree_Logic")
|
|
if network is None:
|
|
network = _initialize(owner)
|
|
if network.stopped: return
|
|
shutdown = network.evaluate()
|
|
if shutdown is True:
|
|
controller.sensors[0].repeat = False
|