Page 3 of 7

Re: 3D camera motion, Action Editor, Transform and Image Vie

Posted: Wed Jul 27, 2016 1:17 pm
by Mooneon
Also how do you register images into layers?

Re: 3D camera motion, Action Editor, Transform and Image Vie

Posted: Wed Jul 27, 2016 1:31 pm
by trooper6
Mooneon wrote:Also how do you register images into layers?
I don't understand the question.

If you want to show an image on a certain layer then you just type in the code:

Code: Select all

show cutieface onlayer middle
Is that what you are asking?

Re: 3D camera motion, Action Editor, Transform and Image Vie

Posted: Wed Jul 27, 2016 1:38 pm
by Mooneon
No no. How do you regist 3D layers?
Screen shot 2016-07-27 at 10.31.48 AM.png
I'm sorry, I am completely lost right now. Anyways it says there to Regist 3D layers. I don't know how to do that...

Re: 3D camera motion, Action Editor, Transform and Image Vie

Posted: Wed Jul 27, 2016 2:00 pm
by trooper6
Have you read the README.md document that comes with the camera? All the information is in there, for example this section shows you how to register 3D layers:
Camera
================

With some limitations, Ren'Py can simulate 3D camera motion. This will easily
let you achieve a parallax effect by placing sprites and assets on a 3D field.
This script applies transforms to each layers which are registered as 3D layer by
positions of a camera and 3D layers on a 3D field to simulate 3D camera motion.

If you use this feature, in the first, set additional layers to be registered
as 3D layer. If anything isn't registered as 3D layers, this script register
"master" layer as 3D layers.

For example, Write a code like below in options.rpy and add 'background', 'middle', 'forward' layers.::

config.layers = ['master', 'background', 'middle', 'forward', 'transient', 'screens', 'overlay']

Second, register layers which participate to a 3D motion as 3d layers by
:func:`register_3d_layer`. The z coordinates of these layers can be moved and
applied transforms to by positions of the camera and 3D layers. If anything
isn't registered as 3D layers, this script registers 'master' layer as 3D
layer.::

init python:
register_3d_layer('background', 'middle', 'forward')

Then, a camera and layers can move. ::

label start:
# reset the camera and layers positions and allow layers position to be saved.
$ camera_reset()
# It takes 0 second to move layers
$ layer_move("background", 2000)
$ layer_move("middle", 1500)
$ layer_move("forward", 1000)
scene bg onlayer background
show A onlayer middle
show B onlayer forward
with dissolve
'It takes 1 second to move a camera to (1800, 0, 0)'
$ camera_move(1800, 0, 0, 0, 1)
'It takes 5 seconds to move a camera to (0, 0, 1600)'
$ camera_move(0, 0, 1600, 0, 5)
'A camera moves to (0, 0, 0) at the moment'
$ camera_move(0, 0, 0)
'It takes 1 second to rotate a camera to 180 degrees'
$ camera_move(0, 0, 0, 180, 1)
'It takes 1 second to rotate a camera to -180 degrees and 0.5 second to move a camera to (-1800, 0, 500)'
$ camera_moves( ( (0, 0, 0, 0, 1, 'linear'), (-1800, 0, 500, 0, 1.5, 'linear') ) )
'a camera shuttles between (-1800, 0, 500) and (0, 0, 0)'
$ camera_moves( ( (0, 0, 0, 0, .5, 'linear'), (-1800, 0, 500, 0, 1, 'linear') ), loop=True)

Re: 3D camera motion, Action Editor, Transform and Image Vie

Posted: Wed Jul 27, 2016 2:09 pm
by Mooneon
I have read it yet I seriously cannot understand it. It's not simple.

Re: 3D camera motion, Action Editor, Transform and Image Vie

Posted: Wed Jul 27, 2016 2:17 pm
by Varrok

Code: Select all

init -1 python:
    config.layers = [ 'master', 'l1', 'l2', 'l3', 'transient', 'screens', 'overlay']

init python:
    register_td_layer( ('master', 1000), ('l1', 300), ('l2', 800), ('l3', 900))
^ Example

First you declare them, then you assign them the Z axis value

Re: 3D camera motion, Action Editor, Transform and Image Vie

Posted: Wed Jul 27, 2016 3:26 pm
by Mooneon
What does this mean?

Code: Select all

I'm sorry, but an uncaught exception occurred.

