Jump to content

hello again. I'm having a ltitle bit of trouble with a script in my mod. would anyone like to help?


JaytheCub

Recommended Posts

For starters i am trying to make a mod which you raise a Baby Gecko from a hatchling to a full-grown Gecko!! however i seem to run into a bit of an issue with how i approached this and made the scripts that coincide with it.

 

i modeled most of what i did based on the Baby Deathclaw commander 2 mod in their scripts usually just replacing what "Deathclaw" would be "Gecko" for me.

 

however when i checked the GECK WIKI it says "player.getlos is "get line of sight" apparently this is how the Deathclaw commander mod determines when to swap models but now my mod seems to constantly switching models everytime the player looks away from their little Gecko hatchling.

 

Of course i have another problem as well. For starters i tried to make a "Choice selection" in a menu (showmessage) and the player will select their choice of "Adult Gecko" From a range of "Fire" "Poison" "and "Golden" and "Regular" geckos. however this doesn't seem to be working?

 

here is the "control script" for the Baby Gecko Commander mod....

 

scn BabyGeckoControlSCRIPT

short GeckoHired
short GeckoFired
short GeckoHasBeenHired
short GeckoName

short GeckoHungry
short TrackGameHour
float GeckoSize
short GeckoStrength
short GeckoHealth

short SwapModels

short GeckoMidHired
short GeckoMidFired
short GeckoAdultHired
short GeckoAdultFired
short GeckoAdultFireHired
short GeckoAdultFireFired
short GeckoAdultGoldenHired
short GeckoAdultGoldenFired
short GeckoAdultPoisonHired
short GeckoAdultPoisonFired

short postcombat

short HungryAdvisory
short TheGameHour

short FoundStealthBoy
short HasStealthBoy
ref CurrentRef
short InventoryStealthBoy
short counter
short StealthBoyOn 
short RandomNum
short MoveToMe
short MoveTimer
short Btn
short MenuID 

begin gamemode
	if MoveToMe 
		if MoveToMe == 1
			set MoveTimer to GetSecondsPassed
			set MoveToMe to 2
		else
			set movetimer to movetimer + GetSecondsPassed
			if MoveTimer >= 10
				if GeckoHired
					BabyGInfantREF.moveto player 
				elseif GeckoMidHired
					BabyGAdolescentREF.moveto player
				elseif GeckoAdultHired
					BabyGAdultREF.moveto player
				elseif GeckoAdultFireHired
					BabyGAdultFireREF.moveto player
				elseif GeckoAdultGoldenHired 
					BabyGAdultGoldenREF.moveto player
				elseif GeckoAdultPoisonHired
					BabyGAdultPoisonREF.moveto player
				endif
				set movetimer to 0 
				set MoveToMe to 0
			endif
		endif
	endif


;Gecko who ate stealthboy ahs stealthboy symptoms in stealth
	if HasStealthBoy 
		if GeckoHired
			set CurrentREF to BabyGInfantREF
		elseif GeckoMidHired 
			set CurrentREF to BabyGAdolescentREF
		elseif GeckoAdultHired
			set CurrentREF to BabyGAdultREF
		elseif GeckoAdultFireHired
			set CurrentREF to BabyGAdultFireREF
		elseif GeckoAdultGoldenHired
			set CurrentREF To BabyGAdultGoldenREF
		elseif GeckoAdultPoisonHired
			set CurrentREF to BabyGAdultPoisonREF
		endif


		if getobjectivecompleted BABYGECKOCLOAK1 2 != 1
			if Player.IsSneaking == 1 && Player.IsInCombat == 0 
				CurrentREF.PMS NightkinCloakFXShader 1
				CurrentREF.AddSpell StealthBoyInvisibilitySpell
			else
				CurrentREF.PMS NightkinCloakFXShader 1
				CurrentREF.dispel StealthBoyInvisibilitySpell
			endif
		endif
	endif
;----------------------------------------------------------------------------



;Gecko eats stealth boy in front of player
	if HasStealthBoy
	else
		if FoundStealthBoy 
			if FoundStealthBoy == 3
				setquestdelay BabyGeckoControlQUEST 1 
				if GeckoHired
					set CurrentREF to BabyGInfantREF
				elseif GeckoMidHired 
					set CurrentREF to BabyGAdolescentREF
				elseif GeckoAdultHired 
					set CurrentREF to BabyGAdultREF
				elseif GeckoAdultFireHired 
					set CurrentREF to BabyGAdultFireREF
				elseif GeckoAdultGoldenHired
					set CurrentREF to BabyGAdultGoldenREF
				elseif GeckoAdultPoisonHired
					set CurrentREF to BabyGAdultPoisonREF
				endif
				set FoundStealthBoy to 4
			elseif FoundStealthBoy == 4
				player.playsound NPCGeckoChomp 
				set FoundStealthBoy to 5
			elseif FoundStealthBoy == 5
				CurrentREF.PlaySound3D ObjStealthBoyActivate
				CurrentREF.PMS NightkinCloakFXShader 1
				set FoundStealthBoy to 6
			elseif FoundStealthBoy == 6
				CurrentREF.AddSpell StealthBoyInvisibilitySpell 
				set FoundStealthBoy to 7
			elseif FoundStealthBoy > 6 && FoundStealthBoy < 12 
				set FoundStealthBoy to FoundStealthBoy + 1
			elseif FoundStealthBoy == 12
				CurrentREF.dispel STealthBoyInvisibilitySpell
				CurrentREF.PMS NightkinCloakFXShader 1
				set FoundStealthBoy to -1
				set HasStealthBoy to 1
				setquestdelay BabyGeckoControlQUEST 5
				setobjectivedisplayed BabyGeckoControlQuest 35 1
				setstage BabyGeckoControlQUEST 35
			endif
		endif
	endif
;---------------------------------------------------------------------------------

;Swap to new REFs
	
	if BabyGeckoControlQUEST.GeckoHired
		if playerref.getlos BabyGInfantREF	
		else
			set swapmodels to 0 
			
			BabyGAdolescentREF.Enable
			BabyGAdolescentREF.MoveTo BabyGInfantREF
			set BabyGAdolescentREF.FreshHire to 1
			
			BabyGInfantREF.MoveTo BabyGeckoHomeREF 
			set GeckoFired to 1
			set GeckoHired to 0
			BabyGInfantREF.RemoveFromFaction FollowerFaction
			BabyGInfantREF.RemoveFromFaction TeammateFaction
			BabyGInfantREF.SetPlayerTeammate 0 
			setobjectivedisplayed BabyGeckoControlqUEST 10 0
			if BabyGInfantREF.Waiting
				set BabyGAdolescentREF.Waiting to 1
			endif
			set BabyGInfantREF.Waiting to 0
			BabyGInfantREF.Disable

			set GeckoMidHired to 1
			BabyGAdolescentREF.AddToFaction FollowerFaction 1
			BabyGAdolescentREF.AddToFaction TeammateFaction 1
			BabyGAdolescentREF.SetPlayerTeammate 1
			BabyGInfantREF.SetAV Confidence 2
		endif
	endif
	
	if BabyGeckoControlQUEST.GeckoMidHired
		if playerref.getlos BabyGAdolescentREF
		else
			set MenuID to 1
			showmessage BabyGGeckoChoiceAdultList
		endif
	endif	

	;Adult Choices to pick from when the adolescent grows up to a "Young Alpha Gecko"
	if MenuID == 1
		if Btn == -1 
			return
		elseif Btn == 0 
			set swapmodels to 0 
			
			BabyGAdultREF.Enable
			BabyGAdultREF.MoveTo BabyGAdolescentREF
			set BabyGAdultREF.FreshHire to 1
			
			BabyGAdolescentREF.moveto BabyGeckoHomeREF
			set GeckoMidHired to 0
			set GeckoMidFired to 1
			BabyGAdolescentREF.RemoveFromFaction FollowerFaction
			BabyGAdolescentREF.RemoveFromFaction TeammateFaction	
			BabyGAdolescentREF.SetPlayerTeammate 0 
			SetObjectiveDisplayed BabyGeckoControlQUEST 20 0 
			if BabyGAdolescentREF.Waiting 
				set BabyGAdultREF.Waiting to 1
			endif
			set GeckoAdultHired to 1
			BabyGAdultREF.AddToFaction FollowerFaction 1
			BabyGAdultREF.AddtoFaction TeammateFaction 1
			BabyGAdultREF.SetPlayerTeammate 1
		elseif Btn == 1
			set swapmodels to 0
			
			BabyGAdultFireREF.Enable
			BabyGAdultFireREF.MoveTo BabyGAdolescentREF
			set BabyGAdultFireREF.FreshHire to 1
			
			BabyGAdolescentREF.moveto BabyGeckoHomeREF
			set GeckoMidHired to 0
			set GeckoMidFired to 1
			BabyGAdolescentREF.RemoveFromFaction FollowerFaction
			BabyGAdolescentREF.RemoveFromFaction TeammateFaction	
			BabyGAdolescentREF.SetPlayerTeammate 0 
			SetObjectiveDisplayed BabyGeckoControlQUEST 20 0 
			if BabyGAdolescentREF.Waiting 
				set BabyGAdultFireREF.Waiting to 1
			endif
			
			Set GeckoAdultFireHired to 1
			BabyGAdultFireREF.AddToFaction FollowerFaction 1
			BabyGAdultFireREF.AddtoFaction TeammateFaction 1
			BabyGAdultFireREF.SetPlayerTeammate 1
		elseif Btn == 2
			set swapmodels to 0
			
			BabyGAdultPoisonREF.Enable
			BabyGAdultPoisonREF.MoveTo BabyGAdolescentREF
			set BabyGAdultPoisonREF.FreshHire to 1	
			
			BabyGAdolescentREF.moveto BabyGeckoHomeREF
			set GeckoMidHired to 0
			set GeckoMidFired to 1
			BabyGAdolescentREF.RemoveFromFaction FollowerFaction
			BabyGAdolescentREF.RemoveFromFaction TeammateFaction	
			BabyGAdolescentREF.SetPlayerTeammate 0 
			SetObjectiveDisplayed BabyGeckoControlQUEST 20 0 
			if BabyGAdolescentREF.Waiting 
				set BabyGAdultPoisonREF.Waiting to 1
			endif
			
			set GeckoAdultPoisonHired to 1
			BabyGAdultPoisonREF.AddToFaction FollowerFaction 1
			BabyGAdultPoisonREF.AddtoFaction TeammateFaction 1
			BabyGAdultPoisonREF.SetPlayerTeammate 1
		elseif Btn == 3
			set swapmodels to 0 
			
			BabyGAdultGoldenREF.Enable
			BabyGAdultGoldenREF.MoveTo BabyGAdolescentREF
			set BabyGAdultGoldenREF.FreshHire to 1
				
			BabyGAdolescentREF.moveto BabyGeckoHomeREF
			set GeckoMidHired to 0
			set GeckoMidFired to 1
			BabyGAdolescentREF.RemoveFromFaction FollowerFaction
			BabyGAdolescentREF.RemoveFromFaction TeammateFaction	
			BabyGAdolescentREF.SetPlayerTeammate 0 
			SetObjectiveDisplayed BabyGeckoControlQUEST 20 0 
			if BabyGAdolescentREF.Waiting 
				set BabyGAdultGoldenREF.Waiting to 1
			endif


			set GeckoAdultGoldenHired to 1
			BabyGAdultGoldenREF.AddtoFaction FollowerFaction 1
			BabyGAdultGoldenREF.AddtoFaction TeammateFaction 1
			BabyGAdultGoldenREF.SetPlayerTeammate 1
		endif
	endif
	
	

; all geckos versions hunger timer 
	
	if GeckoHired || GeckoMidHired
		if playerref.isincombat
		else
			if swapmodels
			else
				set TheGameHour to gamehour 
				if GeckoHungry
				else
					if TrackGameHour > TheGameHour 
						set TrackGameHour to TheGameHour - 1
					endif
					if TheGameHour > TrackGameHour 
						set TrackGameHour to TheGameHour
						Set GeckoHungry to 1
						if HungryAdvisory == 0 
							showmessage BabyGHungry
							set HungryAdvisory to 1	
						endif
					endif
				endif
			endif
		endif
	endif


;if gecko followers allowed idles after combat but only 5-10 seconds.

	if postcombat
		if postcombat == -1
			set postcombat to 2
		else
			set postcombat to 0
			if GeckoHired
				BabyGInfantREF.EVP 
				BabyGInfantREF.Playgroup idle 1
			elseif GeckoMidHired
				BabyGAdolescentREF.EVP 
				BabyGAdolescentREF.PlayGroup idle 1
			elseif GeckoAdultHired
				BabyGAdultREF.EVP 
				BabyGAdultREF.PlayGroup Idle 1
			elseif GeckoAdultFireHired
				BabyGAdultFireREF.EVP
				BabyGAdultFireREF.PlayGroup Idle 1
			elseif GeckoAdultPoisonHired
				BabyGAdultPoisonREF.EVP
				BabyGAdultPoisonREF.PlayGroup Idle 1
			elseif GeckoAdultGoldenHired
				BabyGAdultGoldenREF.EVP
				BabyGAdultGoldenREF.PlayGroup Idle 1
			endif	
		endif
	endif


;Young Alpha GECKO 
	if BabyGeckoControlQUEST.GeckoAdultHired
		
		if playerref.isincombat
		else
			if FoundStealthBoy == 15
				set FoundStealthBoy to 2
				BabyGAdultREF.EVP
				return
			endif	
			
			if BabyGAdultREF.GetItemCount StealthBoy 
				if HasStealthBoy
				else
					if FoundStealthBoy
					else
						set InventoryStealthBoy to 1
						BabyGAdultREF.Removeitem stealthBoy 1
						BabyGAdultREF.RemoveAllItems Player 
						Set FoundStealthBoy to 15 
						BabyGAdultREF.EVP 
						return 
					endif
				endif
			endif
		endif	
	endif


; Young Alpha Fire Gecko 
	if BabyGeckoControlQUEST.GeckoAdultFireHired
		if playerref.isincombat
		else
			if FoundStealthBoy == 15
				Set FoundStealthBoy to 2
				BabyGAdultFireREF.EVP
				return
			endif
			
			if BabyGAdultFireREF.GetItemCount StealthBoy 
				if HasStealthBoy 
				else
					if FoundStealthBoy
					else
						set inventoryStealthboy to 1
						BabyGAdultFireREF.RemoveItem StealthBoy 1
						BabyGAdultFireREF.RemoveallItems Player
						Set FoundStealthBoy to 15
						BabyGAdultFireREF.EVP
						return	
					endif	
				endif
			endif
		endif
	endif


; young alpha Green Gecko 
	if BabyGeckoControlQUEST.GeckoAdultPoisonHired
		if playerref.isincombat
		else
			if FoundStealthBoy == 15
				set FoundStealthboy to 2
				BabyGAdultPoisonREF.EVP
				return
			endif
			
			if BabyGAdultPoisonREF.GetItemCount StealthBoy
				if HasStealthBoy
				else
					if FoundStealthBoy
					else
						set InventoryStealthboy to 1
						BabyGAdultPoisonREF.RemoveItem StealthBoy 1
						BabyGAdultPoisonREF.RemoveallItems Player
						Set FoundStealthBoy to 15  
						BabyGAdultPoisonREF.EVP
						return
					endif
				endif
			endif
		endif
	endif


