Python Coding Tutorials *Current Amount: 3*

Go down

Python Coding Tutorials *Current Amount: 3*

Post by Gitert994 on Mon Aug 04, 2008 4:52 pm

Intro/LESSON 1

What color symbols mean in PYTHON!!
Let's run through some of the colors of the text.
***********************************
Blue


Blue is the class of code


Red


Red: Starts with a # sign. Means will not be active in the code. Like this:
#racer
Config.define("game", "rbnote", int, 0, text = _("Rock Band Version"), options = {0: _("Regular"), 1: _("Beta")}) #racer

The #racer will be in red text but will not be used as part of the code. He put it there for other coders to show he did it.
Red is only used when code is commented out


Green

Green: Only comes after "quotes". All quotes stays green until quote is closed. Means Text. Will apear as text in game
#racer
Config.define("game", "rbnote", int, 0, text = _("Rock Band Version"), options = {0: _("Regular"), 1: _("Beta")}) #racer
The quotes of Rock Band Version appear in the options pannel. If you remember your options you pick which version you want.
green is exact words the game gets or text for in game display

Yellow

Yellow: Only appears for certain words. Means your importing or doing other stuff. Acts like normal black text. Defining code (def)


Purple

Purple: Only activates at the text False and True with the first letter being capitalized. Does not need explanation. Int, bool, none, plus more


NOTE: This first tutorial was created by Jrdn and myself.

LESSON 2
Both Found In GAMENGINE.PY

Changing the version name of the window. Found on line 259. (VERSION NOT GAME NAME) Just Change This Code Name To Whatever You Want The Frets On Fire Window To Be Named.
Code:

self.versionString = "MFH-Alarian Mod v2.900" 
Changing the actual title. Found on line 278. Just Change This Code Name To Whatever You Want The Window To Be Named.
Code:

self.title            = _("Frets on Fire " + self.versionString)

This tutorial was made by me


LESSON 3 Moving the maintext
There are 2 ways going about doing this. You can change the settings in the library.zip, or create a theme.ini in your theme folder.

Library.zip Way


Back up your library.zip, open up the MainMenu.py inside with Python IDLE.

GH3 Text


To Change The GH3 Text, It's This Code
Code:

self.BGText.transform.translate(w*0.7,h*0.8-(h*0.09)*i)

0.7's Width, 0.8's Height. Change them around til' you find the spot of the Main Text You Want.

8BIT Text

Code:

self.BGText.transform.translate(w*0.5,h*0.45-(h*0.09)*i)

Same instructions as GH3.

Rock Band

This Code
Code:

self.BGText.transform.translate(w*0.2,h*0.8-(h*0.12)*i)

Same Instructions As Rock Band
***********************************************************~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
THEME.INI Way

go into the theme folder you want to change the Text In.
in the Main directory of the folder (where the editor,notes,starpower is ) create a new text document. Edit it and put this inside -----

Code:
[theme]
menu_x = .75
menu_y = .47
background_color = #000000
.

Replace the the .75 and .49 with numbers to change the text position. Menu_x is width, menu_y is Height. after you're done, save it as theme.ini. (make sure you save it in your theme folder. Load up Frets On Fire and you should be done. This works for every single theme.

Enjoy

This tutorial was made by Jrdn


Last edited by Gitert994 on Mon Aug 04, 2008 9:44 pm; edited 1 time in total

_________________
I will teach you python on this forum......

Gitert994
Moderator

Posts : 36
Join date : 2008-08-04

View user profile

Back to top Go down

Re: Python Coding Tutorials *Current Amount: 3*

Post by Maze on Mon Aug 04, 2008 8:46 pm

stickied.

Maze
Admin

Posts : 55
Join date : 2008-07-11
Age : 24
Location : Here?

View user profile http://rockstar.forumakers.com

Back to top Go down

Re: Python Coding Tutorials *Current Amount: 3*

Post by jrdnxxhero on Mon Aug 04, 2008 9:15 pm

Don't free willingly post useless posts. Make posts helpful to others.
One word posts, and unhelpful posts removed.

~jrdnxxhero

jrdnxxhero
Moderator

Posts : 32
Join date : 2008-07-11

View user profile

Back to top Go down

Re: Python Coding Tutorials *Current Amount: 3*

Post by KTownEgghead on Mon Aug 04, 2008 9:42 pm

What exactly is being shown in lesson 3? it looks like background changes, although im not sure...
avatar
KTownEgghead

Posts : 27
Join date : 2008-08-04

View user profile

Back to top Go down

