Circling camera

If you feel like you're up to the challenge of building your own Ages in Blender or 3ds Max, this is the place for you!

Circling camera

Postby Grogyan » Thu Jan 17, 2008 9:46 pm

Not long ago, there was a discussion here
viewtopic.php?f=36&t=935&p=9572#p9572
And I found that with trawling Alcugs, that you can actually have a circling camera pointing towards the player.
Its in this recent plugin too, to have a circling camera.

Any ideas how to implement this please?
And how to get rid of this error?
Code: Select all
WARNING: Could not decode False to an object type code. Type of object: <type 'bool'>
Error: Decoding error on keystring None and basetype False
Better to have loved and lost than never to have loved at all
User avatar
Grogyan
 
Posts: 1203
Joined: Thu Oct 11, 2007 1:27 am

Re: Circling camera

Postby Trylon » Thu Jan 17, 2008 11:53 pm

Don't worry. If your age exports fine, theno remove. it's not really an error, just a debugging message we fotgot to remove
One day I ran through the cleft for the fiftieth time, and found that uru held no peace for me anymore.
User avatar
Trylon
 
Posts: 1446
Joined: Fri Sep 28, 2007 11:08 pm
Location: Gone from Uru

Re: Circling camera

Postby Grogyan » Fri Jan 18, 2008 4:46 am

I have tried just about everything to get this circling camera, or even a fixed camera, triggered by region.

The method on Alcugs no longer works, any suggestions will be helpful.
Better to have loved and lost than never to have loved at all
User avatar
Grogyan
 
Posts: 1203
Joined: Thu Oct 11, 2007 1:27 am

Re: Circling camera

Postby Nadnerb » Fri Jan 18, 2008 3:12 pm

This is because the new plugin makes many of the methods in the alcugs tutorials useless, and the new tutorials have not been released yet. Do not trust the Alcugs tutorials. (I believe the plugin was released without documentation in order to get it into the hands of people who could use it and speed the tutorial writing process.)

In order to make camera regions work now, they must have an alcscript.
Code: Select all
<camera region name>:
   region:
      type: camera
      camera:
         messages:
           - newcam: <camera object name>
         
<camera object name>:
   camera:
      brain:
         type: <Camera type (fixed, circle, avatar)>
         xpanlimit: 0.8 (amount the user can pan the camera with right mouse button)
         zpanlimit: 0.8 (values range from 0 to 1)
         poa: 0,0,6 (This is the Point on Avatar)
         offset: 0,6,6 (For avatar cameras only, location relative to avatar feet)
         flags:
           - followlocalavatar
           - maintainLOS
         circleflags: (only neccesary for circle cameras)
           - farthest

Place the alcscript in the "AlcScript" blender text file. This can be found by making a text editor window and selecting "AlcScript" from the dropdown.
Image
Live KI: 34914 MOULa KI: 23247 Gehn KI: 11588 Available Ages: TunnelDemo3, BoxAge, Odema
Nadnerb
 
Posts: 1057
Joined: Fri Sep 28, 2007 8:01 pm
Location: US (Eastern Time)

Re: Circling camera

Postby Grogyan » Fri Jan 18, 2008 4:32 pm

Nadnerb wrote:This is because the new plugin makes many of the methods in the alcugs tutorials useless, and the new tutorials have not been released yet. Do not trust the Alcugs tutorials. (I believe the plugin was released without documentation in order to get it into the hands of people who could use it and speed the tutorial writing process.)

In order to make camera regions work now, they must have an alcscript.
Code: Select all
<camera region name>:
   region:
      type: camera
      camera:
         messages:
           - newcam: <camera object name>
         
<camera object name>:
   camera:
      brain:
         type: <Camera type (fixed, circle, avatar)>
         xpanlimit: 0.8 (amount the user can pan the camera with right mouse button)
         zpanlimit: 0.8 (values range from 0 to 1)
         poa: 0,0,6 (This is the Point on Avatar)
         offset: 0,6,6 (For avatar cameras only, location relative to avatar feet)
         flags:
           - followlocalavatar
           - maintainLOS
         circleflags: (only neccesary for circle cameras)
           - farthest

Place the alcscript in the "AlcScript" blender text file. This can be found by making a text editor window and selecting "AlcScript" from the dropdown.


Yeah, I found that out, when I trying to get rid of errors, it just so happens that I was using your TunnelDemo3 as reference, but still couldn't get the camera to work, fixed or circle.
I'll give this new Alc code a run through, thanks much.
Better to have loved and lost than never to have loved at all
User avatar
Grogyan
 
Posts: 1203
Joined: Thu Oct 11, 2007 1:27 am

Re: Circling camera

Postby Grogyan » Fri Jan 18, 2008 7:15 pm

