Jump to content

WIP - The Companion friendly Hobbit Home


Pellape

Recommended Posts

This is nuts. The script is done and it took 5 days to complete it. As I did mention earlier, it sounds easy to fill the rack with bottles, but I cannot claim it is so. If you want some headache, then read this bloody script. :D

 

If you do not want headache... Don't read it... ;) This is completely nuts and it still does not work 100% and I will take some examples:

 

I do not want Skooma nor Bergamont Tea to end up in the racks and still they do and I do check for them in the function further below, so why??

scn PekFillRackWithBottlesSCR


Ref BottleRef
Ref BottleRef2
Ref BottleBaseRef
Ref EmptyRef

Float xPos
Float yPos
Float zPos

Float xAngle
Float yAngle
Float zAngle

Float StartX
Float StartY
Float StartZ

Float RackPosAng

Short Button
Short TurnX
Short TurnZ
Short Turn
Short BottlesAmmount
Short State
Short Rack

Short BottleType
	; Beer 		1
	; Wine01 	2
	; Wine02 	3
	; Milk		4

Begin OnActivate

	MessageBoxEX "Do you want to fill the rack with Bottles?%r(Make sure it is completely empty before duing this)|No|Yes"
	Set State to 20
End

;;;;;;;;;;;;;;;;;;;;;;;;;;;

Begin GameMode

	If ( State == 0 )
		Return
	EndIf
	
	If ( State == 20 )
		Set Button to GetButtonPressed
		
		If ( Button == 0 )
			Set State to 0
			Return
		ElseIf ( Button == 1 )
			Set State to 1
		EndIf
	EndIf
	
	If ( State == 1 )
		Set EmptyRef to 0
		Set BottleType to 0

		Set BottlesAmmount to DrinksCabinet01Ref.GetNumItems
	
		If ( BottlesAmmount == 0 )
			MessageBoxEX "Fill up the Upper Cabinet to the right of the rack with bottles"
			Set State to 0
			Return
		EndIf

		; Filling the upper Rack
		Set Rack to 1
		
		; x steps 10.85
		; z steps 13,37
		Set StartX to PekBottleRackRef.Getpos x - 32.52
		Set StartY to PekBottleRackRef.Getpos y - 3.1
		Set StartZ to PekBottleRackRef.Getpos z + 31.17
				
		Set TurnZ to 1
		Set TurnX to 1

		Set State to 2
	EndIf	
	
	If ( State == 2 )
		If ( TurnZ < 5 )
			If ( TurnX < 6 )

				Call PekCheckBottleTypesFUN

				;Beer and Mead bottles
				Set xPos to StartX + ( 10.85 * TurnX )
				Set yPos to StartY
				Set zPos to StartZ - ( 13.37 * TurnZ )
				
				Set xAngle to -92.5
				Set yAngle to 0
				Set zAngle to 135
				
				If ( BottleType == 2 )
					Set zPos to zPos + 1
					
					Set xAngle to -90
					Set zAngle to 165
				ElseIf ( BottleType == 3 )
					Set zPos to zPos + 1
					
					Set xAngle to -90
				ElseIf ( BottleType == 4 )
					Set xPos to xPos + 0.5
					Set yPos to yPos + 2
					Set zPos to zPos + 1
					
					Set xAngle to -90
				EndIf

				Set TurnX to TurnX + 1
				
				If eval ( BottleRef != EmptyRef )
					Player.PlaceAtMe BottleRef 1
					DrinksCabinet01Ref.RemoveItem BottleRef 1
					
					Set State to 3
					Return
				EndIf	
				
			Else
				Set TurnX to 1
				Set TurnZ to TurnZ + 1
			EndIf
		Else 
			Set State to 11
			Set Rack to 2
		EndIf
	EndIf
	
	If ( State == 3 )
		BottleRef.disable
		Set State to 4
		Return
	EndIf

	If ( State == 4 )
		BottleRef.enable
		Set State to 5
		Return
	EndIf	

	If ( State == 5 )

		Printc "Bottle == %i %n", BottleRef, BottleRef
	
		set BottleRef2 to GetFirstRef 40 4
		While ( BottleRef2 )
			Set BottleBaseRef to BottleRef2.GetBaseObject
			If eval ( BottleBaseRef == BottleRef )
				Set BottleRef to BottleRef2
				Break
			EndIf
			
			Set BottleRef2 to GetNextRef
		loop
					
		If eval ( BottleRef != PekBottleRackRef || BottleRef == EmptyRef )
			BottleRef.SetPos x xPos
			BottleRef.SetPos y yPos
			BottleRef.SetPos z zPos
			
			BottleRef.SetAngle x xAngle
			BottleRef.SetAngle y yAngle
			BottleRef.SetAngle z zAngle
		EndIf
		
		Set State to 6
		Return
	EndIf
	
	If ( State == 6 )
		BottleRef.disable

		Set State to 7
		Return
	EndIf

	If ( State == 7 )
		BottleRef.Enable
		
		If ( Rack == 1 )
			Set State to 2
		ElseIf ( Rack == 2 )
			Set State to 12
		EndIf
		
		Return
	EndIf
	
	;Filling the lower Rack

	; x steps 14
	; z steps 13,22
	If ( State == 11 )
	
		Set StartX to PekBottleRackRef.Getpos x - 35.3
		Set StartY to PekBottleRackRef.Getpos y - 9
		Set StartZ to PekBottleRackRef.Getpos z - 35.3
				
		Set TurnZ to 1
		Set TurnX to 1
		
		Set State to 12
	EndIf
	
	If ( State == 12 )
		
		If ( TurnZ < 5 )
			If ( TurnX < 5 )

				Call PekCheckBottleTypesFUN

				;Beer and Mead bottles
				Set xPos to StartX + ( 14 * TurnX )
				Set yPos to StartY - 10
				Set zPos to StartZ - ( 13.22 * TurnZ )
				
				Set xAngle to -90
				Set yAngle to 0
				Set zAngle to 135
				
				If ( BottleType == 2 )
					Set zPos to zPos + 1
					
					Set zAngle to 165
				ElseIf ( BottleType == 3 )
					Set zPos to zPos + 1
				ElseIf ( BottleType == 4 )
					Set xPos to xPos + 0.5
					Set yPos to yPos + 2
					Set zPos to zPos + 1
				EndIf

				Set TurnX to TurnX + 1
				
				If eval ( BottleRef != EmptyRef )
					Player.PlaceAtMe BottleRef 1
					DrinksCabinet01Ref.RemoveItem BottleRef 1
					
					Set State to 3
					Return
				EndIf
			Else
				Set TurnX to 1
				Set TurnZ to TurnZ + 1
			EndIf
		Else
			Set State to 0
			Set TurnZ to 1
		EndIf
	EndIf
