How to enter the game industry (Part 8: Ren'py Scripting, Conclusion) [tutorial]steemCreated with Sketch.

in #gaming7 years ago (edited)

part 1: your skills
part 2: Choosing an Engine
part 3: Ren'py Game Engine
part 4: Ren'py Scripting
part 5: Ren'py More Scripting
part 6: Ren'py Scripting, Visuals
<< Part 7: Ren'py Scripting, Dialogue

I've wrote a lengthy post during the past few days but when I hit post and it gone to the new post page, mine wasn't there, I've checked my blog and it wasn't there either, since I didn't back it up I'll have to write it again, this time I'll skip the long parts about copyright, hiring, money, my rant about paypal and dealing with the team members and go straight to the technical tips before I forget what I've wrote.

0.jpg

Tip #1:

You need to backup... well more precisely you need some online space to keep your games file for the whole team to access, something with manageable folder structure and permissions, I suggest google drive, everyone is using it and it's easy to work with, just make a folder for your game and keep your games assets in there.

Tip #2?

You need a fast way to get in touch with your team, despite all of it's problems skype is popular in indie game community. make a group chat and add everybody.

Tip #3:

To send the game at the current stage to other team members you can send them the game folder, it should be easy to zip and upload it, you can even drag the folder to your google drive to share it.
To run the game you received from your team members it's best to create a new game in Ren'py and replace the game folder in your newly created game with the one from the zip file you've received or downloaded from google drive.

Tip #4:

Keep your game folder clean from any file that is not essential to the game itself, you should store your sources, Photoshop files and high resolution files in another folder.

TIp #5:

When you show the characters at left or right they stick to the sides of screen, it doesn't look good, let's fix it and maybe add additional positions out characters can stand at:

init -10:
    default left= Position(xalign=0.1)
    default right= Position(xalign=0.9)
    default midleft= Position(xalign=0.3)
    default midright= Position(xalign=0.7)

image roof day = "img/bg1.png"
image afra angry = "img/afr_01.png"
image bambi = "img/bam_04.png" 
label start:
    show roof day
    "background"
    show afra angry at left
    show bambi at right
    "characters"
    show afra angry at midright as afr2
    show bambi at midleft as bam2
    "More characters"
    return

Run the code above, it should look something like this:

2.jpg

Don't worry I'll explain:
Line 1: init -10: This tells the games engine to load the code under it early to make sure the variables are ready when we try to use them in the script.
Line 2: default left= this line defines (in this case re-defines) an object called left
Line 2: Position() the object is a position, think of it as a standing position.
line 2: xalign=0.1 changes the value of xalign in the position named left to 0.1 (roughly 10% of screen)
Note: xalign is the position on the x (horizontal) axis on the screen, 0.0 is far left and 1.0 is far right.
Line 3: is the same as line 2 for right at 0.9 (90%)
Line 4: is defining a new position I named midleft and it's positioned on 30%
Line 5: is the same thing, midright 70%

Everything else is normal till we hit lines 16 and 17

Tip # 6:

As you can remember, we can't have two images with the same name on the screen at the same time, to show two of the same character I used as
Line 16: is line 13, I just changed the position at midright and showed it as another Afra image as afr2
Line 17: same thing
Note: the name you use after as is important when you want to hide the image, hide afr2 hides the one we added on line 16 and the one on line 13 remains.

Tip #7:

Music and sounds, it's not like music an sound don't deserve a topic, the truth is: using them is so simple they fit in a tip.
I don't know where you can find free music, therefore, I plug my friends work you can use for the purpose of this tutorial, just keep in mind that you'll have to purchase a license for them if you want to include them in your games distribution.
I like to make a folder for sounds and music to keep them tidy at one place.

label start:
    play music "music/Brass-knuckles.mp3"
    "enjoying the music"
    return

Line 2: plays the file named Brass-knuckles.mp3 inside a sound channel named music, this channel will loop to the beginning when the file reaches it's end. to stop music you can use stop music

label start:
    play music "music/Brass-knuckles.mp3"
    "enjoying the music"
    stop music
    "it stopped"
    return

for sound effects we have sound channel, this channel doesn't loop and is perfect for the sounds you want to be played once.

label start:
    play sound "music/boom.mp3"
    "what was that?"
    return

Tip #8:

As you've noticed I always put a piece of dialogue whenever I want the game to pause, however there is another handy way to pause the game:

label start:
    pause
    "that was it"
    return

It will pause there until the player clicks, You can give the pause a time in seconds, if time is provided the game will resume when that time has passed.

label start:
    pause 2
    "that was it"
    return

The code above will pause for two seconds, it's handy when you want your sound effect finish playing before moving to the next dialogue, however, if the player click during a pause, the pause will end, but don't worry there is a way to prevent it.

label start:
    $ renpy.pause(2, hard=true)
    "that was it"
    return

A hard pause will force the player to wait the amount of time specified, it's not a good idea to force the players to wait but sometimes you have to, for example you have a video on the screen and you want the player watch it entirely,

Tip #9:

Yes you can show videos inside your game, like music put your video inside your game folder and use the code below, (don't forget to replace the video address)

label start:
    play movie "vid/video.mp4"
    $ renpy.pause(2, hard=True)
    "that was it"
    return

Tip #10:

Often while playing a video, you might want to hide your chat window, this is how, in case you need to:

label start:
    "something said"
    window hide
    pause
    window show
    "and something else"
    return

notice that the chat window is called window and hide/show is placed after the name and not before it, as long as you keep that in mind you're golden.

Tip #11:

Remember defining a character to speak as? You can have characters in your game without defining them:

label start:
    "Bill" "howdy partner, are you new?"
    "Roy" "you betcha"
    return

it's a handy trick for short encounters and one line stands.

Tip #12:

There is one more way to interact with the players and it's asking them to type something in an input:

label start:
    $ name_input = renpy.input("What's your name?")
    "ah [name_input] huh?"
    return

other than asking the players for their names there's not much call for an input, you can combine it with some if and make an elaborate code entry but keep in mind there's too many wrong answers players can type, and often typing is very frustrating for players, or maybe it's just me who hates writing and reading...




By now you should be able to handle the majority of jobs you might get as a script writer, however, there is always something more to learn, you just need to ask the question "how to?" then search for an answer. As always I'll gladly answer any questions you might have.

The next topic is art, Since I can't draw I can't teach you how to, but I can give you the basic information about how to resize , compress and keep your games art tidy, I'll try to add some basics for animating your characters as well. if you're not familiar with image editing software, you might want to look at my old Learn Photoshop in 10 minutes or less [beginner tutorial] first.

Part 9: Images
Part 10: Animation
Part 11: sound editing and voice acting

Sort:  

Sorry to hear you lost the article you wrote! It's happened to quite a few of us in the past and it really sucks. It quickly taught me to back-up my post before I hit that 'Post' button. So my advice to you: ctrl+a, ctrl+c right before you post, just to be sure you've got it copied in case things don't go well.

I really like your topic on how to enter the game industry. Makes for great resources for people who are thinking about doing this. Keep it up!

Thanks ^_^ I hope to see some good games coming out of steemit community some day.
I always kept a backup during the writing process, I don't know why I didn't do it for this one, I felt regret immediately after pressing the button and as my bad luck was waiting for it... it happened.

Ugh, isn't that always the case! The one time you forget... it happens! Glad you re-wrote most of it :-)

If anything can go wrong, it will go wrong, at the worst possible time, all the time, all at once. "Murphy's law"
It's hunting me ^_^

Coin Marketplace

STEEM 0.19
TRX 0.14
JST 0.030
BTC 60078.84
ETH 3197.52
USDT 1.00
SBD 2.45