Hi all,
At first I don’t want the entertainer in this thread, but now it seems to have been.
I have tried to find out the source of last posted problem, after many experiments (most on the script), some things seems to work.
But other parts of the Script seems to have fails.
from bge import logic as bgalo
from mathutils import Vector
the standards
cont = bgalo.getCurrentController()
scene = bgalo.getCurrentScene()
objects = scene.objects
own = cont.owner
the sensors:
rightGround = cont.sensors[“rightGround”]
leftGround = cont.sensors[“leftGround”]
leftTurn = cont.sensors[“leftTurn”]
the actuators:
StompRight = cont.actuators[“StompRight”]
StompLeft = cont.actuators[“StompLeft”]
RotRight = cont.actuators[“RotRight”]
RotLeft = cont.actuators[“RotLeft”]
the code:
temporary construct:
if(not leftTurn.positive):
StompRight.priority = 2
StompLeft.priority = 1
RotLeft.priority = 3
cont.activate(StompLeft)
own[“leftS”] = 1.0
cont.deactivate(StompLeft)
cont.activate(StompRight)
own[“rightS”] = 1.0
cont.deactivate(StompRight)
cont.activate(RotLeft)
own[“leftRot”] = 21.0
cont.deactivate(RotLeft)
own[“leftTurnState”] = 0
if(leftTurn.positive):
if(rightGround.positive and leftGround.positive):# and own[“leftTurnState”] is 0):
print(“leftTurn triggered”)
cont.activate(StompLeft)
cont.deactivate(StompRight)
cont.deactivate(RotLeft)
StompRight.priority = 3
RotLeft.priority = 2
StompLeft.priority = 1
if(own["leftS"] < 11.0):# lift the left hoof
cont.deactivate(RotLeft)
cont.deactivate(StompRight)
print(“should lift the left hoof”)
own["leftS"] += 1.0
cont.activate(StompLeft)
elif(own["leftS"] >= 11.0):
own["leftTurnState"] = 1
print("ready to rotate")
cont.deactivate(StompLeft)
if(not leftGround.positive and rightGround.positive):# and own["leftTurnState"] is 1):
cont.deactivate(StompLeft)
cont.deactivate(StompRight)
cont.activate(RotLeft)
StompRight.priority = 3
StompLeft.priority = 2
RotLeft.priority = 1
print(“left leg should rotate to left”)
if(own["leftRot"] < 41.0):# rotate the left leg
cont.deactivate(StompLeft)
cont.deactivate(StompRight)
print("left leg should rotate to left 1b")
own["leftRot"] += 1.0
cont.activate(RotLeft)
#if(leftTurn.positive and own[“leftS”] >= 11.0 and own[“leftRot”] >= 41.0):# and rightGround.positive and not leftGround.positive):
print(“ready to let the left hoof down”)
elif(own["leftRot"] >= 41.0):
own["leftTurnState"] = 2
if(not leftGround.positive and rightGround.positive and (own["leftS"] < 21.0 or own["leftRot"] >= 41.0) and own["leftTurnState"] is 2):
cont.deactivate(RotLeft)
cont.deactivate(StompRight)
cont.activate(StompLeft)
StompRight.priority = 3
RotLeft.priority = 2
StompLeft.priority = 1
print(“left hoof should let down”)
cont.deactivate(RotLeft)
if(own["leftS"] < 21.0):# let the left hoof down
cont.deactivate(RotLeft)
cont.deactivate(StompRight)
print(“let the left hoof down”)
own["leftS"] += 1.0
cont.activate(StompLeft)
else:
print(“ground-fail”)
#if(leftTurn.positive and own[“leftS”] >= 21.0 and own[“rightS”] >= 11.0):
if(own[“leftS”] >= 21.0):
own[“leftTurnState”] = 3
if(leftGround.positive and rightGround.positive and own[“leftS”] >= 21.0 and own[“leftTurnState”] is 3):
print(“should lift the right hoof”)
cont.deactivate(RotLeft)
cont.deactivate(StompLeft)
if(own[“rightS”] < 1.0 or own[“rightS”] >= 9.0):# lift the right hoof
own[“rightS”] = 1.0
if(own["rightS"] < 11.0):
print(“lift the right hoof”)
own["rightS"] += 1.0
cont.activate(StompRight)
#if(leftTurn.positive and own[“rightS”] >= 11.0):
if(leftGround.positive and not rightGround.positive):
print(“left leg should rotate to right”)
cont.deactivate(StompRight)
if(own[“leftRot”] < 41.0):# rotate the left leg
own[“leftRot”] += 1.0
cont.activate(RotLeft)
#if(not leftTurn.positive and own[“rightS”] >= 11.0):
if(leftGround.positive and not rightGround.positive):
print(“left leg should rotate to center”)
cont.deactivate(StompRight)
if(own[“leftRot”] < 21.0):# rotate the left leg to center-rotation
own[“leftRot”] += 1.0
cont.activate(RotLeft)
#if(own[“rightS”] > 11.0):
if(leftGround.positive and not rightGround.positive):
cont.deactivate(RotLeft)
if(own[“rightS”] < 21.0):# let the right hoof down
cont.activate(StompRight)
own[“rightS”] += 1.0
pass##stop commenting
#elif(own[“leftRot”] >= 41.0 and not leftTurn.positive):
print(“left leg over rotated!”)
if(rightGround.positive and leftGround.positive):
print(“both hooves on the Ground”)
if(own[“rightS”] < 11.0):# lift the right hoof
own[“rightS”] += 1.0
if(own[“leftRot”] < 21.0):# rotate the left leg to center-rotation
print(“left leg should rotate to center”)
own[“leftRot”] += 1.0
if(own[“rightS”] < 21.0):# let the right hoof down
own[“rightS”] += 1.0
else:
print(“There is a fail!”)
pass
cont.deactivate(StompLeft)
cont.deactivate(StompRight)
cont.deactivate(RotLeft)
Line 66 seems to be the most problematical line.
The file is this: https://www.dropbox.com/s/vyt64ru4r83z2cd/Minotaurus_Mirius_Testing429(new_scaled_packed_translated).blend.zip
If you ask yourself what I want to reach with it:
I want to reach that the friction of the hoof let rotate the character.
In long form, it are these steps, splited in three Actions:
Lift the left hoof - 1st action till the frame 11 (that works)
rotate the left leg in the vertical axis to right - 2nd action from frame 21 till frame 41 (that don’t want to work)
let the left hoof down - 1st action frames 11 till 21 (that works again)
lift the right hoof - 3rd action frames 1 till 11 (there I have not seem that it works, I want to overwork this later)
the rest of the steps are commented out, because, I want the steps above running correctly bevore I go on with it.
Best Regards, Arne.
EDIT: Yesterday Evening approximately at 22:15 Central European Time, I’ve been gone mad and have rewriten the script. Now an other way to use actions directly per Script did work correctly.
Well the desired rotational motion of the whole ragdoll is not carried out. There I want so see whats happening with it.
But the texture-problems aren’t resolved, there I need that anyone explains it to me.