Difference between revisions of "PyPRP:Great Zero Beam"

m (AlcScript for a Great Zero Beam)
m (Before You Start)
 
(26 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{Tutorial|Great Zero Beam|Blender}}
+
{{Tutorial|Great Zero Beam|PyPRP}}
 
[[File:GZinthePub02.jpg]]
 
[[File:GZinthePub02.jpg]]
  
Line 10: Line 10:
 
You will need to determine approximately where the '''Great Zero''' is in relation to your cavern location.  You are going to place a Projection Light (see [[ProjectionLights]]) at this point.  So if your creation is on the cavern wall, you will need to place this light very far away for the proper effect.
 
You will need to determine approximately where the '''Great Zero''' is in relation to your cavern location.  You are going to place a Projection Light (see [[ProjectionLights]]) at this point.  So if your creation is on the cavern wall, you will need to place this light very far away for the proper effect.
  
You will also need the '''"grtzlaserproj"''' texture from either the city files or one of the Guild Pubs. For legal purposes, this texture can't be reposted here, so you must find it yourself or create an equivalent.
+
You will also need the Great Zero beam texture. For convenience, we've extracted the texture from the URU files and provide it here for use under '''Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0)''' [https://creativecommons.org/licenses/by-nc-sa/4.0/].
 +
 
 +
[[file:GZLaser.png]]
  
 
== Blender Work ==
 
== Blender Work ==
Line 18: Line 20:
 
Once you have found the location you'd like to place the "Great Zero", left click on it to set the cursor there.  Make sure the cursor is also slightly below your cavern location on the z-axis so the beam will encompass everything from the bottom floor up.
 
Once you have found the location you'd like to place the "Great Zero", left click on it to set the cursor there.  Make sure the cursor is also slightly below your cavern location on the z-axis so the beam will encompass everything from the bottom floor up.
  
Next, click Add->Lamp->Area.  Name this new area lamp something unique that you will remember ('''F9''', under Links and Materials).  We want this lamp facing the correct way, so press Alt+Spacebar, then click Local to switch to the lamp's local orientation.  We must make sure that the local Z-Axis (blue) is facing horizontally and that the square representing the lamp's area is also facing that way.   
+
Next, click '''Add->Lamp->Area'''.  Name this new area lamp something unique that you will remember ('''F9''', under '''Links and Materials''').  We want this lamp facing the correct way, so press '''Alt+Spacebar''', then click '''Local''' to switch to the lamp's local orientation.  We must make sure that the local Z-Axis (blue) is facing horizontally and that the square representing the lamp's area is also facing that way.   
  
 
Press R, then X, then 90, then Enter to do so if it is facing down.
 
Press R, then X, then 90, then Enter to do so if it is facing down.
 +
 +
=== Adjusting Light Settings ===
 +
 +
We need to adjust a few settings with the lamp.  Click on the lamp button (F5, the light bulb button).  Set your area lamp to the following settings:
 +
 +
[[File:GZBeamTtl06.jpg]]
 +
 +
Note: Gamma is set to 0.001 (its lowest setting).
 +
 +
'''Leave "Size X" (width) as 1'''.  "Size Y" can only go up to 100, so if you need the height of the beam increased further, see the AlcScript below.  "Dist" determines the depth of the beam, ie the distance from the light's source to your location.  The maximum Blender can set it to is 5,000.  If this needs to be more as well, see the AlcScript below.
  
 
=== Setting the Material ===
 
=== Setting the Material ===
  
Much like footprints or ripples in water, we need to add a plane out of sight to set up a new material and texture for the beam itself.  Click Add->Mesh->Plane.  Once it's created and selected, press Tab, then press U, then click "Unwrap".  Hit F5, then click the Material button (red ball).  Add a new material and name it something unique.  '''Make sure to turn Shadbuf OFF'''.  Turn "ZTransp" and "Shadeless" on.  Set Spec to 0 and Amb to 1.
+
Much like footprints or ripples in water, we need to add a plane out of sight to set up a new material and texture for the beam itself.  Click Add->Mesh->Plane.  Once it's created and selected, press Tab, then press U, then click "Unwrap".  Hit F5, then click the Material button (red ball).  Add a new material and name it something unique.  '''Make sure to turn Shadbuf OFF'''.  Put your settings to the following:
  
[[File:GZBeam01.jpg]]
+
[[File:GZBeamTtl05.jpg]]
  
Next, click on the texture button (to the right of the material button) and add a new texture as well, also naming it something unique.  Under "Texture Type", choose "Image".  Make sure '''MipMap''', '''Interpol''' and '''UseAlpha''' are all turned on.  Next, select the "grtzlaserproj" texture you recovered earlier.
+
Next, click on the texture button (to the right of the material button) and add a new texture as well, also naming it something unique.  Under "Texture Type", choose "Image".  Make sure '''MipMap''', '''Interpol''' and '''UseAlpha''' are all turned on.  Select '''Clip''' as well.  Next, select the "grtzlaserproj" texture you recovered earlier.
  
Back in the Materials button, click on the "Map Input" tab and choose "Object".  This should set things for now.
+
Back in the Materials button, click on the "Map Input" tab and choose "Object".  Under the "Map To" tab, switch from "Mix" to "Add".
 +
 
 +
[[File:GZBeamTtl07.jpg]]
  
 
== AlcScript for a Great Zero Beam ==
 
== AlcScript for a Great Zero Beam ==
Line 42: Line 56:
 
             - movable
 
             - movable
 
             - OverAll
 
             - OverAll
        width: 1
+
         height: 2000 # Use this if you need a number greater than 100.
         height: 2000
+
         depth: 5000 # Use this if you need a number greater than 5000.
         depth: 5000
+
  
 
The depth should be a very big number, particularly if your lamp is very far away from your cavern location.  If you're not sure, make the depth very large and keep increasing until you finally see the beam, but '''always''' keep the width at 1.
 
The depth should be a very big number, particularly if your lamp is very far away from your cavern location.  If you're not sure, make the depth very large and keep increasing until you finally see the beam, but '''always''' keep the width at 1.
Line 52: Line 65:
 
== Animating The Light ==
 
== Animating The Light ==
  
Of course, we'll need the beam to rotate properly, and for that, we need to animate it.  If you'll recall, the Great Zero rotates clockwise, so use the following directions to do that.  This version assumes the GZ takes five minutes to rotate, but you can adjust the rotation time to whatever you think works.  (''Remember: 30 Blender frames = 1 second of animation'')
+
Of course, we'll need the beam to rotate properly, and for that, we need to animate it.  If you'll recall, the Great Zero rotates clockwise, so use the following directions to do that.  The GZ takes about two minutes to rotate, so this will set your emitter to rotate once for that amount of time.
  
 
=== Blender Animation ===
 
=== Blender Animation ===
  
For more information on Blender animation basics, be sure to read the [http://en.wikibooks.org/wiki/Blender_3D:_Noob_to_Pro/Basic_Animation Blender 3D: Noob to Pro Wikibook's] section on the subject.  With that in mind, make sure your keyframe is set to 1 to start.  Select your GZ light in the 3D window.  Press I, then click "Rot" to record the light's position for that frame.  Next, press R, then Z, then type -90 to rotate the light 90 degrees clockwise around the global Z axis.  Then set your keyframe from 1 to 2250 (about 1 1/4 minutes).  Press I then click Rot again to set the new rotation for this frame.   
+
For more information on Blender animation basics, be sure to read the [http://en.wikibooks.org/wiki/Blender_3D:_Noob_to_Pro/Basic_Animation Blender 3D: Noob to Pro Wikibook's] section on the subject.  With that in mind, make sure your keyframe is set to 1 to start.  Select your GZ light in the 3D window.  Press I, then click "Rot" to record the light's position for that frame.  Set your keyframe from 1 to 900 (30 seconds).  Next, press R, then Z, then type -90 to rotate the light 90 degrees clockwise around the global Z axis.  Press I then click Rot again to set the new rotation for this frame.   
  
Repeat this process for frames 4500, 6750 and 9000 to make the light do a full rotation in five minutes.
+
Repeat this process for frames 1800, 2700 and 3600 to make the light do a full rotation in two minutes.
  
 
Now, if things are left like this, the animation will stall a bit at the beginning and end.  To fix this, go to the '''IPO Curve Editor''' window.
 
Now, if things are left like this, the animation will stall a bit at the beginning and end.  To fix this, go to the '''IPO Curve Editor''' window.
Line 66: Line 79:
 
You should see three lines with various points for your animation (you may need to use the mouse wheel to zoom out to see them).  If you don't see anything, make sure your IPO Type is set to "Object".  Keep pressing A until all the various points on the curves are selected (they'll be white instead of black).  Next, press T, then 2 for a "Linear" curve to straighten out the ends and have one smooth, continuous rotation.
 
You should see three lines with various points for your animation (you may need to use the mouse wheel to zoom out to see them).  If you don't see anything, make sure your IPO Type is set to "Object".  Keep pressing A until all the various points on the curves are selected (they'll be white instead of black).  Next, press T, then 2 for a "Linear" curve to straighten out the ends and have one smooth, continuous rotation.
  
By default, PyPRP exports animations that play in a loop, so no more is needed here for now.
+
By default, PyPRP exports animations on a loop, so no more is needed here for now.
  
At this point, you may now export your AgeThere's still more to do in '''PrpShop'''.
+
And that should do itYou should now have a working Great Zero beam in your cavern location.
  
== Fixing the Files ==
+
== Adding Coordinates ==
  
At this time, the only way found to make things work properly is to modify the PRP files directly.  If another method is found via Blender and PyPRP, this section may become obsolete.
+
[[File:GZBeamTtl08.jpg]]
  
To get PrpShop, you must visit the [[Tools]] page and download '''PlasmaShop'''.  Once it's installed, start the program and open the .age file of your Age.  Go to the "page" with your light (mainRoom by default) and look for a folder called "Limited Dir Light Info".
+
So we have a nice, shiny beam from the Great Zero, but what about coordinates?  The tricky part with this is that it requires a more precise location of the Great Zero for realism.  If your cavern location is somewhere on '''Ae'gura''', for example, proper placement is crucial.
  
