Jump to content

Question about travel and time


Yali

Recommended Posts

Hi all,

 

I'm building a small mod for those who have province mods. The goal is to create a travel system between each province via ships that circle Tamriel. One question is... how do I create a time-lapse when traveling? Right now I'm using basic doors on the ships that link to different cells and worldspaces, but the time stays the same. How would I make time pass when traveling long distances just like with fast travel?

 

Thanks.

Edited by Yali
Link to comment
Share on other sites

I can think of two ways:

 

(a) Script the doors to (1) save the date+time when the player enters the ship and (2) increase the game date-time variables when the player leaves the ship.

 

(b) Just wait for the time to pass. (If you are interested, I have a conceptual mod that does just that: if the player leaves the cabin before the arrival time, the cabin door leads to a ship in high sea. Check here for the Ship Travel sub-mod. Feel free to use any part you want.)

Edited by QQuix
Link to comment
Share on other sites

What I'm doing is using the ships as doors that are unlocked with a travel map obtained by killing pirates on the ships. I'm trying to use the save time command and the increase date-time variable along with your mod's traveling ship commands but I suck at coding. How would you write it out?

 

Thanks by the way for the great resources!

Link to comment
Share on other sites

You mean that you click on the ship and end up on the other place?

 

If so, add the following scrip to the door (make sure it is a new door in your mod, not a vanilla door)

 

(In this example, the 2.5 means that the time will go two and a half hours forward. Change to your liking.)

scn MyDoorScript

begin OnActivate
   call zuTimeForward 2.5
end

And add the following script to you mod (I assume you are using OBSE. If you don't, I can't help you. I don't know how to script without it)

scn zuTimeForward
;--------------------------------------------------------
;
;         zuTimeForward
;                  '08/set/2012 15:32
;--------------------------------------------------------
;
;
;--------------------------------------------------------
float tt
short d


begin Function {tt}

if tt <= 24
  Let gamehour += tt
else
  Let d := tt / 24
  Let gameday += d
  Let gamehour += tt % 24
endif


if gamehour > 24
  Let gameday += 1
  Let gamehour -=  24
  Let GameDaysPassed +=  1
endif


if gameday > 28
  if gamemonth == 1
    Let gamemonth += 1
    Let gameday -= 28
  elseif  gameday > 30 && ( gamemonth == 3 || gamemonth == 5 || gamemonth == 8 || gamemonth == 10 )
    Let gamemonth += 1
    Let gameday -= 30
  elseif  gameday > 31
    Let gamemonth += 1
    Let gameday -= 31
  endif
endif


if gamemonth > 11
  Let gameyear += 1
  Let gamemonth  -= 12
endif


; 0  Morningstar  31  January
; 1  Sun's Dawn  28  February
; 2  First Seed  31  March
; 3  Rain's Hand  30  April
; 4  Second Seed  31  May
; 5  Mid-Year  30  June
; 6  Sun's Height  31  July
; 7  Last Seed  31  August
; 8  Heartfire  30  September
; 9  Frost Fall  31  October
; 10  Sun's Dusk  30  November
; 11  Evening Star  31  December


end

 

Link to comment
Share on other sites

Sorry for the triple post, but this is the script I have now:

 

 

scn TTrDoorTimelapse


ref TheBlackSerpent1
ref TheBlackSerpent2


Begin OnActivate
If sOpenWithKey
call zuTimeForward 4.5 
endif


  if TheBlackSerpent1.Activate
TheBlackSerpent1.disable
TheBlackSerpent2.Enable
endif




if TheBlackSerpent2.Activate
TheBlackSerpent2.disable
TheBlackSerpent1.Enable
endif




end
I know its wrong. What I'm trying to do is have the player loot the pirates and take the map (key) allowing passage to another worldspace. The thing is, with the script as it is now, the time doesn't pass. I have zuTimeForward and it works if I just use Activate, albeit with the locked ship it simply jumps time forward without changing locations, but the sOpenWithKey function seems the throw it off. Yeah, I know I suck at scripting. So far I'm learning pretty quickly.
EDIT:
This is what I have so far and the second ship doesn't enable nor does the time change:
ScriptName ShipTravelScript

Float fQuestDelayTime	
		
Ref TheBlackSerpent1
Ref TheBlackSerpent2
Ref MapToTaneth

Short bDoorState
Ref RowToBlackSerpent

Float tDepartureTime 


begin gamemode

	 If TheBlackSerpent1.GetDistance Player < 200

        SetStage TamrielTransportQuest 10

    	SetStage TamrielTransportQuest 10
		MessageBox "A Strange Ship"
		
	Endif
	

		If Player.AddItem MapToTaneth 001
			SetStage TamrielTransportQuest 20
		MessageBox "A Map to Taneth"
	Endif
	
	
		If bDoorState == 1
		
					if TheBlackSerpent1.Unlock
						; === Player on ship deck - ship departs ===
							TheBlackSerpent1.Disable
							TheBlackSerpent2.Enable
							Call zuTimeForward 4.5
				SetStage TamrielTransportQuest 30
					Endif
			 Endif
				

If bDoorState == 2

		;=== Ship at Dock B ===
			;=== Depart when possible ===
			If TheBlackSerpent1.Activate
					TheBlackSerpent2.disable
					TheBlackSerpent1.Enable
					Call zuTimeForward 4.5
			Endif
	
		RETURN



	ElseIf bDoorState == 0
		;=== First time - Initializa variables ===

		Let fQuestDelayTime := .001

		Let bDoorState := 1  ; Ship at Dock A
	

		TheBlackSerpent2.disable
	
		
	Endif
end

Any idea what I'm doing wrong? It's like the quest won't start.

Edited by Yali
Link to comment
Share on other sites

If I understand your objective correctly, it can be simpler than that.

 

If you don't want the player to see the door until he has the map, this script will keep the door disabled until then

scn aaqqxxDoorScript


begin OnActivate
  ;=== Player has the map - allow door activation ===
  call zuTimeForward 12
  activate
end

begin gamemode
  if playerref.GetItemCount MapToTaneth  > 0
    enable
  else
    disable
  endif
end  

If it is OK to see the door, this script will only transport the player if he has the map.

scn aaqqxxDoorScript
 
begin OnActivate
  if playerref.GetItemCount MapToTaneth  > 0
    ;=== Player has the map - allow door activation ===
    call zuTimeForward 12
    activate
  else 
    ;=== Player does not have the map - do not allow door activation ===
    MessageBox "<some warning message>"
  endif
end

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...