forked from BlenderDumbass/DanisRace
62 lines
1.9 KiB
Python
62 lines
1.9 KiB
Python
# MACHINE GENERATED
|
|
import bge, bpy, sys, importlib
|
|
import mathutils
|
|
from uplogic import nodes
|
|
import math
|
|
|
|
def _initialize(owner):
|
|
network = nodes.LogicNetwork()
|
|
CON0000 = nodes.ConditionOnce()
|
|
ACT0001 = nodes.VehicleSetAttributes()
|
|
ACT0002 = nodes.ActionCreateVehicleFromParent()
|
|
ACT0003 = nodes.VehicleApplyForce()
|
|
CON0004 = nodes.ConditionKeyPressed()
|
|
CON0000.input_condition = False
|
|
CON0000.repeat = False
|
|
CON0000.reset_time = 0.5
|
|
ACT0001.condition = ACT0002.OUT
|
|
ACT0001.constraint = ACT0002.VEHICLE
|
|
ACT0001.wheelcount = 4
|
|
ACT0001.set_suspension_compression = False
|
|
ACT0001.suspension_compression = 0.0
|
|
ACT0001.set_suspension_stiffness = False
|
|
ACT0001.suspension_stiffness = 0.0
|
|
ACT0001.set_suspension_damping = False
|
|
ACT0001.suspension_damping = 0.0
|
|
ACT0001.set_tyre_friction = False
|
|
ACT0001.tyre_friction = 0.0
|
|
ACT0001.value_type = 'REAR'
|
|
ACT0002.condition = CON0000
|
|
ACT0002.game_object = "NLO:RedKissBox"
|
|
ACT0002.suspension = 0.05999999865889549
|
|
ACT0002.stiffness = 50.0
|
|
ACT0002.damping = 5.0
|
|
ACT0002.friction = 2.0
|
|
ACT0002.wheel_size = 1.0
|
|
ACT0003.condition = CON0004
|
|
ACT0003.vehicle = "NLO:RedKissBox"
|
|
ACT0003.wheelcount = 2
|
|
ACT0003.power = 1.0
|
|
ACT0003.value_type = 'REAR'
|
|
CON0004.key_code = bge.events.WKEY
|
|
CON0004.pulse = True
|
|
network.add_cell(CON0000)
|
|
network.add_cell(ACT0002)
|
|
network.add_cell(CON0004)
|
|
network.add_cell(ACT0001)
|
|
network.add_cell(ACT0003)
|
|
owner["IGNLTree_NodeTree"] = network
|
|
network._owner = owner
|
|
network.setup()
|
|
network.stopped = not owner.get('NL__NodeTree')
|
|
return network
|
|
|
|
def pulse_network(controller):
|
|
owner = controller.owner
|
|
network = owner.get("IGNLTree_NodeTree")
|
|
if network is None:
|
|
network = _initialize(owner)
|
|
if network.stopped: return
|
|
shutdown = network.evaluate()
|
|
if shutdown is True:
|
|
controller.sensors[0].repeat = False
|