converting oblivion mod to skyrim

Post » Thu Jun 21, 2012 2:14 am

Hi!

I loved Oblivion mod Clocks of Cyrodiil, in fact, so much, that I learned how to make the clocks myself. I have written a small guide for me if years later I wanted to make another clock but couldnt remember how. Since I cant post links, Ill have to post only script:

scn ClockBravilScriptfloat mhandfloat hhandbegin gamemode; ----- Get the hour and minute angle --------------set mhand to ( getcurrenttime * 360 ) + 180CHBravilMinREF.setangle z mhandset hhand to ( getcurrenttime * 30 ) + 180CHBravilHrREF.setangle z hhandend

But now Im faced with a new challenge: To remake this in skyrim. I have already started, but I hit a wall when trying to translate the script. I need some help with this please, I find Oblivion and Skyrim scripting languages completely different.

So far I have very little:
Scriptname clock_Dragonsreach_front  float mhandfloat hhand

I would also very much like to translate the belltower script:

scn BellTowerScript; TS 7/25/07  VWD Chapels.esp; Commented out same cell requirement so can be heard outside walls.float timershort playernearshort soundplayingBegin GameModeset playernear to 1 ; TS;If ( GetInWorldspace ChorrolWorld == 1 ) || ( GetInWorldspace AnvilWorld == 1 ) || ( GetInWorldspace BravilWorld == 1 ) || ( GetInWorldspace BrumaWorld == 1 ) || ( GetInWorldspace CheydinhalWorld == 1 ) || ( GetInWorldspace LeyawiinWorld == 1 ) || ( GetInWorldspace SkingradWorld == 1 ) || ( GetInSameCell player == 1 ); if ( playernear == 0 );  set playernear to 1; endif;elseif ( GetInWorldspace ChorrolWorld == 0 ) || ( GetInWorldspace AnvilWorld == 0 ) || ( GetInWorldspace BravilWorld == 0 ) || ( GetInWorldspace BrumaWorld == 0 ) || ( GetInWorldspace CheydinhalWorld == 0 ) || ( GetInWorldspace LeyawiinWorld == 0 ) || ( GetInWorldspace SkingradWorld == 0 ) || ( GetInSameCell player == 0 ); if ( playernear == 1 );  set playernear to 0; endif;endifif ( soundplaying == 1 )set timer to ( timer - GetSecondsPassed )if ( timer <= -5 )  set soundplaying to 0  set timer to 0endifendifif ( playernear == 1 ) && ( soundplaying == 0 )if ( GameHour >= 23.98 ) || ( GameHour <= 0.02 )  PlaySound3d AMBBellTower12  set soundplaying to 1elseif ( GameHour >= 0.98 ) && ( GameHour <= 1.02 )  PlaySound3d AMBBellTower1  set soundplaying to 1elseif ( GameHour >= 1.98 ) && ( GameHour <= 2.02 )  PlaySound3d AMBBellTower2  set soundplaying to 1elseif ( GameHour >= 2.98 ) && ( GameHour <= 3.02 )  PlaySound3d AMBBellTower3  set soundplaying to 1elseif ( GameHour >= 3.98 ) && ( GameHour <= 4.02 )  PlaySound3d AMBBellTower4  set soundplaying to 1elseif ( GameHour >= 4.98 ) && ( GameHour <= 5.02 )  PlaySound3d AMBBellTower5  set soundplaying to 1elseif ( GameHour >= 5.98 ) && ( GameHour <= 6.02 )  PlaySound3d AMBBellTower6  set soundplaying to 1elseif ( GameHour >= 6.98 ) && ( GameHour <= 7.02 )  PlaySound3d AMBBellTower7  set soundplaying to 1elseif ( GameHour >= 7.98 ) && ( GameHour <= 8.02 )  PlaySound3d AMBBellTower8  set soundplaying to 1elseif ( GameHour >= 8.98 ) && ( GameHour <= 9.02 )  PlaySound3d AMBBellTower9  set soundplaying to 1elseif ( GameHour >= 9.98 ) && ( GameHour <= 10.02 )  PlaySound3d AMBBellTower10  set soundplaying to 1elseif ( GameHour >= 10.98 ) && ( GameHour <= 11.02 )  PlaySound3d AMBBellTower11  set soundplaying to 1elseif ( GameHour >= 11.98 ) && ( GameHour <= 12.02 )  PlaySound3d AMBBellTower12  set soundplaying to 1elseif ( GameHour >= 12.98 ) && ( GameHour <= 13.02 )  PlaySound3d AMBBellTower1  set soundplaying to 1elseif ( GameHour >= 13.98 ) && ( GameHour <= 14.02 )  PlaySound3d AMBBellTower2  set soundplaying to 1elseif ( GameHour >= 14.98 ) && ( GameHour <= 15.02 )  PlaySound3d AMBBellTower3  set soundplaying to 1elseif ( GameHour >= 15.98 ) && ( GameHour <= 16.02 )  PlaySound3d AMBBellTower4  set soundplaying to 1elseif ( GameHour >= 16.98 ) && ( GameHour <= 17.02 )  PlaySound3d AMBBellTower5  set soundplaying to 1elseif ( GameHour >= 17.98 ) && ( GameHour <= 18.02 )  PlaySound3d AMBBellTower6  set soundplaying to 1elseif ( GameHour >= 18.98 ) && ( GameHour <= 19.02 )  PlaySound3d AMBBellTower7  set soundplaying to 1elseif ( GameHour >= 19.98 ) && ( GameHour <= 20.02 )  PlaySound3d AMBBellTower8  set soundplaying to 1elseif ( GameHour >= 20.98 ) && ( GameHour <= 21.02 )  PlaySound3d AMBBellTower9  set soundplaying to 1elseif ( GameHour >= 21.98 ) && ( GameHour <= 22.02 )  PlaySound3d AMBBellTower10  set soundplaying to 1elseif ( GameHour >= 22.98 ) && ( GameHour <= 23.02 )  PlaySound3d AMBBellTower11  set soundplaying to 1endifendifEnd

