[Update] Script to create ipo

Hi guys,

I would like to know if I can create an ipo curve when I’m runing my game. In fact, I would read a file that contains some informations in order to move my camera and those informations change everytime you launch the game.


Update is here

what are you trying to do? Is this going to be first person, third person or side scroller if so you dont need to animate the camera at all with the ipo curve editor, just parent it to the object your following and make the object move with the wasd controls, unless your thinking of some thing totaly genius if so please explain further.

I think even in 2.5x the runtime will not be able to access the Blender module.
Without that you will not be able to access the IPO curve.

But I might be wrong


billymuncher2 it is a first person game.

In fact the movements are predefined, only the order change. So I think that I will make my movements with some ipo curves and with a logic brick I will move my camera or with a script I don’t know now

thanks for the answers

After some research I found that I could activate Actuators with a python script. I will use this solution, but there is also a problem, when I active an Actuators I use

controller = GameLogic.getCurrentController()
actList = controller.actuators

And for deactivating


But that doesn’t deactivate my Actuators I don’t know why.

what kind of error message are you getting on the console window?:eyebrowlift:

None, that’s why it’s strange…

This is the whole script

controller = GameLogic.getCurrentController()
obj = controller.owner

actList = controller.actuators

sol = open('solution.txt','r')

def decalage ():
	i = 0
	pos = obj.worldPosition
	posc = obj.worldPosition[0]
	while (posc != pos[0] + 1.0) and i < 2000:
		posc = obj.worldPosition[0]
		i +=1
	print i
def mvt_u ():

def mvt_l ():

def mvt_r ():

def mvt_d ():
def desactive ():
 u = up
 d = down
 r = right
 l = left
while t != '3':
  if t == 'u':
    print obj.worldPosition[0]
    #print "up"
    print obj.worldPosition[0] 
    print '
  elif t == 'l':
    print "l"
  elif t == 'r':
    print "r"
  elif t == 'd':
    print "d"
    print "error"

In fact I want to deplace my object from 1 unit that’s why there is a “decalage” function but this doesn’t work to…

The solution.txt is just “u3” for the tests

Well, one problem is that you are trying to activate and deactivate the same actuator in the same logic tic. You can only do one or the other in one logic tic. If you want to activate it, then deactivate, you must deactivate one tic later (that is, the next time the script runs).