End

scn PekCheckBottleTypesFUN

string_var Path
string_var CompPatch

Ref BottleRef
Ref BottleBaseRef
Ref EmptyRef

Float RNDBottleFL

Short BottleType
Short RNDBottleSH
Short BeerTurnCOBL
Short BottlesAmmount
Short ItemType
Short Turn

Short BottleType
	; Beer 		1
	; Wine01 	2
	; Wine02 	3
	; Milk		4
	
	
Begin Function {}

	Set BottlesAmmount to DrinksCabinet01Ref.GetNumItems + 1
	Set RNDBottleFL to Rand 0 BottlesAmmount
	Set RNDBottleSH to RNDBottleFL

	Set BottleRef to DrinksCabinet01Ref.GetInventoryObject RNDBottleSH
	Set ItemType to GetObjectType BottleRef
					
	If ( ItemType != 40 )
		Set Turn to 0
		Set BottlesAmmount to BottlesAmmount + 1
		While ( Turn < BottlesAmmount )
			Set BottleRef to DrinksCabinet01Ref.GetInventoryObject Turn
			Set ItemType to GetObjectType BottleRef
			Set BottleBaseRef to BottleRef.GetBaseObject
			Printc "Bottle = %i %n - Bottle Base = %i %n", BottleRef, BottleRef, BottleBaseRef, BottleBaseRef
			If eval ( BottleBaseRef != cobBevFlin || BottleBaseRef != cobBevGreef || BottleBaseRef != cobBevMazte || BottleBaseRef != cobBevShein || BottleBaseRef != PotionSkooma )
				If eval ( BottleBaseRef != cobBevSujamma || BottleBaseRef != cobBevTelvanniBugMusk || BottleBaseRef != cobBevTea || BottleBaseRef != cobSalDrinkHoney ) 
					If ( ItemType == 40 )
						Set Turn to 0
						break
					EndIf
				EndIf
			Else 
				Set Turn to Turn + 1
			EndIf
		Loop
		
		Set BottlesAmmount to BottlesAmmount - 1
		If ( Turn == BottlesAmmount )
			MessageBoxEX "Fill up the Upper Cabinet to the right of the rack with bottles"
			Set PekFillRackRef.State to 0
			Return
		EndIf
	EndIf

	Let Path := GetModelPath BottleRef

	Set BeerTurnCOBL to 1

	While ( BeerTurnCOBL < 15 )
		Let CompPatch := ToString BeerTurnCOBL
		If ( BeerTurnCOBL < 10 )
			Let CompPatch := "clutter\Booze\BEER!bottle0" + CompPatch + ".nif"
		Else
			Let CompPatch := "clutter\Booze\BEER!bottle" + CompPatch + ".nif"
		EndIf
		
		If Eval ( Path == CompPatch )
			Set BottleType to 1
			Break
		EndIf
		Set BeerTurnCOBL to BeerTurnCOBL + 1
	Loop
	
	Let CompPatch := ToString "Clutter\AleBottle.NIF"
	If Eval ( Path == CompPatch )
		Set BottleType to 1
	EndIf
	
	Let CompPatch := ToString "Clutter\BeerBottle.NIF"
	If Eval ( Path == CompPatch )
		Set BottleType to 1
	EndIf
	
	Let CompPatch := ToString "Clutter\MeadBottle.NIF"
	If Eval ( Path == CompPatch )
		Set BottleType to 1
	EndIf

	Let CompPatch := ToString "clutter\milkbottle.nif"
	If Eval ( Path == CompPatch )
		Set BottleType to 4
	EndIf
	
	Let CompPatch := ToString "clutter\Booze\BEER!Mead.nif"
	If Eval ( Path == CompPatch )
		Set BottleType to 1
	EndIf
	
	Let CompPatch := ToString "clutter\Booze\BEER!Cider.nif"
	If Eval ( Path == CompPatch )
		Set BottleType to 1
	EndIf
	
	Let CompPatch := ToString "Clutter\winebottle01.NIF"
	If Eval ( Path == CompPatch )
		Set BottleType to 2
	EndIf
	
	Let CompPatch := ToString "Clutter\winebottle02.NIF"
	If Eval ( Path == CompPatch )
		Set BottleType to 3
	EndIf
	
	Let CompPatch := ToString "Clutter\winebottle03.NIF"
	If Eval ( Path == CompPatch )
		Set BottleType to 2
	EndIf

	Set PekFillRackRef.BottleType to BottleType
	Set PekFillRackRef.BottleRef to BottleRef

End
				
Link to comment
Share on other sites

  • Replies 406
  • Created
  • Last Reply

Top Posters In This Topic

Finally. After 6 days, I got a script that seems to work perfect and I had to do a lot of debugging to find out what caused the problems.

Before I run it - After I run it - And after I run the script twice, which I do not recommend (You will get a warning: Make sure the rack is empty before starting)

50822247541_c4ab3faa28_o.jpg

Well - WAC adds Skooma so therefor Skooma got added as I did only check for the original Skooma and in the end, to find suitable bottles, I had to do a goto label, which is very dangerous to do if there is no clear exit and no real programmers ever use goto, never. But I am not a real programmer and I do have a very clear exit in the code... :wink: While, Wend, and For was created in all languages to make sure no endless loops where ever made but what they really do inside the CPU is goto and the assembler instruction is simply called jmp (jump) and that is the most important instruction ever made if you ask me that is, as it allowed us to have computers at all as without jmp, it is impossible to allow the computer to do the choices we make.

Hmm. lets skip the CPU stuff and look how the code looks like now, well, if you wanna see it that is:

scn PekFillRackWithBottlesSCR


Ref BottleRef
Ref BottleRef2
Ref BottleBaseRef
Ref EmptyRef

Float xPos
Float yPos
Float zPos

Float xAngle
Float yAngle
Float zAngle

Float StartX
Float StartY
Float StartZ

Float RackPosAng

Short Button
Short TurnX
Short TurnZ
Short Turn
Short BottlesAmmount
Short State
Short Rack
Short BottleCount

Short BottleType
	; Beer 		1
	; Wine01 	2
	; Wine02 	3
	; Milk		4

Begin OnActivate

	MessageBoxEX "Do you want to fill the rack with Bottles?%r(Make sure it is completely empty before duing this)|No|Yes"
	Set State to 20
End

;;;;;;;;;;;;;;;;;;;;;;;;;;;

Begin GameMode

	If ( State == 0 )
		Return
	EndIf
	
	If ( State == 20 )
		Set Button to GetButtonPressed
		
		If ( Button == 0 )
			Set State to 0
			Return
		ElseIf ( Button == 1 )
			Set State to 1
			Set Button to -1
		EndIf
	EndIf
	
	If ( State == 1 )
		Set EmptyRef to 0
		Set BottleType to 0

		Set BottlesAmmount to DrinksCabinet01Ref.GetNumItems
	
		If ( BottlesAmmount == 0 )
			MessageBoxEX "Fill up the Upper Cabinet to the right of the rack with bottles"
			Set State to 0
			Return
		EndIf

		; Filling the upper Rack
		Set Rack to 1
		
		; x steps 10.85
		; z steps 13,37
		Set StartX to PekBottleRackRef.Getpos x - 32.52
		Set StartY to PekBottleRackRef.Getpos y - 3.1
		Set StartZ to PekBottleRackRef.Getpos z + 31.17
				
		Set TurnZ to 1
		Set TurnX to 1

		Set State to 2
	EndIf	
	
	If ( State == 2 )
		If ( TurnZ < 5 )
			If ( TurnX < 6 )

				Call PekCheckBottleTypesFUN
				
				Set BottleCount to BottleCount + 1
				;Scribe "BottleNumber = %0.0f" BottleCount
				
				;Beer and Mead bottles
				Set xPos to StartX + ( 10.85 * TurnX )
				Set yPos to StartY
				Set zPos to StartZ - ( 13.37 * TurnZ )
				
				Set xAngle to -92.5
				Set yAngle to 0
				Set zAngle to 135
				
				If ( BottleType == 2 )
					Set zPos to zPos + 1
					
					Set xAngle to -90
					Set zAngle to 165
				ElseIf ( BottleType == 3 )
					Set zPos to zPos + 1
					
					Set xAngle to -90
				ElseIf ( BottleType == 4 )
					Set xPos to xPos + 0.5
					Set yPos to yPos + 2
					Set zPos to zPos + 1
					
					Set xAngle to -90
				EndIf

				Set TurnX to TurnX + 1
				
				If eval ( BottleRef != EmptyRef )
					Player.PlaceAtMe BottleRef 1
					DrinksCabinet01Ref.RemoveItem BottleRef 1
					
					Set State to 3
					Return
				EndIf	
				
			Else
				Set TurnX to 1
				Set TurnZ to TurnZ + 1
			EndIf
		Else 
			Set State to 11
			Set Rack to 2
		EndIf
	EndIf
	
	If ( State == 3 )
		BottleRef.disable
		Set State to 4
		Return
	EndIf

	If ( State == 4 )
		BottleRef.enable
		Set State to 5
		Return
	EndIf	

	If ( State == 5 )

		;Printc "Bottle == %i %n", BottleRef, BottleRef
	
		set BottleRef2 to GetFirstRef 40 4
		While ( BottleRef2 )
			Set BottleBaseRef to BottleRef2.GetBaseObject
			If eval ( BottleBaseRef == BottleRef )
				Set BottleRef to BottleRef2
				Break
			EndIf
			
			Set BottleRef2 to GetNextRef
		loop
					
		If eval ( BottleRef != PekBottleRackRef || BottleRef == EmptyRef )
			BottleRef.SetPos x xPos
			BottleRef.SetPos y yPos
			BottleRef.SetPos z zPos
			
			BottleRef.SetAngle x xAngle
			BottleRef.SetAngle y yAngle
			BottleRef.SetAngle z zAngle
		EndIf
		
		Set State to 6
		Return
	EndIf
	
	If ( State == 6 )
		BottleRef.disable

		Set State to 7
		Return
	EndIf

	If ( State == 7 )
		BottleRef.Enable
		
		If ( Rack == 1 )
			Set State to 2
		ElseIf ( Rack == 2 )
			Set State to 12
		EndIf
		
		Return
	EndIf
	
	;Filling the lower Rack

	; x steps 14
	; z steps 13,22
	If ( State == 11 )
	
		Set StartX to PekBottleRackRef.Getpos x - 35.3
		Set StartY to PekBottleRackRef.Getpos y + 8
		Set StartZ to PekBottleRackRef.Getpos z - 35.3
				
		Set TurnZ to 1
		Set TurnX to 1
		
		Set State to 12
	EndIf
	
	If ( State == 12 )
		
		If ( TurnZ < 5 )
			If ( TurnX < 5 )

				Call PekCheckBottleTypesFUN

				Set BottleCount to BottleCount + 1
				;Scribe "BottleNumber = %0.0f" BottleCount
				

				;Beer and Mead bottles
				Set xPos to StartX + ( 14 * TurnX )
				Set yPos to StartY - 15
				Set zPos to StartZ - ( 13.22 * TurnZ )
				
				Set xAngle to -90
				Set yAngle to 0
				Set zAngle to 135
				
				If ( BottleType == 2 )
					Set zPos to zPos + 1
					
					Set zAngle to 165
				ElseIf ( BottleType == 3 )
					Set zPos to zPos + 1
				ElseIf ( BottleType == 4 )
					Set xPos to xPos + 0.5
					Set yPos to yPos + 2
					Set zPos to zPos + 1
				EndIf

				Set TurnX to TurnX + 1
				
				If eval ( BottleRef != EmptyRef )
					Player.PlaceAtMe BottleRef 1
					DrinksCabinet01Ref.RemoveItem BottleRef 1
					
					Set State to 3
					Return
				EndIf
			Else
				Set TurnX to 1
				Set TurnZ to TurnZ + 1
			EndIf
		Else
			Set State to 0
			Set TurnZ to 1
		EndIf
	EndIf
End

scn PekCheckBottleTypesFUN

string_var Path
string_var CompPatch

Ref BottleRef
Ref BottleBaseRef
Ref EmptyRef

Float RNDBottleFL

Short BottleType
Short RNDBottleSH
Short BeerTurnCOBL
Short BottlesAmmount
Short ItemType
Short Turn

Short BottleType
	; Beer 		1
	; Wine01 	2
	; Wine02 	3
	; Milk		4
	
	
Begin Function {}

	Label 0

	Set EmptyRef to 0
	Set BottleType to 0

	Set BottlesAmmount to DrinksCabinet01Ref.GetNumItems + 1
	Set RNDBottleFL to Rand 0 BottlesAmmount
	Set RNDBottleSH to RNDBottleFL

	Set BottleRef to DrinksCabinet01Ref.GetInventoryObject RNDBottleSH

	If eval ( BottleRef != EmptyRef || BottleRef == DrinksCabinet01Ref)
		Set ItemType to GetObjectType BottleRef
	EndIf
	
	If ( ItemType != 40 )
		Set BottlesAmmount to BottlesAmmount + 1
		Set Turn to BottlesAmmount
;		Scribe "Iten Type == %.0f - BottleRef = %i %n" ItemType BottleRef BottleRef
		While ( Turn > -1 )
;			Scribe "Turn = %.0f", Turn
			Set BottleRef to DrinksCabinet01Ref.GetInventoryObject Turn
;			Scribe "BottleRef = %i %n" BottleRef BottleRef
			If eval ( BottleRef != EmptyRef || BottleRef == DrinksCabinet01Ref)
				Set ItemType to GetObjectType BottleRef
				;Set BottleBaseRef to BottleRef.GetBaseObject
;				Scribe "Bottle = %i %n - ItemType Type = %.0f", BottleRef, BottleRef, ItemType
				If eval ( BottleRef != cobBevFlin || BottleRef != cobBevGreef )
					If  eval (BottleRef != cobBevMazte || BottleRef != cobBevShein ) 
						If eval ( BottleRef != PotionSkooma || BottleRef != cobBevSujamma )
							If Eval ( BottleRef != cobBevTelvanniBugMusk || BottleRef != cobBevTea )
								If Eval ( BottleRef != cobSalDrinkHoney ) 
									If ( ItemType == 40 )
										break
									EndIf
								EndIf
							EndIf
						EndIf
					EndIf
				EndIf
			EndIf
			Set Turn to Turn - 1
		Loop
		
		Set BottlesAmmount to BottlesAmmount - 1
		If ( Turn <= 0 )
			MessageBoxEX "Fill up the Upper Cabinet to the right of the rack with bottles"
			Set PekFillRackRef.State to 0
			Return
		EndIf
	EndIf

	If eval ( BottleRef != EmptyRef || BottleRef == DrinksCabinet01Ref)
		Let Path := GetModelPath BottleRef
;		Scribe "Path = %z", Path
	EndIf

	Set BeerTurnCOBL to 1

	While ( BeerTurnCOBL < 15 )
		Let CompPatch := ToString BeerTurnCOBL
		If ( BeerTurnCOBL < 10 )
			Let CompPatch := "clutter\Booze\BEER!bottle0" + CompPatch + ".nif"
		Else
			Let CompPatch := "clutter\Booze\BEER!bottle" + CompPatch + ".nif"
		EndIf
		
		If Eval ( Path == CompPatch )
			Set BottleType to 1
			Break
		EndIf
		Set BeerTurnCOBL to BeerTurnCOBL + 1
	Loop
	
	Let CompPatch := ToString "Clutter\AleBottle.NIF"
	If Eval ( Path == CompPatch )
		Set BottleType to 1
	EndIf
	
	Let CompPatch := ToString "Clutter\BeerBottle.NIF"
	If Eval ( Path == CompPatch )
		Set BottleType to 1
	EndIf
	
	Let CompPatch := ToString "Clutter\MeadBottle.NIF"
	If Eval ( Path == CompPatch )
		Set BottleType to 1
	EndIf

	Let CompPatch := ToString "clutter\milkbottle.nif"
	If Eval ( Path == CompPatch )
		Set BottleType to 4
	EndIf
	
	Let CompPatch := ToString "clutter\Booze\BEER!Mead.nif"
	If Eval ( Path == CompPatch )
		Set BottleType to 1
	EndIf
	
	Let CompPatch := ToString "clutter\Booze\BEER!Cider.nif"
	If Eval ( Path == CompPatch )
		Set BottleType to 1
	EndIf
	
	Let CompPatch := ToString "Clutter\winebottle01.NIF"
	If Eval ( Path == CompPatch )
		Set BottleType to 2
	EndIf
	
	Let CompPatch := ToString "Clutter\winebottle02.NIF"
	If Eval ( Path == CompPatch )
		Set BottleType to 3
	EndIf
	
	Let CompPatch := ToString "Clutter\winebottle03.NIF"
	If Eval ( Path == CompPatch )
		Set BottleType to 2
	EndIf

	If ( BottleType == 0 )
		Goto 0
	EndIf 
	
	Set PekFillRackRef.BottleType to BottleType
	Set PekFillRackRef.BottleRef to BottleRef

End
				


So what and where did the script stop to wor and which script? It was the function script that stopped to work and it stopped right after the

Set BottleBaseRef to BottleRef.GetBaseObject

in the previous post. Why did I try to do that? Well it was the bloody Skooma that confused me. Why did the script not find it? Well because it was added by WAC. :wink: It also means that it is not possible to make a getBaseObject to something inside a container and it is the base object anyway that we see inside containers, so I did waste my time there. But imagine you do check for Skooma as you do not want it added in the rack and still it gets added and it did bother me a lot.

So why do I not want Skooma added? It is more a choice of what looks good really. That bottle is so tiny and doesn't fit properly as it looks weird, nothing else.

Edited by Pellape
Link to comment
Share on other sites

I do have other problems now. My Mark and Recall scripts behave odd in SE and in Kvatch Rebuilt. I have changed the Xmarker that is moved to the player when marking from a XmarkerHeading to a rat that gets disabled, exactly as the Advanced Mark and Recall but my scripts differs a lot from those in Advanced Mark and Recall. So to make it short. When I mark in Kvatch or in SE, I get a loading screen popping up that freezes... :/

Link to comment
Share on other sites

I think I know what the problem is with the Mark spell and it is that I try to mark within the spell, during the magi effect by calling a function. I will remake them and let it go a couple of frames during the process as now when I use rats as markers, I need to enable them, let it go a frame, move them, let it go a frame and then disable them. In the Advanced Mark and Recall mod, the author enable and disable them within the same frame and that never work properly.

 

Another thing I have to peek at is my SI function, which is called when marking, making the SI settings and they do not work properly as well, even if I did copy the code from the SI portal, there's something I did screw up. I notice this when I try to use the Haskil Spell that Sheogorath gives you as I get a message that I need to be in SI to use it. So when Haskil works properly, I know I did it right.

Link to comment
Share on other sites

Finally - The Mark and Recall spell works perfect now after I have scratched my head for 7 hours and I remade it a lot.

  • Deleted the function that was called inside Effect Update and moved that code to the quest script that gets activated first during the ScriptEffectFinish, so the spell gets dispelled first.
  • Deleted a Trigger box that was supposed to move the player when triggered
  • Took the game invisible Collision box and made it into an activator so this is what you activate :D

The collisions doesn't get updated when the gates move and the collision box is very advanced, so the gate is only there to look pretty now as it is the collision box that you activate. :) Damn I am so happy now that I can burst.

 

So it was 2 problems really. Trigger boxes are nasty as they loop when triggered, even when you leave them and you do not want to end up in a loop when you try to teleport for sure, so no wonder I got problems when I got into such loop during a ScriptEffectUpdate that do loop in itself -> Double loops...

Link to comment
Share on other sites

Even if the SI check seems to work, I do not trust it to run 100%, well only 99.98%, so I added an extra check.

 

17 seconds after you arrive at your destination, the last check is done and makes all necessary settings for SI or Tamriel so the crime and quest settings gets right and the code is of course copied from the original gates to and from SI. This check is started from the Recall/Mark quest as soon as you spawn the portal, not when you enter it so even if you decide to not use the portal, the check is done anyway, which does not hurt and the check is also done when you use the portals.

 

I also added the new check to the Ladder out and to the Recall to Companion spell.

Edited by Pellape
Link to comment
Share on other sites

Renaming Slots

When you mark at some spots, you get a common name or just a slot named to <No Name>, specially out in the world or at the SI gate as another example and we cannot have recall menus looking like that as you will forget where that bloody spot really was sooner or later so I am making a script right now that will allow you to rename every spot in your menus and it will be available in the house settings and is a quest.

 

I might add a spell later that allow you to change house settings where ever you are, specially if you are far from home and wants to rename a slot NOW or make other changes. :wink:

Edited by Pellape
Link to comment
Share on other sites

It is always thrilling to start the game, both in a good way but also not, after a whole day of coding, specially if you made loads of scripts to see if they actually are working as planned, as you might have created lots of new bugs and that makes me a bit nervous and anxious for sure.

 

I just started the game and everything works just fine :D

  • House Settings is now a quest
  • A spell is made called House Settings
  • The rename spell works perfect

I did forget to add a $ at one spot, but that was the only bug I made as it must be added inside a OpentextInput $String so all I got was MessageBox with

 

String

[Finnished]

 

..which was fixed fast...

Link to comment
Share on other sites

To be really sure you are in Tamriel or in Shivering Isles, I added a possibility to correct it in the House Settings. The function GetPlayerInSEWorld does not seems to check if the player really is there or not as it only reads what is set with SetPlayerInSEWorld so this setting lets you decide where the player really is and all crime settings will be set correct.

Link to comment
Share on other sites

I remade the quest to find the Hobbit Home and made it more In Character, well in a more RP style fashion which was only possible to do now when I know the story behind the Home and the former Lord, Goblum. Later on I might do a quest story around him.

 

I also rewrote some text in the books, making them also more RP but I had to leave an OOC (Out of Character) section inside one of the books bit hopefully they will help to build up the immersion I wish the player to have in the Hobbit Home.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.

×
×
  • Create New...