Any help is greatly appreciated. Thank you very much!
User avatar
Kim Bradley
 
Posts: 3427
Joined: Sat Aug 18, 2007 6:00 am

Post » Thu Jun 21, 2012 9:14 am

I cannot help with the script, but as far as I know, Willie Sea is already working on "Clocks for Skyrim" :)
User avatar
helen buchan
 
Posts: 3464
Joined: Wed Sep 13, 2006 7:17 am

Post » Wed Jun 20, 2012 5:53 pm

Really? How awesome :D But I just cant wait and want to make my own clock as my first mod :P
User avatar
Benjamin Holz
 
Posts: 3408
Joined: Fri Oct 19, 2007 9:34 pm

Post » Thu Jun 21, 2012 9:12 am

Make a digital clock :D
User avatar
QuinDINGDONGcey
 
Posts: 3369
Joined: Mon Jul 23, 2007 4:11 pm

Post » Thu Jun 21, 2012 1:40 am

I have already ported the anolog meshes from Oblivion, would be a shame to stop now :biggrin: Also, digital clock doesnt really fit in now, does it? :P Could anyone explain to me why im getting this error:

RegisterForSingleUpdate is not a function or does not exist
No output generated for clock_Dragonsreach_front, compilation failed.

Scriptname clock_Dragonsreach_frontFunction SomeFunction()RegisterForSingleUpdate(1) ; Before we can use onUpdate() we must register.EndFunctionEvent OnUpdate()Debug.Trace("The current time is: " + Utility.GetCurrentGameTime() + " in game days passed")endEvent
User avatar
Heather M
 
Posts: 3487
Joined: Mon Aug 27, 2007 5:40 am

Post » Wed Jun 20, 2012 8:45 pm

Just so you know, it's a violation of the TOS to distribute mods which use content from other Bethesda games, including Oblivion. Of course, that doesn't mean you can't make it for yourself, however your mod will likely be removed if you upload it to Nexus or the Steam workshop.
User avatar
Ron
 
Posts: 3408
Joined: Tue Jan 16, 2007 4:34 am

Post » Thu Jun 21, 2012 8:28 am

Just so you know, it's a violation of the TOS to distribute mods which use content from other Bethesda games, including Oblivion. Of course, that doesn't mean you can't make it for yourself, however your mod will likely be removed if you upload it to Nexus or the Steam workshop.
I dont have any stuff from Oblivion that was made by Bethesda, everything was made by other modders (which Ill ask for permission if I decide to release).
-------------------------------------------------
Am I on the correct way?
Scriptname clock_Dragonsreach_frontfloat mhandfloat hhandFunction SomeFunction()  		RegisterForSingleUpdate(1)EndFunctionEvent OnUpdate()set mhand to ( GetCurrentHourOfDay() * 360 ) + 180clockhandm_dragonsreachfrontProperty.SetAngle(0.0, 0.0, mhand)set hhand to ( GetCurrentHourOfDay() * 30 ) + 180clockhandh_dragonsreachfrontProperty.SetAngle(0.0, 0.0, hhand)endEventfloat Function GetCurrentHourOfDay()float Time = Utility.GetCurrentGameTime()Time -= Math.Floor(Time) ; Remove "previous in-game days passed" bitTime *= 24 ; Convert from fraction of a day to number of hoursReturn TimeEndFunction

[IMG]http://shrani.si/f/1E/4/1EvmE2hp/tesv20120422204133727.jpg[/IMG]
User avatar
Abi Emily
 
Posts: 3435
Joined: Wed Aug 09, 2006 7:59 am

Post » Thu Jun 21, 2012 9:58 am

Just so you know, it's a violation of the TOS to distribute mods which use content from other Bethesda games, including Oblivion. Of course, that doesn't mean you can't make it for yourself, however your mod will likely be removed if you upload it to Nexus or the Steam workshop.
Only applies to things made by Bethesda. User made content is always 100% transferable.
User avatar
Soku Nyorah
 
Posts: 3413
Joined: Tue Oct 17, 2006 1:25 pm

Post » Wed Jun 20, 2012 9:22 pm

Nice picture,...I want, I want :banana:
User avatar
Horse gal smithe
 
Posts: 3302
Joined: Wed Jul 05, 2006 9:23 pm

Post » Wed Jun 20, 2012 6:37 pm

WillieSea is planning on making this for Skyrim himself. Look at his sig...
User avatar
Julie Ann
 
Posts: 3383
Joined: Thu Aug 23, 2007 5:17 am

Post » Thu Jun 21, 2012 3:50 am

You're getting close, but you are also violating some very basic stuff. For example, set is no longer used, and is replace by a single equal sign ( = ). Also, your RegisterForUpdate() will never fire because the function that contains it is never called (thus not "activiating" it). Here's my version:
Scriptname clock_Dragonsreach_frontfloat mhandfloat hhandEvent OnInit()		  RegisterForSingleUpdate(1)EndFunctionEvent OnUpdate()mhand = ( GetCurrentHourOfDay() * 360 ) + 180clockhandm_dragonsreachfrontProperty.SetAngle(0.0, 0.0, mhand)hhand = ( GetCurrentHourOfDay() * 30 ) + 180clockhandh_dragonsreachfrontProperty.SetAngle(0.0, 0.0, hhand)RegisterForSingleUpdate(1)endEventfloat Function GetCurrentHourOfDay()float Time = Utility.GetCurrentGameTime()Time -= Math.Floor(Time) ; Remove "previous in-game days passed" bitTime *= 24 ; Convert from fraction of a day to number of hoursReturn TimeEndFunction
See if this works.
User avatar
Alan Cutler
 
Posts: 3163
Joined: Sun Jul 01, 2007 9:59 am

Post » Thu Jun 21, 2012 7:56 am

WillieSea is planning on making this for Skyrim himself. Look at his sig...
It doesn't matter... Is there some kind of monopolistic dynamic with the modding community ?... If I can get other choices for clocks, why not ? Let the competition begin ! ;-P
User avatar
Anna S
 
Posts: 3408
Joined: Thu Apr 19, 2007 2:13 am

Post » Thu Jun 21, 2012 7:06 am

To JustinOther: Yes, I heard, and its awesome :biggrin:, still, I dont know when the mod will be released so I want to play the game (havent finished it yet) with at least a few clocks until the mod gets released.

You're getting close, but you are also violating some very basic stuff. For example, set is no longer used, and is replace by a single equal sign ( = ). Also, your RegisterForUpdate() will never fire because the function that contains it is never called (thus not "activiating" it). Here's my version:
 Scriptname clock_Dragonsreach_front float mhand float hhand Event OnInit() RegisterForSingleUpdate(1) EndFunction Event OnUpdate() mhand = ( GetCurrentHourOfDay() * 360 ) + 180 clockhandm_dragonsreachfrontProperty.SetAngle(0.0, 0.0, mhand) hhand = ( GetCurrentHourOfDay() * 30 ) + 180 clockhandh_dragonsreachfrontProperty.SetAngle(0.0, 0.0, hhand) RegisterForSingleUpdate(1) endEvent float Function GetCurrentHourOfDay() float Time = Utility.GetCurrentGameTime() Time -= Math.Floor(Time) ; Remove "previous in-game days passed" bit Time *= 24 ; Convert from fraction of a day to number of hours Return Time EndFunction 
See if this works.

Thank you for your help! Much appreciated!
I have replaced the EndFunction with EndEvent (probably type error) and heres what I get:

clock_Dragonsreach_front.psc(7,18): RegisterForSingleUpdate is not a function or does not existclock_Dragonsreach_front.psc(13,0): variable clockhandm_dragonsreachfront is undefinedclock_Dragonsreach_front.psc(13,37): none is not a known user-defined typeclock_Dragonsreach_front.psc(15,0): variable clockhandh_dragonsreachfront is undefinedclock_Dragonsreach_front.psc(15,37): none is not a known user-defined typeclock_Dragonsreach_front.psc(16,0): RegisterForSingleUpdate is not a function or does not existNo output generated for clock_Dragonsreach_front, compilation failed.

I have a question here:
-> If IDs for hands are clockhandm_dragonsreachfront and clockhandh_dragonsreachfront, how do I address them here? I get the undefined error if I use clockhandm_dragonsreachfront.SetAngle(0.0, 0.0, mhand)
-> I cant figure out what it means by "none".
-> How is it possible that it doesnt know RegisterForSingleUpdate, isnt that an integrated function?
User avatar
REVLUTIN
 
Posts: 3498
Joined: Tue Dec 26, 2006 8:44 pm

Post » Thu Jun 21, 2012 3:03 am

Why not contact WillieSea and ask him how he did it? He would know better then anyone else.
User avatar
BRIANNA
 
Posts: 3438
Joined: Thu Jan 11, 2007 7:51 pm

Post » Thu Jun 21, 2012 2:54 am

I don't know WillieSea but he seems like a nice guy....seeing as he released all of his source will the mod and said "I released all of my code so you can see how I did it".

He used SplineTranslateTo() for the hands. I know cause I read thru his code last week.
User avatar
Crystal Clear
 
Posts: 3552
Joined: Wed Aug 09, 2006 4:42 am

Post » Thu Jun 21, 2012 10:18 am