[[File:GZBeamTtl02.jpg]]
+
If you feel up to the task, then setting up a Great Zero point of origin is very simple.
  
Your light should be in this folder.  Right click on it and select "Edit PRC".  In this, you'll find the coding for your light.  Look for "Ambient", "Diffuse", and "Specular".  Modify these entries until they look like the example below:
+
First, select your light from before and press Shift+S and then 4 to move your cursor to the light's center point.   
  
[[File:GZBeamTtl03.jpg]]
+
Next, click on Add->Empty. This will place an empty at the same position as your light source and it will act as your Great Zero's origin. 
  
When that's done, click the "Compile and Save" button on the upper leftNext, go to the "Layer" folder and find the Material-Texture of your Great Zero beam (it will be the same as what was entered in the AlcScript). Right click on it and click "Edit PRC".  This time, we're looking for "Preshade" and "Runtime" as well as "Ambient" and "Specular".  Change all four of those so that they look like this:
+
Name it something uniqueDepending on where your cavern location is elevation-wise, you'll need to adjust its position on the Z axis (press G, then Z).
  
[[File:GZBeamTtl04.jpg]]
+
'''''For reference: in Ae'gura, the GZ origin point is 1,510.613 Blender units up from lake level.'''''
  
Again, click "Compile and Save", then click the save icon near the top to save everything to the AgeBefore it can work in offline URU, you must resum the AgeThis is because offline URU needs a valid SUM file and we'll need to re-sum it for the Age to work properly with the changes we made.  
+
Rotation is also important.  The local Y axis of the empty acts as the "line" of the Great Zero (where the direction coordinate reaches 0)You can use the empty itself to determine its local XYZIn the end, the Z axis should be pointing straight up and the Y axis where the Great Zero's line would be.
  
To do this, open '''Plasmashop''' and open your Age's .sum file in with the other files. Open it and in the next window, click '''Re-sum''', then click on the save icon. Once that's done, close PlasmaShop.
+
'''''Again, for reference: this line runs down the hallway to the Guild Hall (blocked) through the tall rock formation in the courtyard and down the middle section of the Great Stairs in Ae'gura.'''''
  
And that should do it!  You should now have a working Great Zero beam in your cavern location.
+
Once you have your empty properly placed and rotated, you can use AlcScript to set it as the GZ origin.
 +
 
 +
<Empty>:
 +
    calibration: broken/repaired/calibrated
 +
 
 +
Use only one of the three options above.  If you just want to put the empty in for later but don't want it to do anything yet, use '''broken'''.  If you'd like it to show coordinates but are unsure if you've placed your empty properly, use '''repaired''' for incorrect coordinates.  If you're quite sure you've accurately placed the empty, use '''calibrated''' for accurate coordinates.
 +
 
 +
Export once more and you're done!   
 +
 
 +
'''Note that you will have to complete the Great Zero's marker quests for any coordinates to appear at all.'''
 +
 
 +
[http://i232.photobucket.com/albums/ee26/DoobesURU/The%20NEW%20GoMe%20Guild%20Pub/GZPubOn_zps50f6ffed.jpg An example of coordinates in a fan Age]
 +
 
 +
 +
[[Category:PyPRP]]

Latest revision as of 15:44, 1 September 2020

Disambig gray.png

This is a tutorial page.Versions available: PyPRP; 3ds Max; Korman.
 GZinthePub02.jpg

Introduction

This will show you how to add the beam from the Great Zero to your cavern location.

Before You Start

You will need to determine approximately where the Great Zero is in relation to your cavern location. You are going to place a Projection Light (see ProjectionLights) at this point. So if your creation is on the cavern wall, you will need to place this light very far away for the proper effect.

You will also need the Great Zero beam texture. For convenience, we've extracted the texture from the URU files and provide it here for use under Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0) [1].

GZLaser.png

Blender Work

Adding The Light

Once you have found the location you'd like to place the "Great Zero", left click on it to set the cursor there. Make sure the cursor is also slightly below your cavern location on the z-axis so the beam will encompass everything from the bottom floor up.

Next, click Add->Lamp->Area. Name this new area lamp something unique that you will remember (F9, under Links and Materials). We want this lamp facing the correct way, so press Alt+Spacebar, then click Local to switch to the lamp's local orientation. We must make sure that the local Z-Axis (blue) is facing horizontally and that the square representing the lamp's area is also facing that way.

Press R, then X, then 90, then Enter to do so if it is facing down.

Adjusting Light Settings

We need to adjust a few settings with the lamp. Click on the lamp button (F5, the light bulb button). Set your area lamp to the following settings:

GZBeamTtl06.jpg

Note: Gamma is set to 0.001 (its lowest setting).

Leave "Size X" (width) as 1. "Size Y" can only go up to 100, so if you need the height of the beam increased further, see the AlcScript below. "Dist" determines the depth of the beam, ie the distance from the light's source to your location. The maximum Blender can set it to is 5,000. If this needs to be more as well, see the AlcScript below.

Setting the Material

Much like footprints or ripples in water, we need to add a plane out of sight to set up a new material and texture for the beam itself. Click Add->Mesh->Plane. Once it's created and selected, press Tab, then press U, then click "Unwrap". Hit F5, then click the Material button (red ball). Add a new material and name it something unique. Make sure to turn Shadbuf OFF. Put your settings to the following:

GZBeamTtl05.jpg

Next, click on the texture button (to the right of the material button) and add a new texture as well, also naming it something unique. Under "Texture Type", choose "Image". Make sure MipMap, Interpol and UseAlpha are all turned on. Select Clip as well. Next, select the "grtzlaserproj" texture you recovered earlier.

Back in the Materials button, click on the "Map Input" tab and choose "Object". Under the "Map To" tab, switch from "Mix" to "Add".

GZBeamTtl07.jpg

AlcScript for a Great Zero Beam

The code for your lamp object should be as follows:

<lamp object>:
    lamp:
        layer: <Material>-<Texture> # From your plane
        flags:
            - movable
            - OverAll
        height: 2000 # Use this if you need a number greater than 100.
        depth: 5000 # Use this if you need a number greater than 5000.

The depth should be a very big number, particularly if your lamp is very far away from your cavern location. If you're not sure, make the depth very large and keep increasing until you finally see the beam, but always keep the width at 1.

NOTE: The coding to set the light to "on" or "off" by the server with the actual Great Zero is not added to this AlcScript yet.

Animating The Light

Of course, we'll need the beam to rotate properly, and for that, we need to animate it. If you'll recall, the Great Zero rotates clockwise, so use the following directions to do that. The GZ takes about two minutes to rotate, so this will set your emitter to rotate once for that amount of time.

Blender Animation

For more information on Blender animation basics, be sure to read the Blender 3D: Noob to Pro Wikibook's section on the subject. With that in mind, make sure your keyframe is set to 1 to start. Select your GZ light in the 3D window. Press I, then click "Rot" to record the light's position for that frame. Set your keyframe from 1 to 900 (30 seconds). Next, press R, then Z, then type -90 to rotate the light 90 degrees clockwise around the global Z axis. Press I then click Rot again to set the new rotation for this frame.

Repeat this process for frames 1800, 2700 and 3600 to make the light do a full rotation in two minutes.

Now, if things are left like this, the animation will stall a bit at the beginning and end. To fix this, go to the IPO Curve Editor window.

GZBeamTtl01.jpg

You should see three lines with various points for your animation (you may need to use the mouse wheel to zoom out to see them). If you don't see anything, make sure your IPO Type is set to "Object". Keep pressing A until all the various points on the curves are selected (they'll be white instead of black). Next, press T, then 2 for a "Linear" curve to straighten out the ends and have one smooth, continuous rotation.

By default, PyPRP exports animations on a loop, so no more is needed here for now.

And that should do it! You should now have a working Great Zero beam in your cavern location.

Adding Coordinates

GZBeamTtl08.jpg

So we have a nice, shiny beam from the Great Zero, but what about coordinates? The tricky part with this is that it requires a more precise location of the Great Zero for realism. If your cavern location is somewhere on Ae'gura, for example, proper placement is crucial.

If you feel up to the task, then setting up a Great Zero point of origin is very simple.

First, select your light from before and press Shift+S and then 4 to move your cursor to the light's center point.

Next, click on Add->Empty. This will place an empty at the same position as your light source and it will act as your Great Zero's origin.

Name it something unique. Depending on where your cavern location is elevation-wise, you'll need to adjust its position on the Z axis (press G, then Z).

For reference: in Ae'gura, the GZ origin point is 1,510.613 Blender units up from lake level.

Rotation is also important. The local Y axis of the empty acts as the "line" of the Great Zero (where the direction coordinate reaches 0). You can use the empty itself to determine its local XYZ. In the end, the Z axis should be pointing straight up and the Y axis where the Great Zero's line would be.

Again, for reference: this line runs down the hallway to the Guild Hall (blocked) through the tall rock formation in the courtyard and down the middle section of the Great Stairs in Ae'gura.

Once you have your empty properly placed and rotated, you can use AlcScript to set it as the GZ origin.

<Empty>:
    calibration: broken/repaired/calibrated

Use only one of the three options above. If you just want to put the empty in for later but don't want it to do anything yet, use broken. If you'd like it to show coordinates but are unsure if you've placed your empty properly, use repaired for incorrect coordinates. If you're quite sure you've accurately placed the empty, use calibrated for accurate coordinates.

Export once more and you're done!

Note that you will have to complete the Great Zero's marker quests for any coordinates to appear at all.

An example of coordinates in a fan Age