I've had a go, but to refine the Alc code for others so that the Age can compile, the compiler complained about too many colons
Your original example
Code: Select all
<camera region name>:
   region:
      type: camera
      camera:
         messages:
           - newcam: <camera object name>
         
<camera object name>:
   camera:
      brain:
         type: <Camera type (fixed, circle, avatar)>
         xpanlimit: 0.8 (amount the user can pan the camera with right mouse button)
         zpanlimit: 0.8 (values range from 0 to 1)
         poa: 0,0,6 (This is the Point on Avatar)
         offset: 0,6,6 (For avatar cameras only, location relative to avatar feet)
         flags:
           - followlocalavatar
           - maintainLOS
         circleflags: (only neccesary for circle cameras)
           - farthest


And what compiled for me, fixed only - using my Camera names and Region names
Code: Select all
CameraRgn:
   region:
      type: camera
      camera:
         messages
           - newcam OrbitCamera
         
OrbitCamera:
   camera:
      brain:
         type: fixed
         xpanlimit 0.8
         zpanlimit 0.8
         poa 0, 0, 6
         offset 0, 6, 6
         flags:
           - followlocalavatar
           - maintainLOS


Edit1: But in doing so Uru crashes on loading the Age
Edit2: I Forgot to add constraint "Track To" for the Camera to the region, its under the "Object" -> "Objects Buttons" which fixed the crashing, but he camera still does not activate
Better to have loved and lost than never to have loved at all
User avatar
Grogyan
 
Posts: 1203
Joined: Thu Oct 11, 2007 1:27 am

Re: Circling camera

Postby Grogyan » Sat Jan 19, 2008 1:00 am

I got the fixed camera to work.
Not too sure how I fixed it, but I checked my code (for a countless number of times), and found that I had left out a line.

I have got the circle camera coded now, very much the same way except for a flag, but the camera acts like a fixed camera.
Better to have loved and lost than never to have loved at all
User avatar
Grogyan
 
Posts: 1203
Joined: Thu Oct 11, 2007 1:27 am

Re: Circling camera

Postby Grogyan » Sun Jan 20, 2008 1:48 am

Righteo, I got the second camera setup, and it is setup as a circle camera, but when the compiler runs it reverts the camera to fixed. Look closely at the Camera Brain Export, this is what I believe is suppose to show for my second camera as circle, not fixed.
Camera OrbitingCam is the camera that I have setup as circle.

Code: Select all
[Camera OrbitingCam]
 [Coordinate Interface OrbitingCam]
 [LogicHelper]
   No actions in list
None
   Exporting modifiers
   No modifiers
None
Exporting Camera Modifier Object
Calculating FOV for lens is 35 mm
 Camera Brain: fixed
Exporting CameraBrain1
 Decoding MixedRef: None
WARNING: Could not decode False to an object type code. Type of object: <type 'bool'>
Error: Decoding error on keystring None and basetype False
 Decoding MixedRef: None
WARNING: Could not decode False to an object type code. Type of object: <type 'bool'>
Error: Decoding error on keystring None and basetype False
Exporting CameraBrain1_Fixed
 Decoding MixedRef: None

[Region Object CameraRgn]
 Region type: unknown
 [LogicHelper]
  [CameraRegionDetector CameraRgn]
 Decoding MixedRef: OrbitCamera
 [Physical]
  HullBounds export
   Exporting 8 (8) vertices
  Setting Region-Specific settings....
  Object is Dynamic
 [Coordinate Interface CameraRgn]

[Camera OrbitCamera]
 [Coordinate Interface OrbitCamera]
 [LogicHelper]
   No actions in list
None
   Exporting modifiers
   No modifiers
None
Exporting Camera Modifier Object
Calculating FOV for lens is 35 mm
 Camera Brain: fixed
Exporting CameraBrain1
 Decoding MixedRef: None
WARNING: Could not decode False to an object type code. Type of object: <type 'bool'>
Error: Decoding error on keystring None and basetype False
 Decoding MixedRef: None
WARNING: Could not decode False to an object type code. Type of object: <type 'bool'>
Error: Decoding error on keystring None and basetype False
Exporting CameraBrain1_Fixed
 Decoding MixedRef: None


And this is the Alc script that goes with it
Code: Select all
# insert AlcScript code here

# To get cameras to work you need to add
# the following to an Alc script

# <camera region name>:
#   region:
#      type: camera
#         messages:
#            - newcam: <camera object name>

# <camera object name>:
#   camera:
#      brain:   
#         type: <camera type (fixed, circle, avatar)>   
#            xpanlimit: 0.8    (sets the amount of pan the player can do by holding down the right mouse button)
#            zpanlimit: 0.8    (values range from 0 to 1)
#            poa: 0, 0, 6   (point on the avatar the camera points to)
#            offset: 0, 6, 6   (for avatar cameras only,location relative to avatar's feet)
#         flags:
#            - followlocalavatar
#            - maintainLOS
#         circleflags: (only for cameras that circle)         
#            - farthest         
         