Re: Python Coding Tutorials *Current Amount: 3*

Post by Gitert994 on Mon Aug 04, 2008 9:43 pm

Its moving the main text. Fixing now

_________________
I will teach you python on this forum......

Gitert994
Moderator

Posts : 36
Join date : 2008-08-04

View user profile

Back to top Go down

Re: Python Coding Tutorials *Current Amount: 3*

Post by KTownEgghead on Mon Aug 04, 2008 9:48 pm

Gitert994 wrote:Its moving the main text. Fixing now

OH. duuuuhr. i see it now Very Happy thanks!

so this basically works in any mod? like the MFH Alarian mod?

and thanks for the version name window changing. its funny to make it say weird things!
avatar
KTownEgghead

Posts : 27
Join date : 2008-08-04

View user profile

Back to top Go down

Re: Python Coding Tutorials *Current Amount: 3*

Post by Gitert994 on Mon Aug 04, 2008 9:50 pm

Its mainly for MFH. All of regular FoF's files are all compiled.

_________________
I will teach you python on this forum......

Gitert994
Moderator

Posts : 36
Join date : 2008-08-04

View user profile

Back to top Go down

Re: Python Coding Tutorials *Current Amount: 3*

Post by Maze on Mon Aug 04, 2008 9:57 pm

NO there not. - you can get the source files to original fof easily.

_________________

Maze
Admin

Posts : 55
Join date : 2008-07-11
Age : 24
Location : Here?

View user profile http://rockstar.forumakers.com

Back to top Go down

Re: Python Coding Tutorials *Current Amount: 3*

Post by Gitert994 on Mon Aug 04, 2008 9:59 pm

Really? How?

_________________
I will teach you python on this forum......

Gitert994
Moderator

Posts : 36
Join date : 2008-08-04

View user profile

Back to top Go down

Re: Python Coding Tutorials *Current Amount: 3*

Post by kidninjax on Tue Aug 05, 2008 12:10 am

sweet this is really helpful thanks =D
avatar
kidninjax

Posts : 39
Join date : 2008-07-12
Age : 28
Location : My Chair

View user profile

Back to top Go down

Re: Python Coding Tutorials *Current Amount: 3*

Post by acrox999 on Tue Aug 05, 2008 8:46 am

Actually, I don't understand one thing. How do I know the code of the position that I want in theme.ini? Like menu_x = **** I really don't know the code.
avatar
acrox999

Posts : 13
Join date : 2008-07-24

View user profile

Back to top Go down

Re: Python Coding Tutorials *Current Amount: 3*

Post by jrdnxxhero on Tue Aug 05, 2008 8:54 am

You just guess acroxx999. It's always a decimal though in the theme.ini.
Such as .69.

~jrdnxxhero

jrdnxxhero
Moderator

Posts : 32
Join date : 2008-07-11

View user profile

Back to top Go down

Re: Python Coding Tutorials *Current Amount: 3*

Post by acrox999 on Tue Aug 05, 2008 8:59 am

Oh. But it's hard too. Because if I wrong, I need to change it for several times.
avatar
acrox999

Posts : 13
Join date : 2008-07-24

View user profile

Back to top Go down

Re: Python Coding Tutorials *Current Amount: 3*

Post by kidninjax on Tue Aug 05, 2008 10:22 am

that can be true =P.........heh heh
avatar
kidninjax

Posts : 39
Join date : 2008-07-12
Age : 28
Location : My Chair

View user profile

Back to top Go down

Re: Python Coding Tutorials *Current Amount: 3*

Post by Gitert994 on Tue Aug 05, 2008 10:44 am

Thats what makes it fun, yet annoying acrox! Smile

_________________
I will teach you python on this forum......

Gitert994
Moderator

Posts : 36
Join date : 2008-08-04

View user profile

Back to top Go down

Re: Python Coding Tutorials *Current Amount: 3*

Post by Maze on Tue Aug 05, 2008 3:26 pm

you just guess and guess until you get closer and closer and get it

_________________

Maze
Admin

Posts : 55
Join date : 2008-07-11
Age : 24
Location : Here?

View user profile http://rockstar.forumakers.com

Back to top Go down

Re: Python Coding Tutorials *Current Amount: 3*

Post by kidninjax on Sat Aug 09, 2008 11:47 pm

teh lolz0rz
avatar
kidninjax

Posts : 39
Join date : 2008-07-12
Age : 28
Location : My Chair

View user profile

Back to top Go down

Re: Python Coding Tutorials *Current Amount: 3*

Post by Sponsored content


Sponsored content


Back to top Go down

Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum