Jump to content

DOWNLOAD MODS

Are you looking for something shiny for your load order? We have many exclusive mods and resources you won't find anywhere else. Start your search now...

LEARN MODDING

Ready to try your hand at making your own mod creations? Visit the Enclave, the original ES/FO modding school, and learn the tricks of the trade from veteran modders...

JOIN THE ALLIANCE

Membership is free and registering unlocks image galleries, project hosting, live chat, unlimited downloads, & more...

Class #4 - Clockworks


WillieSea
 Share

Recommended Posts

Clockworks!

 

*work in progress*

 

This lesson will show you how to make your own clocks for your mods.

 

1. First, you will need to re-create a clock face and the two clock hands in your own mod. Create the 'clock face' as a new >Activator object. Create the clock hands as a new >Static object.

 

2. Place your clock face in the location you want your clock to be located. Take note, each clock you place will require a new >Activator clock face object. The reason is that your clock face will contain the script for this clock.

 

:smarty: Smarty Says: Its usually best to keep your rotation angles on your clock face at 0, 90, 180 or 270. With any other angle you may have trouble getting the clock hands to track correctly across the clock face.

 

3. Place an Hour and Minute hand next to your clock face. Adjust the X and Y angle on the clock hands until they point to 12 o'clock. Keep the Z angle at zero at all times. This is VERY important.

 

:smarty: Smarty Says: Depending on the facing of your clock, the X and Y angle will vary. Below are some example Rotation values to use, depending on which way your clock is facing.

 

NORTH

X = 270

Y = 180

Z = 0

EAST

X = 270

Y = 270

Z = 0

SOUTH

X = 270

Y = 0

Z = 0

WEST

X = 270

Y = 90

Z = 0

 

gallery_85_19_171427.jpg

 

Take special note: When you advance the Z angle to 90, it should be pointing diretctly at 3 o'clock. If its not, then you need to adjust your X and Y rotation angles until it does. A Z angle of 0 should point to 12 o'clock.

 

4. Once you have the clock hand adjusted correctly, the following script can be used to control the clock hands to give you perfect in-game time.

 



scn Clockworks1NorthScript

float mhand

float hhand


begin gamemode

	set mhand to GetCurrentTime * 360

	set hhand to GetCurrentTime * 30

	ClockWorks1NorthMinREF.SetAngle Z mhand

	ClockWorks1NorthHourREF.SetAngle Z hhand

end

 

:smarty: Smarty Says: The only thing you will need to change on this script are the two reference names:

ClockWorks1NorthMinREF

ClockWorks1NorthHourREF

These two reference names will point to the clocks hour hand and minute hand that you placed.

 

IMPORTANT: In order for the clock hands to actually move, you must take this script and attach it to the clock face you placed in step 1 above.

 

5. Its now time to test your mod and ensure the time on your clock is correct.

Link to comment
Share on other sites

Willie,

If you find the normal vector from the minute and hour hands, the clock should work at any angle,right?(i.e. if a clock tower fell over and it was placed at a 45 or any angle) Is this possible with just vanilla scripting so the time would still be accurate(i.e the clock did not break completely after falling)

Or if the z rotation is something other than 0.

(i.e. Or If I wanted a pocket watch laying on a table.)

http://mathworld.wolfram.com/NormalVector.html


f(x,y,z)=ax+by+cz+d=0 

Metallicow

Link to comment
Share on other sites

@Metallicow - Remember, you are adjusting the Z rotaion only in the script example above to make the clock show the correct time. You can put the clock at any angle that gives a clean 'track' around the clock face using only one of the rotaions. (X, Y or Z)

Strange angles will not allow you to adjust just one of the rotation angles to form a complete circle on a 'flat' clock face.

RULE OF THUMB and LEARNING POINT:

If you can adjust one of the rotation angles in the CS and it spins correctly across your clock face, then you have an angle that will work in the script to give you the proper time. Just make sure which ever rotation angle you use starts at 12 o'clock with a 0 angle.

Link to comment
Share on other sites

I got some different positions to work, Thanks Willie :)

The (looking/facing at it) East that worked for me was:

X= 270

Y= -270

Z= 0

Some of the values may or may not need the minus in front of them to make the time right. Otherwise it's a half hour or 6 hours off. You may want to note this in the opening post.

I also noticed two of the three clock faces on the Leyawiin Clock Tower(BBC version) of CoC did not have the accurate time.

Is your clockshop mod about done? Need some help with some textures or modeling?

I also want to ask you a few other things when I get my custom resources done...

I have something special planned for you to show my appreciation for all you have done for the modding community.

Anywho, here's a teaser pic of the WIPz. The face looks awesome in game with the different lighting conditions. :D

http://i861.photobucket.com/albums/ab180/metallicow/Thetimehascome.png

http://i861.photobucket.com/albums/ab180/metallicow/ClockCloseup.png

Thanks again Willie, keep on teachin'

Mooo

Link to comment
Share on other sites

FYI : -270 is the same as 90. This is the same as my West facing clock (where the clock is on the East wall)

If your clock hand is off by 180 degrees (60 min, 6 hours) then you do not have your angles set up correctly. You clock hand should have a Z angle of 0 and be pointing straight up. Upon advancing the Z angle to 90, it should point at 3 o'clock. If not, then your X or Y angle need to be flipped.

Not sure what BBC is, but there was a better cities mod that moved the clock tower from its original location because they made it a swamp. They probably did not set up the clock time correctly on the tower when they moved it.

The clock shop is being worked on by Dark Rider and the members of this forum for playtesting. There is a thread on this forum that has more info on this as well as the beta download.

The clock shop features many new clock hands that can be used by your clock making fun.

Nice picture of a clock you have there. I don't think I ever saw the Mages Tower looking quite like that! :D I had stuffed the clock in the walkway in front of the tower.

Link to comment
Share on other sites

  • 4 weeks later...

Strange angles will not allow you to adjust just one of the rotation angles to form a complete circle on a 'flat' clock face.

Well....Sort of.

Of course, I was stubborn and it took gallons and gallons of mead to figure out.

Things seemed to be spinning backward when I finally awoke...

After the inebriation effect wore off, and I came to my senses, I reached for the last brew I had tied away alongside the canoe in the chilly stream.

*Gulp* *Gulp* *ack* *choke*

What the...???

Dragon's Lager?

And that's when it spit me right in the face. Nearly drowned I did, fallin' into da drink.

Things were never quite the same from that day forward, but I recall some of it and have wrote it down on the log.

There IS a method to the madness! :lmao::DXD

Clocks CAN be positioned at any angle and display the accurate time with a little work!

ClockworksGameStudios001.png

***UPNORTHEAST45*** ROT215

X = 30

Y = 330

Z = 0

And might I ask the great Guru of Time 3 riddles?

1. Does the hands of time have to be static and are such persistent references necessary?

2. Can this wisdom be scribed in the form of a mod/resource?

3. Is a hologram clock possible without flicker?

I await your answers.

Tick Tock

Link to comment
Share on other sites

45 degrees is not really a 'strange' angle.

But, what I meant is that anytime you can spin the clock hand on one and only one angle and it spins on the face nicely, then you won't have a problem with that angle.

Q: Does the hands of time have to be static and are such persistent references necessary?

A: In Oblivion, yes. In Fallout 3, no.

The problem with Oblivion is that there is not way to dynamically link to the objects. The script must know what object to change the angle of. Thus, you need the specific reference ID names and unique script for each clock.

In Fallout, you have what are called 'Linked References' that you can use. With these, you do not have script like you do in Oblivion.

Q: Can this wisdom be scribed in the form of a mod/resource?

A: I had thought about that but have not put it together completely yet. I was waiting for 'Clocks for My Houses' to be complete and released since it has so many new resources.

Q: Is a hologram clock possible without flicker?

A: I don't know what you mean. But, if it involves several layers of textures with transparency, that alone would cause problems.

Link to comment
Share on other sites

  • 3 weeks later...

Opps. Sorry Willie, in my excitement I failed to state what I did different that made this possible with the script you provided in the first post.

The original rotations I was working with was

X= 30

Y= 330

Z= 215

(which will not keep accurate time with the script in the first post/your original hands without adding a few extra lines in the script)

I then took the original hands and opened them up with blender and rotated them 215 degrees on the Z axis, then moved them back to center and reexported. Switched meshes in the CS and changed the Z angles of the hands to 0. (this is the alt harder way)

====================

To make the clock work with your original hands at any angle one can just insert the Z angle into the XXX spots in this script. (just happens to be 215, but could be any angle)

Note: My clock face and two hands rotations/positions started all the same. Fiddle with/move the X&Y position values of the hands slightly to get them show on top of the face.


;;;Any angle method to the madness. Always Z (I think he/she(?) was on to something....


scn 00000Clockworks1UpNorthEast45Script

float mhand

float hhand

float mhandXXX

float hhandXXX


begin gamemode

        set mhand to GetCurrentTime * 360

        set hhand to GetCurrentTime * 30

        set mhandXXX to mhand + XXX

        set hhandXXX to hhand + XXX

        ClockWorks1UpNorthEast45MinREF.SetAngle  Z mhandXXX

        ClockWorks1UpNorthEast45HourREF.SetAngle  Z  hhandXXX

end[/code]

=============

Also I have another Question: Would you be interested in helping with my clock resource/maybe combining resources for what will be an educational/tutorial/resource mod?

Planned/[WIPz]: The playable/educational esp (tutorial included in the mod, also readable in the CS) & a striped down mergeable resource esp(would help populating big world project mods).

I have a decent start already with over 300 workable clocks spanning different examples of its use. All faces/hands were made as activators.

Also templates, script notes/examples, new textures, new clock hands, other(clock books/pics/gears/etc), books detailing the process of creating a simple working clock/other ideas/etc. And some other notes for things I ran across in the process of making/differences between my/your work.

I have created original round clock meshes(re-UV mapped them to as close to a 512 perfect circle as I can)

I have tried to keep everything explained as simple as I can.

If you would like to help out, PM me with a preferred method of exchange and I will get what I have so far to you.

Thanks.

Rotations:

X= 684.4908

Y= -2475.0654

Z= 1357.5626

Now that is a strange angle! (it's the mead clock) Can anyone figure it out within half of a degree? LOL

I would just like to say this has been a fun learning experience Willie. Thanks again for sharing.

Now to figure out how fast I can get some meshes to spin....in both directions.... :woohoo: ....Hmmmm....

Metallicow

Link to comment
Share on other sites

1. This is exactly what I did in my Clocks of Cyrodiil mod, I 'added' or 'subtracted' from the rotation angle to get the correct time. This is only necessary if you have odd angles where the rotation angle cannot start at 0.

2. I am not really sure what your plan is. But it sounds like it might be good for the clockworks community.

To make the clocks spin faster, you can simply speed up time. :woohoo: To make the clock hand go backwards, you flip the face to the back. It should now spin backwards.

Well, we are about to watch the muppet christmas, so later all!

Link to comment
Share on other sites

  • 1 month later...

I have recreated your design of the Leyawiin clock tower as one full mesh stripped of all the extra stuff and optimised.

Now it could be used for various different things and easily retextured. Easily altered. Can make border towers, clock towers, bell towers, quickly and easily. Just set up your clocks and add the extra zazz a modder would want like the banners or whatever.

I will upload it here as a resource when I have the time.

Here are some pics. The first pic is/was a work in progress pic. The 2nd & 3rd is completed and retextured.

http://i861.photobucket.com/albums/ab180/metallicow/SingleMeshClockTower.jpg

http://i861.photobucket.com/albums/ab180/metallicow/Oblivion%20Screenies/IthinkIcan.jpg

http://i861.photobucket.com/albums/ab180/metallicow/Oblivion%20Screenies/IthinkIdidnt.jpg

What do ya think?

Here's a pic of another clock also. This one uses transparent/moving Textures/Meshes (yea, I finally did some!!)

Underclock.jpg

Now I am trying to add/figure out the attribute to some of the meshes so that they always look forward, such as the light beams.

Any Ideas?....

If I am correct the rotate function in the construction set can only use whole numbers, because decimals in the script will screw the script up because it is a period. Am I right that the closest one can achieve to vanilla timescale in a rotation is 3 degrees/second (rounded up from 2.5)?...

Ex. MeshREF.Rotate (Axis), #

Vanilla timescale is 30 min to 1 real min according to the Wiki.

Metallicow

Link to comment
Share on other sites

That looks good, if not 'huge'. Your character standing at the base of that last clock really showed the scale!

I don't know much about meshes or what you mean by making the light beams look forward.

The Rotate function will take float numbers, which includes decimals.

I am not sure what you are asking about timescale in a rotation. The math I am using sends the angle value into the thousands. Not just angles 0 through 359. But the game still understands those ridiculous numbers and translates them into the correct angle. I did not use Rotate because it would be impossible to keep it at the correct time.

(getcurrenttime * 360)

You change the value of the (360) to get different spinning hands. And you can use different variables for different clock hands.

Sky Face (turns once per day)

set shand to ( getcurrenttime * 15 )

Day of the Week:

set dyHand to ( GetDayOfWeek + 1 ) * 51.4286

Date of the Month:

set dtHand to GameDay * 11.6129

The Month:

set mtHand to ( GameMonth + 1 ) * 30

What I found is you divide 360 by the number of slots you have. For example, the weekly, there are 7 days. 360/7=51.4286 degrees per day.

All that said, using the 'GetCurrentTime' will always give you the correct clock hand angle no matter what TimeScale is being used.

Link to comment
Share on other sites

  • 4 weeks later...

Willie the other day I tried to install the clock in my mod and didn't realize you had a scripting class on it. Needless to say I could have saved myself about 10 hours trying to figure it out for myself. I managed to get to the script that calls "getcurrenttime" but couldn't get it to work. When I saw your class this morning I deleted everything I had and started over following your tutorial. I'm still stuck at getting the script to work.

I've tried the one in the tutorial letter by letter and the script compiles but doesn't make the hands move. I also went back and tried the one from your mod that was called from the ClockCOakCrossierScript which is basically the same and I still can't get it to work. Does this require a specific version of OBSE? I upgraded to 18 a couple of weeks ago and wondering if that might be causing my not being able to get it to work.

Any help would be appreicated..

Arion

Gee I got it working.. It seems that "Attaching" the script just might make a difference.... Went back over the lesson again and saw where you mentioned at the beginning the clock activator was where we were going to attach the script. I didn't see where in the tutorial it mentioned to attach the script so I went looking and saw in lesson where the procedure for attaching scripts and it now works.

YEA....

Edited by Arion
Link to comment
Share on other sites

Glad to hear you got it working. I always attach the 'script' to the clock face which is an activator. I then give the two hands a unique Reference ID Name and use those two Reference ID names in the script on the clock face.

If I have more than one clock in a cell, I will create a new activator object and place a copy of the script for each set of clock hands in the one script. And then hide that one activator with the big script behind a wall in the cell. That way, you only have one script moving all the clocks hands.

Link to comment
Share on other sites

  • 5 years later...

I'm not sure how to use the information right now, maybe this is referring to some modders resource or is in some way tied to the latter Modelling lessons? This is a very interesting topic and doing something like this appears to be simpler than I thought it would be. In any case, I'll be skipping this one for now, but I'm sure to come back here once I get more into asset creation for Oblivion. A simple clock mesh with handles should be good practice!

Link to comment
Share on other sites

  • 4 years later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...