CameraRgn:
    region:
        type: camera
      camera:
            messages:
               - newcam: OrbitCamera
                 
OrbitCamera:
   camera:
      brain:
         type:    fixed
               xpanlimit 0.8
               zpanlimit 0.8
               poa 0,0,6   
            #   offset 0,6,6
         flags:
            - followlocalavatar
            - maintainLOS         
            - circleflags
#             circleflags:
            - farthest
   
OrbitCamRgn:
    region:
        type: camera
      camera:
            messages:
               - newcam: OrbitingCam
                 
OrbitingCam:
   camera:
      brain:
         type:    circle
            xpanlimit 0.8
               zpanlimit 0.8
               poa 0,0,6   
               #offset 0,6,6
         flags:
            - followlocalavatar
            - maintainLOS         
            - circleflags
            circleflags:
            - farthest          


And the .blend that goes with it, note that this Age is for experimental use only, and doesn't reflect what will be in the final Age, that isn't even started.
http://grogyan.googlepages.com/G5_1.zip
Better to have loved and lost than never to have loved at all
User avatar
Grogyan
 
Posts: 1203
Joined: Thu Oct 11, 2007 1:27 am

Re: Circling camera

Postby Nadnerb » Sun Jan 20, 2008 11:15 am

Ok, remove the list item circleflags and just use "circleflags:" to start a new block. Make sure "circleflags:" is at the same indentation level as "flags:". You have named both of these cameras as though you wanted to make them circle cameras, but you have set the type "fixed" on the first one. (also, the same error with "circleflags:" again. Also, indentation is messed up with the poa and panlimit lines. Alcscript is very finicky about it's indentation levels.

Try this:

Code: Select all
CameraRgn:
    region:
        type: camera
      camera:
            messages:
               - newcam: OrbitCamera
                 
OrbitCamera:
   camera:
      brain:
         type: circle
            xpanlimit 0.8
            zpanlimit 0.8
            poa 0,0,6   
         flags:
            - followlocalavatar
            - maintainLOS         
         circleflags:
            - farthest
   
OrbitCamRgn:
    region:
        type: camera
      camera:
            messages:
               - newcam: OrbitingCam
                 
OrbitingCam:
   camera:
      brain:
         type: circle
            xpanlimit 0.8
            zpanlimit 0.8
            poa 0,0,6   
         flags:
            - followlocalavatar
            - maintainLOS         
         circleflags:
            - farthest
Image
Live KI: 34914 MOULa KI: 23247 Gehn KI: 11588 Available Ages: TunnelDemo3, BoxAge, Odema
Nadnerb
 
Posts: 1057
Joined: Fri Sep 28, 2007 8:01 pm
Location: US (Eastern Time)

Re: Circling camera

Postby Grogyan » Sun Jan 20, 2008 10:06 pm

Code: Select all
# insert AlcScript code here

# To get cameras to work you need to add
# the following to an Alc script

# <camera region name>:
#   region:
#      type: camera
#         messages:
#            - newcam: <camera object name>

# <camera object name>:
#   camera:
#      brain:   
#         type: <camera type (fixed, circle, avatar)>   
#            xpanlimit: 0.8    (sets the amount of pan the player can do by holding down the right mouse button)
#            zpanlimit: 0.8    (values range from 0 to 1)
#            poa: 0, 0, 6   (point on the avatar the camera points to)
#            offset: 0, 6, 6   (for avatar cameras only,location relative to avatar's feet)
#         flags:
#            - followlocalavatar
#            - maintainLOS
#         circleflags: (only for cameras that circle)         
#            - farthest         
         
CameraRgn:
    region:
        type: camera
      camera:
         messages:
            - newcam: OrbitCamera
                 
OrbitCamera:
   camera:
      brain:
         type:   fixed
               xpanlimit 0.8
               zpanlimit 0.8
               poa 0,0,6   
         flags:
               - followlocalavatar
               - maintainLOS         
 
OrbitCamRgn:
    region:
        type: camera
      camera:
         messages:
            - newcam: OrbitingCam
                 
OrbitingCam:
   camera:
      brain:
         type: circle
            xpanlimit 0.8
            zpanlimit 0.8
            poa 0,0,6   
         flags:
            - followlocalavatar
            - maintainLOS
         circleflags:
            - farthest      
            - circlelocalavatar


Like this?

It still reverts back to "fixed", strange also is that the camera for the ladder in the FuncChk01.blend also does the same thing.
Better to have loved and lost than never to have loved at all
User avatar
Grogyan
 
Posts: 1203
Joined: Thu Oct 11, 2007 1:27 am

Next

Return to Building

Who is online

Users browsing this forum: No registered users and 0 guests