Typing in Java on Renpy?
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
-
- Newbie
- Posts: 11
- Joined: Sat Feb 25, 2017 2:57 pm
- Projects: Deus Ex: Love Augmented
- Tumblr: askfrankpritchard
- Contact:
Typing in Java on Renpy?
I'm not too familiar with writing in Python and I have some effects that I would like to use in the game, but I only know how to write them in Java. Would it be possible to change the writing language in the script/gui/etc to Java or would I just have to learn Python?
For ex: changing password manually if the user had forgotten it.
Password b= new Password();
String b = ID 10 T;
I really just want to use setters/getters and instances to do this.
For ex: changing password manually if the user had forgotten it.
Password b= new Password();
String b = ID 10 T;
I really just want to use setters/getters and instances to do this.
- SuperbowserX
- Veteran
- Posts: 270
- Joined: Sat Jan 07, 2017 3:09 pm
- Contact:
Re: Typing in Java on Renpy?
Can you be more specific on what you want to do? Unless you're doing a *really* complex operation I can't see why you would need to implement Java.
Changing passwoord? For what? Like an in-game password that the user has to figure out as part of the puzzle? Or for a save game? Or a password to start the game? You can easily do that by just making a label that takes in arguments in Ren'py (which is the equivalent of a Renpy function).
I think you should tell us what you are trying to implement, and we'll see if we can think of python/renpy code that can implement it.
Changing passwoord? For what? Like an in-game password that the user has to figure out as part of the puzzle? Or for a save game? Or a password to start the game? You can easily do that by just making a label that takes in arguments in Ren'py (which is the equivalent of a Renpy function).
I think you should tell us what you are trying to implement, and we'll see if we can think of python/renpy code that can implement it.
-
- Newbie
- Posts: 11
- Joined: Sat Feb 25, 2017 2:57 pm
- Projects: Deus Ex: Love Augmented
- Tumblr: askfrankpritchard
- Contact:
Re: Typing in Java on Renpy?
I would just type it in Python/RenPy but I can't type in that coding language fluently.
I added two screenshots of part of the script where the code would be needed.
In the beginning of the game the player is able to type in their own password.
Later in the game, if they had forgotten it and can't type it in, then there would be a code that would change the password manually to ID-10-T.
I would use one class of setters and getters to declare an instance for the password.
Then in the other class I could declare the new password.
But this isn't the only thing i would use Java for, there's a lot more, but that's just one example. It would make my coding SO much easier if i could type it in Java.
I added two screenshots of part of the script where the code would be needed.
In the beginning of the game the player is able to type in their own password.
Later in the game, if they had forgotten it and can't type it in, then there would be a code that would change the password manually to ID-10-T.
I would use one class of setters and getters to declare an instance for the password.
Then in the other class I could declare the new password.
But this isn't the only thing i would use Java for, there's a lot more, but that's just one example. It would make my coding SO much easier if i could type it in Java.
- SuperbowserX
- Veteran
- Posts: 270
- Joined: Sat Jan 07, 2017 3:09 pm
- Contact:
Re: Typing in Java on Renpy?
Well you'll need to learn Ren'py language. It's very very simple; read the documentation, i..e the quickstart.
What are the common functions you would need to use in Java? I can provide their Ren'py equivalents.
I'd rather use the easy say statement than use the System.out.println() thing.
At the first password entry, just use something to the effect of:
And later, something to the effect of:
EDIT: Forgot to double check the image when I saw your code example. So this example probably isn't what you are looking for. But the basic rules of say statements, variable definitions, and user inputs are still demonstrated.
Please, don't be afraid to learn the Ren'py language If you have any questions, please post them in this thread and we'd be glad to help. Also, I know quite a bit of Java, and I'm 99% sure that it'd be far easier to use the Ren'py language.
What are the common functions you would need to use in Java? I can provide their Ren'py equivalents.
I'd rather use the easy say statement than use the System.out.println() thing.
At the first password entry, just use something to the effect of:
Code: Select all
"Enter the password you desire."
$ pass = renpy.input()
Code: Select all
"What was the password you previously entered?"
$ attempt = renpy.input()
if attempt != pass:
"This is the wrong password. It is being changed to ID-10-T."
$ pass = "ID-10-T"
else:
"That is the right password!"
Please, don't be afraid to learn the Ren'py language If you have any questions, please post them in this thread and we'd be glad to help. Also, I know quite a bit of Java, and I'm 99% sure that it'd be far easier to use the Ren'py language.
-
- Newbie
- Posts: 11
- Joined: Sat Feb 25, 2017 2:57 pm
- Projects: Deus Ex: Love Augmented
- Tumblr: askfrankpritchard
- Contact:
Re: Typing in Java on Renpy?
I have read the documentation but nothing sticks :/ and im just more well versed in Java, it would make the process go by faster.
It will be really nice if you can provide the equivalents! But the game script is still being developed so I don't have the full list. So my questions about this will probably be well sparsed all the way into this summer.
I have found some code for other things that I needed for the game, but i really had to dig through some archives.
//I really dont mind typing System.out.println(); all the time.
I guess what I'm trying to say is that I'm more comfortable with Java than the RenPy language and i know what I'm doing with Java.
It will be really nice if you can provide the equivalents! But the game script is still being developed so I don't have the full list. So my questions about this will probably be well sparsed all the way into this summer.
I have found some code for other things that I needed for the game, but i really had to dig through some archives.
//I really dont mind typing System.out.println(); all the time.
I guess what I'm trying to say is that I'm more comfortable with Java than the RenPy language and i know what I'm doing with Java.
- SuperbowserX
- Veteran
- Posts: 270
- Joined: Sat Jan 07, 2017 3:09 pm
- Contact:
Re: Typing in Java on Renpy?
The equivalent of System.out.println() is the say statement. Just do this:
And if you want a character to say something, just say:
Where emi is a defined character.
To define a variable, just do:
or
You don't need to specify variable name in Python or Ren'py. No initialization needed (but still an error if undefined variable is used).
No semicolons needed. Ren'py/Python runs on indentation, which is handled automatically with mostly all text editors.
if statements are largely the same. Except that for conditionals, instead of using "&&", "||" and "!", you instead use "and", "or" and "not" respectively.
I know it can be daunting/frustrating to learn a programming language, but you gotta try. It's part of the experience.
Code: Select all
"Hello."
Code: Select all
emi "Hello."
To define a variable, just do:
Code: Select all
$ money = 100
Code: Select all
$ name = "John"
No semicolons needed. Ren'py/Python runs on indentation, which is handled automatically with mostly all text editors.
if statements are largely the same. Except that for conditionals, instead of using "&&", "||" and "!", you instead use "and", "or" and "not" respectively.
I know it can be daunting/frustrating to learn a programming language, but you gotta try. It's part of the experience.
-
- Newbie
- Posts: 11
- Joined: Sat Feb 25, 2017 2:57 pm
- Projects: Deus Ex: Love Augmented
- Tumblr: askfrankpritchard
- Contact:
Re: Typing in Java on Renpy?
So it just knows what kind of variable needed?
So an
int something =42
Would just be
$ something=42 and it knows that's an int. Etc for other variables...
So an
int something =42
Would just be
$ something=42 and it knows that's an int. Etc for other variables...
- SuperbowserX
- Veteran
- Posts: 270
- Joined: Sat Jan 07, 2017 3:09 pm
- Contact:
Re: Typing in Java on Renpy?
It's not quite that it knows what kind of variable it is -- more that if you use the variable later for an appropriate purpose, it will work.
$ something = 42 may be an integer; or it may be a double or some other numeric data type. But when you run code that uses the variable it won't actually matter.
It depends on what you want to do with it. If you want it to be a string (so that you can append it or check if a substring exists within it) then you just define it with quotes.
If you are printing the variable, then it's even easier than Java or python.
$ something = 42 may be an integer; or it may be a double or some other numeric data type. But when you run code that uses the variable it won't actually matter.
It depends on what you want to do with it. If you want it to be a string (so that you can append it or check if a substring exists within it) then you just define it with quotes.
If you are printing the variable, then it's even easier than Java or python.
Code: Select all
$ something = 400
"The value of the something variable is [something]."
- trooper6
- Lemma-Class Veteran
- Posts: 3712
- Joined: Sat Jul 09, 2011 10:33 pm
- Projects: A Close Shave
- Location: Medford, MA
- Contact:
Re: Typing in Java on Renpy?
I started as a Java programmer. Ren'Py is based in Python and you can't just write in Java. The Ren'Py language gives you a lot, more complex things you'd need to write in Python. Python is. It difficult to transition over to from Java. I recommend taking the Basic Python course over at codeacademy.com -- it is free.
Python is different from Java...you don't use getters and setters for the most part...you just directly access the variables you want. Also, Python let's you have methods not tied to a class. There is a lot of good stuff in there. I really recommend the following:
1) Read through Ren'Py documentation--especially the QuickStart
2) Look at the code in the Ren'Py Tutorial game to see how things look in practice
3) Download a few games that haven't archived their code...and check out their code to see code in practice.
4) Do the Python course from codeacademy.com
5) Do small exercise projects to test little hinge before you make your magnum opus. Like do something that involves screen language, do something with menus, try a basic inventory thing.
Python is different from Java...you don't use getters and setters for the most part...you just directly access the variables you want. Also, Python let's you have methods not tied to a class. There is a lot of good stuff in there. I really recommend the following:
1) Read through Ren'Py documentation--especially the QuickStart
2) Look at the code in the Ren'Py Tutorial game to see how things look in practice
3) Download a few games that haven't archived their code...and check out their code to see code in practice.
4) Do the Python course from codeacademy.com
5) Do small exercise projects to test little hinge before you make your magnum opus. Like do something that involves screen language, do something with menus, try a basic inventory thing.
A Close Shave:
*Last Thing Done (Aug 17): Finished coding emotions and camera for 4/10 main labels.
*Currently Doing: Coding of emotions and camera for the labels--On 5/10
*First Next thing to do: Code in all CG and special animation stuff
*Next Next thing to do: Set up film animation
*Other Thing to Do: Do SFX and Score (maybe think about eye blinks?) Check out My Clock Cookbook Recipe: http://lemmasoft.renai.us/forums/viewto ... 51&t=21978
*Last Thing Done (Aug 17): Finished coding emotions and camera for 4/10 main labels.
*Currently Doing: Coding of emotions and camera for the labels--On 5/10
*First Next thing to do: Code in all CG and special animation stuff
*Next Next thing to do: Set up film animation
*Other Thing to Do: Do SFX and Score (maybe think about eye blinks?) Check out My Clock Cookbook Recipe: http://lemmasoft.renai.us/forums/viewto ... 51&t=21978
-
- Newbie
- Posts: 11
- Joined: Sat Feb 25, 2017 2:57 pm
- Projects: Deus Ex: Love Augmented
- Tumblr: askfrankpritchard
- Contact:
Re: Typing in Java on Renpy?
Like I said before I've already read /all/ of the documentation, I just have a hard time remebering things. That and I've already made a vertical slice for my current game. I don't need tutorials for Renpy, I just wanted to know if it was possible to switch to Java. That's already been answered as a no.
- SuperbowserX
- Veteran
- Posts: 270
- Joined: Sat Jan 07, 2017 3:09 pm
- Contact:
Re: Typing in Java on Renpy?
Yeah unfortunately the answer is no. Good luck trying to get the hang of the language.
-
- Newbie
- Posts: 11
- Joined: Sat Feb 25, 2017 2:57 pm
- Projects: Deus Ex: Love Augmented
- Tumblr: askfrankpritchard
- Contact:
Re: Typing in Java on Renpy?
Thanks for your help
Re: Typing in Java on Renpy?
Python has classes, getters and setters, so you can use the Java idioms if you really want to. But ultimately it's a very different language and you're going to have to learn at least some of it, and also Ren'py which is three more languages (Statement, Screen, and ATL).Nucl3arSnake wrote: ↑Sat Apr 01, 2017 3:34 pm I really just want to use setters/getters and instances to do this.
If reading the docs doesn't stick, just throw yourself into it and look up every line until you start remembering. I'd also recommend getting to know the Console -- with an interpreted language you can learn a lot by trying syntax and seeing immediately what happens.
colin r
➔ if you're an artist and need a bit of help coding your game, feel free to send me a PM
➔ if you're an artist and need a bit of help coding your game, feel free to send me a PM
Who is online
Users browsing this forum: No registered users