; young alpha golden gecko 
	if BabyGeckoControlQUEST.GeckoAdultGoldenHired
		if playerref.isincombat
		else
			if FoundStealthBoy == 15
				Set FoundStealthBoy to 2
				BabyGAdultGoldenREF.EVP
				return
			endif

			if BabyGAdultGoldenREF.GetItemCount StealthBoy 
				if HasStealthBoy
				else
					if FoundStealthBoy 
					else
						set InventoryStealthboy to 1
						BabyGAdultGoldenREF.RemoveItem StealthBoy 1
						BabyGAdultGoldenREF.RemoveallItems Player
						set FoundStealthBoy to 15
						BabyGAdultGoldenREF.EVP
						return
					endif
				endif
			endif
		endif
	endif



	; Adolescent Gecko 
	if BabyGeckoControlQUEST.GeckoMidHired
		if playerref.isincombat
		else
			
			if FoundStealthBoy == 15
				set FoundStealthBoy to 2
				BabyGAdolescentREF.EVP
				return
			endif
			
			if BabyGAdolescentREF.GetItemCount StealthBoy 
				if HasStealthBoy
				else
					if FoundStealthBoy
					else	
						set InventoryStealthboy to 1
						BabyGAdolescentREF.RemoveItem StealthBoy 1
						BabyGAdolescentREF.RemoveAllItems Player
						Set FoundStealthboy to 15
						return
					endif
				endif
			endif

			if SwapModels 
			else
				set swapmodels to 1
				set GeckoHungry to 0
			endif
			
			if BabyGAdolescentREF.GetItemCount Everything || BabyGAdolescentREF.GetItemCount BabyGMissingEverything
				if GeckoHungry
					if BabyGAdolescentREF.GetItemCount MeatFood || BabyGAdolescentREF.GetItemCount BabyGMiscFoodLIST 
						set GeckoSize to BabyGAdolescentREF.GetScale 
						Set GeckoHungry to 0
						set HungryAdvisory to 0
						set TheGameHour to gamehour 
						Set TrackGameHour to TheGameHour 
						BabyGAdolescentREF.RemoveItem BabyGMiscFoodLIST 1
						BabyGAdolescentREF.RemoveItem MeatFood 1
						BabyGAdolescentREF.PlaySound3D NPCGeckoChomp

						set GeckoSize to GeckoSize + 0.05
						BabyGAdolescentREF.SetScale GeckoSize
						set GeckoStrength to GeckoSize * 10
						Set GeckoHealth to GeckoStrength * 50
						BabyGAdolescentREF.SetAV Strength GeckoStrength
						BabyGAdolescentREF.SetAV Health GeckoHealth
					endif
				else
					showmessage BabyGFoodRefuse
				endif
				BabyGAdolescentREF.RemoveallItems Player
			endif
		endif
	endif



	; Infant Gecko
	if BabyGeckoControlQUEST.GeckoHired
		if playerref.isincombat
		else
			
			if FoundStealthBoy == 15
				set FoundStealthBoy to 2
				BabyGInfantREF.EVP
				return
			endif
			
			if BabyGInfantREF.GetItemCount StealthBoy 
				if HasStealthBoy
				else
					if FoundStealthBoy
					else	
						set InventoryStealthboy to 1
						BabyGInfantREF.RemoveItem StealthBoy 1
						BabyGInfantREF.RemoveAllItems Player
						Set FoundStealthboy to 15
						return
					endif
				endif
			endif

			if SwapModels 
			else
				set swapmodels to 1
				set GeckoHungry to 0
			endif
			
			if BabyGInfantREF.GetItemCount Everything || BabyGInfantREF.GetItemCount BabyGMissingEverything
				if GeckoHungry
					if BabyGInfantREF.GetItemCount MeatFood || BabyGInfantREF.GetItemCount BabyGMiscFoodLIST 
						set GeckoSize to BabyGInfantREF.GetScale 
						Set GeckoHungry to 0
						set HungryAdvisory to 0
						set TheGameHour to gamehour 
						Set TrackGameHour to TheGameHour 
						BabyGInfantREF.RemoveItem BabyGMiscFoodLIST 1
						BabyGInfantREF.RemoveItem MeatFood 1
						BabyGInfantREF.PlaySound3D NPCGeckoChomp

						set GeckoSize to GeckoSize + 0.05
						BabyGInfantREF.SetScale GeckoSize
						set GeckoStrength to GeckoSize * 10
						Set GeckoHealth to GeckoStrength * 50
						BabyGInfantREF.SetAV Strength GeckoStrength
						BabyGInfantREF.SetAV Health GeckoHealth
					endif
				else
					showmessage BabyGFoodRefuse
				endif
				BabyGInfantREF.RemoveallItems Player
			endif
		endif
	endif

	
end

 

As you can see i finally got it into a 'functional' state to test things but testing isn't going too well right now. the other issue seems to be the Gecko isn't getting hungry i waited a few hours it seems like its not getting hungry no matter how long i wait or something.

 

basically whenever i would go into the game and "look away" from the gecko hatchling he will theoretically "Age up" and swap models and then when i look back i see the "Adult model" separately spawned and they keep respawning over and over! this is not good.

 

edit: Well i got the hunger things working just fine. the geck is getting hungry now. But still having problems with the Swapping models and choices you pick from a message box menu.... of course i think the problem was that i didn't put "swapmodels" as a proper if value so i needed to fix that and i did but still having issues aside from that.

 

edit 2: Okay so i got the "Adult models" working now however the menu is appearing too soon for some reason and regularly keeps appearing for some reason plus the Adolescent Model keeps reappearing whenever the adult model is selected. And as well sometimes when i go to "Talk" to my Gecko pet thing it just glitches out and i go invisible despite having plenty of dialogue options available. Any ideas?

Edited by JaytheCub
Link to comment
Share on other sites

NEVERMIND I think i got it now. The gecko seems to be working but now the main problem is it keeps progressing very fast whenever you first grab the egg and then swaps models for Baby>Adolescent>then immediately for one of the Adult Models (Player's choice btw)

 

so it brings up the messagebox after you feed the Gecko baby only once and then turn around and it starts "Swapping models" it might have something to do with how fast it is growing in size and or something because i think the way its set up in script now it has to do with that. Ima keep toying with it until i get it to give a decent length of time while its a Baby>Adolescent>and then one of the Adult models as its final model. wish me luck.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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