Jump to content

  • Log In with Google      Sign In   
  • Create Account

Scouting Ninja

Member Since 04 Mar 2013
Offline Last Active Today, 11:17 AM

Posts I've Made

In Topic: Tutorial Series

Yesterday, 11:48 AM

Personally I would like to see a topic on anatomy, I find that it's the largest deference between programmer art and professional art.

Anatomy is also useful for 2D, 3D and animation art.

In Topic: What's the problem here !?

16 August 2014 - 05:43 PM

When using raw_input python will prompt you for the input.

All that raw_input does is convert the raw data text into a input()

TextHolder = input('->')

It will now print:

-> Now you type your text

This will give you a error.


if you did this

-> "Now you type your text"

"Now you type your text"  #it will print this

TextHolder = raw_input('->')

It will now print:

-> Now you type your text

"Now you type your text"


if you did this

-> "Now you type your text"

""Now you type your text""  #it will print this with "Now you type your text" inside a string.


The code you are using allows you to change the name of the file with what you type in after "^_^"



You will need to use the new file name to read it now or a value linked directly to the file like "another".



print(mfile) # to see what is inside

In Topic: What's the problem here !?

15 August 2014 - 06:08 PM



from sys import argv
script , myfile=argv[0],argv[1]
print "here bro" :                        #this is where you printed the memory
rfile=open(myfile)                      # rfile now = myfile open to reading
print rfile.read()                         # same as open(myfile).read()
print "*" * 5
print "type ur file again"
another=raw_input("^_^ ")         #another =  A raw input into the file
mfile=open(another)                 #mfile is new
print mfile.read()                       #this will now print the raw input
print rfile.read()                        #will print your old file again
I hope this helps, read the python manual it's well worded and easy to learn.

In Topic: What's the problem here !?

15 August 2014 - 05:04 PM

If you wan't to wright something into the file use:

Myfile = open('Name of file',w)
Myfile.write( 'Text')


If you want to read something use this:

Myfile = open('Name of file',r)
OutText = Myfile.readline()
print(OutText )


I also think you have to import the pickel module

import pickle


It looks like you used: print(rfile)

That prints the object and it's place in the memory not the contents of the file.


edit: fixed code blocks

In Topic: Predicting a sequence of positions

15 August 2014 - 02:29 PM

When using polynomial I tend to stick with range three or four for stability, splines can also smooth out any problems from large polynomials.


The question is do you need polynomials?

Polynomials only predict possible position and works best in stable environments and short burst, something like the car hitting the wall will cause large irregularities.

Using a short range means that the polynomial can quickly forget any irregularities and stabilise again.


If you just want a simple possible point of where something could be just do:


record 3 points of the car position. e.g. (0,0,0) (1,0,1) (2,0,4)

Average out the difference. e.g.

(1,0,1) - (0,0,0) = (1,0,1)

(2,0,4) - (1,0,1) = (1,0,3)


(1,0,1)+(1,0,3) = (2,0,4)/2 =(1,0,2)


add this to the last know position. e.g.

(2,0,4)+(1,0,2) = (3,0,6) //This is where it could be at.


I used this once in a space game and found it to work OK.