It doesn't matter... Is there some kind of monopolistic dynamic with the modding community ?... If I can get other choices for clocks, why not ? Let the competition begin ! ;-P
'Course not. Just sayin' the clock master is on it and figured the OP might not know it's in the pipeline.
To JustinOther: Yes, I heard, and its awesome :biggrin:, still, I dont know when the mod will be released so I want to play the game (havent finished it yet) with at least a few clocks until the mod gets released.
Can't wait for it either. Clocks of Cyrodiil was one of my favorite Oblivion mods. Good luck with your endeavor. :)
User avatar
Kevin S
 
Posts: 3457
Joined: Sat Aug 11, 2007 12:50 pm

Post » Wed Jun 20, 2012 8:35 pm

You're getting close, but you are also violating some very basic stuff. For example, set is no longer used, and is replace by a single equal sign ( = ). Also, your RegisterForUpdate() will never fire because the function that contains it is never called (thus not "activiating" it). Here's my version:
Scriptname clock_Dragonsreach_front
See if this works.
Your script needs to extend something. RegisterForSingleUpdate() is a quest function, so that first line of the script should be:

Scriptname clock_Dragonsreach_front extends Quest

One assumes you have this attached to an actual quest entry somewhere that's set to start enabled?
User avatar
Sherry Speakman
 
Posts: 3487
Joined: Fri Oct 20, 2006 1:00 pm

Post » Thu Jun 21, 2012 1:39 am

Okay, WillieSea suggested that I take a look at his script in Levelers Tower, I did so, and I already have the first question before even trying to use it on my clock. In his script, he is addressing the hands with

Scriptname LevelersClockQuestScript extends Quest  {Controls Clock Hands}GlobalVariable Property GameHour  Auto  GlobalVariable Property GameDay  Auto  GlobalVariable Property GameMonth  Auto  GlobalVariable Property GameDaysPassed  Auto  ObjectReference Property MinuteHand  Auto  ObjectReference Property HourHand  Auto  ObjectReference Property HourHand2  Auto  ObjectReference Property MinuteHand2  Auto  ObjectReference Property MonthHand  Auto  ObjectReference Property DateHand  Auto  ObjectReference Property DayHand  Auto  ObjectReference Property HourHand3  Auto  ObjectReference Property MinuteHand3  Auto

Where are those defined? I searched in Creation Kit and the hands dont have Reference Editor ID set at all. Is there another script where those things are defined? From only this I dont see how the engine know which object to move.
[IMG]http://shrani.si/f/1c/6j/3qpnnraA/clockskyrim.png[/IMG]
User avatar
Claudz
 
Posts: 3484
Joined: Thu Sep 07, 2006 5:33 am

Post » Thu Jun 21, 2012 3:22 am

Okay, I have found out what there upper things mean and got the thing working :biggrin: YAY!!!

[IMG]http://shrani.si/f/1Y/SS/1TBEIds8/tesv20120425210505343.jpg[/IMG]
[IMG]http://shrani.si/f/1Y/SS/1TBEIds8/tesv20120425210505343.jpg[/IMG]
[IMG]http://shrani.si/f/1Y/SS/1TBEIds8/tesv20120425210505343.jpg[/IMG]
(if it opens same image for all three links then copy and paste it into address bar if you want to see other two)

But, I still have I few problems which I hope someone can help me resolve:
-> the hands move discretely, not continuously (not sure if thats ok, anyone who has tried Levelers Tower, do clock hands move D or C?)
-> they are very dark, even though the texture is brown, i assume something's wrong with lightning (I have followed tutorial on Nexus to get them in game, im confused why this is happening because when I ported clock face the border of it acted the same way - can be seen on a pic a few posts back, then I deleted it and made a new one, and then it was fine)
-> the hands cannot be seen from other side of Whiterun, they just "disappear", is there any setting for this in creation kit?
-> they are not antialiased when I look at them from afar, even though i have AA on 8x, everything else is AAed
User avatar
Siobhan Wallis-McRobert
 
Posts: 3449
Joined: Fri Dec 08, 2006 4:09 pm

Post » Thu Jun 21, 2012 3:06 am

Clocktower looks good..nj

I think I remember leveler's tower clocks were not continous...as in tick, tick, tick.
User avatar
Andres Lechuga
 
Posts: 3406
Joined: Sun Aug 12, 2007 8:47 pm

Post » Wed Jun 20, 2012 10:24 pm

You wouldn't want them to update in real time.
Time in Skyrim passes alot faster than normal time. Your minute hand would look like a second hand if it were to keep live Skyrim time.

As for the hands not showing, tick the Is Full LOD box in the objects properties.
User avatar
Dj Matty P
 
Posts: 3398
Joined: Sat Jun 09, 2007 12:31 am

Post » Thu Jun 21, 2012 8:22 am

Echonite: That's simply NOT true... you cannot use other people's assets unless you get their permission, or the mod uses whatever they call those open license things (like GNU, Creative Commons, etc).

Terraviper-5: It possibly isn't continuous because, and I could be mistaken here, that onInit Event should be changed to an onCellAttach. I don't think onInit fires all the time.. pretty much only once (since your clock isn't a quest or alias), unless it's called specifically with a reset() I think. So it may not trigger the onUpdate event when you return to the area a second time; which would cause it to always show the same time you saw when first entering. Also, you don't need the script to regSingle once every second if you don't have a second hand.. I'd change that to (60) instead of (1).

I'm not sure what you mean by discrete movement... like, as in the hands instantly appearing in their new positions (as opposed to continuous - being fluid motion to their next position)? If so, you should replace the setAngle with a translateTo... then set the rotation clamp to whatever you find most desirable (while the movement speed would be like 1 or something arbitrary besides 0, I'd imagine).

As far as your texture issue goes, do you have correct normal maps included for your tex (myTex_n.dds)? That may cause it to appear darker than it should, as it wouldn't be reflecting any light. It may also mess with the AA as well, though I'm not THAT familiar with AA and what it specifically affects.

[EDIT: tamb0 makes a good point that Skyrim time passes at a 20 to 1 ratio (or was it 30 to 1..). You can change this in-game with the console; but I don't know how to do it in a script. You'd set the scale to 1 (so time passes the same as the real world) if you want to use my suggestion of every 60 seconds updating. If leaving the scale at default, and it's 20:1, you'd set the regSingle to every 3 seconds to have the minute hand tick away.]
User avatar
Susan
 
Posts: 3536
Joined: Sun Jun 25, 2006 2:46 am

Post » Wed Jun 20, 2012 10:40 pm

if a user changes their ini settings for non-default skyrim>realworld time passage, wouldn't that destroy your script if using registerforupdate? doesn't matter if you do the 20:1 offset, for different users, this could be at different scales.

why not use registerforupdategametime instead
User avatar
Beat freak
 
Posts: 3403
Joined: Thu Dec 14, 2006 6:04 am

Post » Thu Jun 21, 2012 5:57 am


Skyrim time passes at a 20 to 1 ratio (or was it 30 to 1..)
Skyrim's default value is 20 while it was 30 for the Fallouts and Oblivion.
You can change this in-game with the console; but I don't know how to do it in a script.
Timescale.SetValue(1)
User avatar
Juan Cerda
 
Posts: 3426
Joined: Thu Jul 12, 2007 8:49 pm

Post » Thu Jun 21, 2012 8:53 am

if a user changes their ini settings for non-default skyrim>realworld time passage, wouldn't that destroy your script if using registerforupdate? doesn't matter if you do the 20:1 offset, for different users, this could be at different scales.

why not use registerforupdategametime instead

I've found that RegisterForUpdateGameTime isn't really reliable for small time increments. Well actually not the function but if you're trying to register for update every 10 game seconds, you would need to use RegisterForUpdateGameTime(1 / 360) and I guess there's some trouble with calculating numbers so low.

Reading this makes me want to build my own clock...
User avatar
katsomaya Sanchez
 
Posts: 3368
Joined: Tue Jun 13, 2006 5:03 am

Next

Return to V - Skyrim