While running game code:
  File "game/script.rpy", line 82, in script
    centered "When I was a child. I didn't have anyone. No family. I was just an lonely orphan."
  File "game/camera/camera.rpy", line 1480, in action_editor
  File "game/camera/camera.rpy", line 398, in execute
  File "game/camera/camera.rpy", line 398, in execute
  File "game/camera/camera.rpy", line 433, in execute
  File "game/camera/camera.rpy", line 437, in execute
  File "game/camera/camera.rpy", line 473, in execute
  File "game/camera/camera.rpy", line 526, in execute
  File "game/camera/camera.rpy", line 529, in execute
  File "game/camera/camera.rpy", line 530, in execute
  File "game/camera/camera.rpy", line 532, in execute
  File "game/camera/camera.rpy", line 532, in keywords
TypeError: cannot concatenate 'str' and 'tuple' objects

-- Full Traceback ------------------------------------------------------------

Full traceback:
  File "game/script.rpy", line 82, in script
    centered "When I was a child. I didn't have anyone. No family. I was just an lonely orphan."
  File "/Users/Maddie/Desktop/renpy-6.99.10-sdk/renpy/ast.py", line 604, in execute
    renpy.exports.say(who, what, interact=self.interact)
  File "/Users/Maddie/Desktop/renpy-6.99.10-sdk/renpy/exports.py", line 1122, in say
    who(what, interact=interact)
  File "/Users/Maddie/Desktop/renpy-6.99.10-sdk/renpy/character.py", line 841, in __call__
    self.do_display(who, what, cb_args=self.cb_args, **display_args)
  File "/Users/Maddie/Desktop/renpy-6.99.10-sdk/renpy/character.py", line 690, in do_display
    **display_args)
  File "/Users/Maddie/Desktop/renpy-6.99.10-sdk/renpy/character.py", line 493, in display_say
    rv = renpy.ui.interact(mouse='say', type=type, roll_forward=roll_forward)
  File "/Users/Maddie/Desktop/renpy-6.99.10-sdk/renpy/ui.py", line 277, in interact
    rv = renpy.game.interface.interact(roll_forward=roll_forward, **kwargs)
  File "/Users/Maddie/Desktop/renpy-6.99.10-sdk/renpy/display/core.py", line 2425, in interact
    repeat, rv = self.interact_core(preloads=preloads, **kwargs)
  File "/Users/Maddie/Desktop/renpy-6.99.10-sdk/renpy/display/core.py", line 3101, in interact_core
    rv = root_widget.event(ev, x, y, 0)
  File "/Users/Maddie/Desktop/renpy-6.99.10-sdk/renpy/display/layout.py", line 905, in event
    rv = i.event(ev, x - xo, y - yo, cst)
  File "/Users/Maddie/Desktop/renpy-6.99.10-sdk/renpy/display/behavior.py", line 410, in event
    rv = run(action)
  File "/Users/Maddie/Desktop/renpy-6.99.10-sdk/renpy/display/behavior.py", line 302, in run
    return action(*args, **kwargs)
  File "game/camera/camera.rpy", line 1480, in action_editor
  File "/Users/Maddie/Desktop/renpy-6.99.10-sdk/renpy/game.py", line 265, in invoke_in_new_context
    return callable(*args, **kwargs)
  File "/Users/Maddie/Desktop/renpy-6.99.10-sdk/renpy/exports.py", line 2475, in call_screen
    rv = renpy.ui.interact(mouse="screen", type="screen", roll_forward=roll_forward)
  File "/Users/Maddie/Desktop/renpy-6.99.10-sdk/renpy/ui.py", line 277, in interact
    rv = renpy.game.interface.interact(roll_forward=roll_forward, **kwargs)
  File "/Users/Maddie/Desktop/renpy-6.99.10-sdk/renpy/display/core.py", line 2437, in interact
    scene_lists.replace_transient()
  File "/Users/Maddie/Desktop/renpy-6.99.10-sdk/renpy/display/core.py", line 727, in replace_transient
    self.remove(layer, tag)
  File "/Users/Maddie/Desktop/renpy-6.99.10-sdk/renpy/display/core.py", line 1014, in remove
    self.hide_or_replace(layer, remove_index, "hide")
  File "/Users/Maddie/Desktop/renpy-6.99.10-sdk/renpy/display/core.py", line 938, in hide_or_replace
    d = oldsle.displayable._hide(now - st, now - at, prefix)
  File "/Users/Maddie/Desktop/renpy-6.99.10-sdk/renpy/display/screen.py", line 430, in _hide
    self.update()
  File "/Users/Maddie/Desktop/renpy-6.99.10-sdk/renpy/display/screen.py", line 565, in update
    self.screen.function(**self.scope)
  File "game/camera/camera.rpy", line 398, in execute
  File "game/camera/camera.rpy", line 398, in execute
  File "game/camera/camera.rpy", line 433, in execute
  File "game/camera/camera.rpy", line 437, in execute
  File "game/camera/camera.rpy", line 473, in execute
  File "game/camera/camera.rpy", line 526, in execute
  File "game/camera/camera.rpy", line 529, in execute
  File "game/camera/camera.rpy", line 530, in execute
  File "game/camera/camera.rpy", line 532, in execute
  File "game/camera/camera.rpy", line 532, in keywords
  File "<screen language>", line 532, in <module>
TypeError: cannot concatenate 'str' and 'tuple' objects

Darwin-10.8.0-i386-64bit
Ren'Py 6.99.10.1227
Death's Sweet Embrace 0.1

Re: 3D camera motion, Action Editor, Transform and Image Vie

Posted: Wed Jul 27, 2016 4:13 pm
by trooper6
Varrok wrote:

Code: Select all

init -1 python:
    config.layers = [ 'master', 'l1', 'l2', 'l3', 'transient', 'screens', 'overlay']

init python:
    register_td_layer( ('master', 1000), ('l1', 300), ('l2', 800), ('l3', 900))
^ Example

First you declare them, then you assign them the Z axis value
Varrok, the documentation doesn't say you can supply tuples for the register_td_layer function. That might be causing the errors.

Mooneon, let me requote the documentation and then try to state it in different words:
For example, Write a code like below in options.rpy and add 'background', 'middle', 'forward' layers.::

config.layers = ['master', 'background', 'middle', 'forward', 'transient', 'screens', 'overlay']

Second, register layers which participate to a 3D motion as 3d layers by
:func:`register_3d_layer`.

init python:
register_3d_layer('background', 'middle', 'forward')
Okay, so, in your options.rpy file, add the line:
config.layers = ['master', 'background', 'middle', 'forward', 'transient', 'screens', 'overlay']


For example, in my game the beginning of my options.rpy file looks like this:

Code: Select all

init -1 python hide:

    ## These control the width and height of the screen.
    config.screen_width = 1366
    config.screen_height = 768

    ## This controls the title of the window, when Ren'Py is
    ## running in a window.
    config.window_title = u"CloseShaveLayerTest"

    # These control the name and version of the game, that are reported
    # with tracebacks and other debugging logs.
    config.name = "CloseShaveLayerTest"
    config.version = "0.0"
    
    #This is my added code for the layers 
    config.layers = ['master', 'bottom', 'middle', 'front', 'clipper', 'transient', 'screens', 'overlay']
Next, you have to register the layers you want to participate in 3D motion, by adding:
init python:
register_3d_layer('background', 'middle', 'forward')
For example, in my script.rpy file, I have:

Code: Select all

init -1 python:
    register_3d_layer('bottom', 'middle', 'front')

label start:
   "Blah blah blah"
Try typing in exactly that code, the code in the README doc.

If you get an error, you should look to see about what line the error comes from and then post the code around that line, within the code tags, so we can see what is going on.

Re: 3D camera motion, Action Editor, Transform and Image Vie

Posted: Wed Jul 27, 2016 4:44 pm
by Varrok
I don't really know about the tuples, but the way I posted works on my PC.

Re: 3D camera motion, Action Editor, Transform and Image Vie

Posted: Mon Aug 01, 2016 6:48 am
by akakyouryuu
Improved Document. Thanks, kevinturner

Re: 3D camera motion, Action Editor, Transform and Image Vie

Posted: Mon Aug 01, 2016 8:31 am
by Morhighan
akakyouryuu, I just want to express my gratitude to you. Without the 3D camera my project would be much harder for me to program!

Here's an example of me using the camera:
https://www.youtube.com/watch?v=A4YloMCvdA8
I use the 3D camera here to make the light jostling of the train with the "wiggle" code you made before.

Thank you so much!

Re: 3D camera motion, Action Editor, Transform and Image Vie

Posted: Thu Aug 18, 2016 10:46 pm
by GreyWolfXx
I am also having the tuple error. I did everything you said, trooper6, and nothing seems to be working.

Re: 3D camera motion, Action Editor, Transform and Image Vie

Posted: Thu Aug 18, 2016 11:22 pm
by trooper6
What does your code look like?

Re: 3D camera motion, Action Editor, Transform and Image Vie

Posted: Fri Aug 19, 2016 11:32 am
by GreyWolfXx
Deleted

Re: 3D camera motion, Action Editor, Transform and Image Vie

Posted: Fri Aug 19, 2016 1:36 pm
by trooper6
That isn't your code, that is your traceback error. What does your code look like? The code where your configure your layers and register your 3D layers. The code where you actually use the camera.