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...

General Script Questions #1


WillieSea
 Share

Recommended Posts

Are the 2 guards unique? Do they have a Reference ID on them? If so, what are they?

Oh, and don't worry about my aggro. :) I just find it easier to take it one step at a time.

They are KHSwitchGuard01 & KHSwitchGuard02

BTW the other thing I forgot (dumby I am) is the switch is parented to the wall,.. so I guess I take out the wall enable line a?

Incase it helps

KHMagicPortalRef is paortal ref

KHTelanRef is telen

the 2 guards where no linked in any way thery where just in the way lol (between PC and the switch) and 100% aggro

Edited by Kiwi-Hawk
  • Upvote 1
Link to comment
Share on other sites

Put this on the first claw lever and see what happens.

scn KHPortalDoorClawSwitch01 
; Activates Portal door and Telan
float EffectTime02
short Busy
Short DoOnce

begin OnActivate
if Busy == 0
if KHSwitchGuard01.GetDead && KHSwitchGuard02.GetDead
if KHMagicPortalRef.GetDisabled == 1 && DoOnce == 0
if player.getitemcount KHDragonEgg01 >= 1
playgroup forward 0
set Busy to 1
else
messagebox " Seems to be somit missing "
set Busy to 0
endif
else
messagebox " The lever does nothing more... "
endif
else
messagebox " A guard still lives! "
endif
endif
end

begin Gamemode
if IsAnimPlaying == 0 && busy == 2
set Busy to 0
endif
if Busy == 1
set EffectTime02 to (EffectTime02 + GetSecondsPassed)
if EffectTime02 >= 1
KHMagicPortalRef.Enable
KHTelanRef.Enable
KHSecretwallRef.Disable
message " something just happened, what was it? "
set DoOnce to 1
set Busy to 2
endif
endif
end[/code]

Link to comment
Share on other sites

Kia Ora

That works like a charm thank you very much,...

Maybe my missatke is checking to hard



scn KHTriggerShrinePowerScr


short triggered

short next

short busy

short opened

Float PowerTrig



begin onTrigger Player


		if Triggered == 0 && player.getitemcount AncientWarlockScroll01 == 0

			return

			if player.getitemcount AncientWarlockScroll01 >= 1

				set PowerTrig to (PowerTrig + getsecondspassed)

					if ( PowerTrig >= 2 ) 

						KHLightingEnergy05Ref.enable

							KHLightingEnergy06Ref.enable

								if ( PowerTrig >= 10 )

									KHLightingEnergy03Ref.enable

										KHLightingEnergy04Ref.enable

 								      if PowerTrig >= 20

 							       Message  " Ooops,.  I've activated some Power source by the looks "

							set triggered to 1

						set next to 1

					endif

				endif

			endif

		endif

	endif

end


Begin Gamemode


	if KHLightingEnergy01.GetDisabled == 1 && KHLightingEnergy02.GetDisabled == 1  ; DO I NEED THIS LINE AT ALL?

		if busy == 1 && isAnimPlaying == 0

			set busy to 0

		endif

	endif

end




  • Upvote 1
Link to comment
Share on other sites

Kia Ora

That works like a charm thank you very much,...

Maybe my missatke is checking to hard



scn KHTriggerShrinePowerScr


short triggered

short next

short busy

short opened

Float PowerTrig



begin onTrigger Player


		if Triggered == 0 && player.getitemcount AncientWarlockScroll01 == 0

			return

			if player.getitemcount AncientWarlockScroll01 >= 1

				set PowerTrig to (PowerTrig + getsecondspassed)

					if ( PowerTrig >= 2 ) 

						KHLightingEnergy05Ref.enable

							KHLightingEnergy06Ref.enable

								if ( PowerTrig >= 10 )

									KHLightingEnergy03Ref.enable

										KHLightingEnergy04Ref.enable

 								      if PowerTrig >= 20

 							       Message  " Ooops,.  I've activated some Power source by the looks "

							set triggered to 1

						set next to 1

					endif

				endif

			endif

		endif

	endif

end


Begin Gamemode


	if KHLightingEnergy01.GetDisabled == 1 && KHLightingEnergy02.GetDisabled == 1  ; DO I NEED THIS LINE AT ALL?

		if busy == 1 && isAnimPlaying == 0

			set busy to 0

		endif

	endif

end




  • Upvote 1
Link to comment
Share on other sites

After fighting Telen and using the Portal to get to a lower level to enter the last area and the Boss fight is over (area is cleared out)

This is the triggbox script to trigger the 4 pillars

...so what you are saying is (and looking at the script)

1) The player needs the "AncientWarlockScroll01" object.

2) There is a delay in the lights enabling.

After 2 seconds, 05 and 06 enable. After 10 seconds, 03 and 04 enable. After 20 seconds, you get a message.

TriggerBox Script

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

scn KHTriggerShrinePowerScr
short triggered
short next
Float PowerTrig

begin onTrigger Player
if triggered == 0
if player.getitemcount AncientWarlockScroll01 >= 1
set triggered to 1
endif
endif
end

Begin Gamemode
if triggered == 1
set PowerTrig to ( PowerTrig + getsecondspassed )
if ( PowerTrig >= 20 )
Message " Ooops,. I've activated some Power source by the looks "
set triggered to 2
elseif ( PowerTrig >= 10 )
if next == 1
KHLightingEnergy03Ref.enable
KHLightingEnergy04Ref.enable
set next to 2
endif
elseif ( PowerTrig >= 2 )
if next == 0
KHLightingEnergy05Ref.enable
KHLightingEnergy06Ref.enable
set next to 1
endif
endif
endif
end[/code]

Link to comment
Share on other sites

Kia Ora

Thank you again,.. I'm trying to understand and get whats happing in each script,. not sure if I'm getting the logic tho

Last switch,.. only the activator left to do, that I won't be able to test yet

This just activates 2 power sources and the portal activator (As with the other switch because theyer set to allow opposites and parented to a disabled item they disapair when done) but they only need be used once so thats cool

The switch is parented to KHPortalActivatorRef,.. ( less you ask me not to) and PC needs both items, the egg and the scroll

KHTirasRef is last Boss

KHPortalActivatorRef is the portal Activator



scn KHActivatorClawSwitch01 


ref myParent 

ref mySelf 

float EffectTime01 

short Busy 

short DoOnce 


begin OnActivate

           if Busy == 0 

			playgroup forward 0 

				set myParent to GetParentRef 

					set mySelf to getSelf 

				myparent.activate mySelf 1 

			set Busy to 1

		set DoOnce to 1 

	endif

end 

begin Gamemode


	if KHTirasRef.GetDead

		if player.getitemcount KHDragonEgg01 == 0  && player.getitemcount AncientWarlockScroll01 == 0 

  		         	message  " Seems to be somit missing " 

		  		      elseif player.getitemcount KHDragonEgg01 >= 1  && player.getitemcount AncientWarlockScroll01 >= 1

						set EffectTime01 to (EffectTime01 + GetSecondsPassed)

							KHLightingEnergy01Ref.Enable

								KHLightingEnergy02Ref.Enable	 

							if EffectTime01 >= 10 

						KHPortalActivatorRef.enable 

					if IsAnimPlaying == 0

				set Busy to 0	

			endif

		endif

	endif

endif 

end


Edited by Kiwi-Hawk
  • Upvote 1
Link to comment
Share on other sites

If you dont get what the script is doing, then ask. I cannot always rewrite every script for you. :wub:

I would rather teach you how to fish rather than give you a fish.

I recommend you look at each line of my changed script. And keep track of what each 'variable' contains as you go through it, top to bottom, line by line.

Look at my IF/ELSEIF/ELSE/ENDIF tutorial since it appears you do not understand how those commands work completely.

I have been removing a lot of code from your scripts that are 'doing nothing'. Just copying a script that does 'close' to what you want is not always the best solution. You need to sit down and write out a list.

1) What do I need to accomplish?

2) What is 'everything' I want to be as requirements on the player for the action to happen?

3) Do I want it repeatable or only able to do it once?

4) What must the player do to initiate the action?

etc... You get the idea. You need to be clear on what you want to happen before you know how to code it. What has been frustrating for me is you have not been real clear on some of these points. I have been guessing by reading between the lines of what you ask for and what you scripted. And guessing from there what you are trying to accomplish.

I do not have time to look at the last script today, but I should after this weekend. That should be okay since you say your not ready to test it anyway. :woohoo:

Link to comment
Share on other sites

  • 2 weeks later...

Kia Ora

I been trying to work out why the last PowerLightening energy beams spark up as soon as I eneter the cell rather than needing to be triggered, I re visited my last Claw switch

and wondered if that might be doing it, tho that should not effect the trigger script right?

This line is spose to check theyer disabled

if (KHLightingEnergy01Ref.GetDisabled == 1 && KHLightingEnergy02Ref.GetDisabled == 1)



scn KHActivatorClawSwitch01 


ref myParent 

ref mySelf 

float EffectTime01 

short Busy 

short DoOnce 


begin OnActivate

           if Busy == 0 

			playgroup forward 0 

				set myParent to GetParentRef 

					set mySelf to getSelf 

				myparent.activate mySelf 1

			if KHTirasRef.GetDead

				if player.getitemcount KHDragonEgg01 == 0  && player.getitemcount AncientWarlockScroll01 == 0 

		     	   	message  " Seems to be somit missing " 

		  			      elseif player.getitemcount KHDragonEgg01 >= 1  && player.getitemcount AncientWarlockScroll01 >= 1

							set EffectTime01 to (EffectTime01 + GetSecondsPassed)

								if EffectTime01 >= 10

									message "Looks like I activated something"

										if EffectTime01 >= 8

											KHPortalActivatorRef.enable

										if EffectTime01 >= 2 

									KHLightingEnergy01Ref.Enable

								KHLightingEnergy02Ref.Enable	 

							set Busy to 1

						set DoOnce to 1 

					endif

				endif

			endif

		endif 

	endif

endif

end 

begin Gamemode


	if (KHLightingEnergy01Ref.GetDisabled == 1 && KHLightingEnergy02Ref.GetDisabled == 1)

		if IsAnimPlaying == 0

			set Busy to 0

		endif

	endif

end


they are not spose to be active untill activated either by walking through the trigger or using the switch

Am I writing my if timers the wrong way round? should the last be at first in the list like I have in this last script when checking timers?

  • Upvote 1
Link to comment
Share on other sites

1. OnActivate blocks only run one time per activation.

2. Timers require a GameMode block to work because of #1 above.

3. Use a 'tab' to correctly align your IF/ENDIF code. Take a look at my examples above.

4. In your GameMode block, there is no need to check the disabled state. Look at my example above for the script 'KHPortalDoorClawSwitch01'.

5. If it can be activated through a trigger zone, you will need a different script for that.

I will try to get to this in the next day or so to give you some time to look it over. Perhaps you can post some more information on what the requirements are. :rofl:

Link to comment
Share on other sites

Kia Ora

I am sorry if my English is confusing for you I guess my ole Kiwi English is a little different to what you use too, I will try harder

I based this on the first Claw switch,. I didn't need to use Tiras as a check but if it helps ok, but the player wouldn't get near switch while he lives

All this needs to do (when player uses switch) is activate the Energy beams slitly after activeing switch (a second or 2) after that it activates the Portal Activator (KHPortalActivatorRef)

then display a message to player, only happening when player uses the switch, the beams and activator are disabled till then



scn KHActivatorClawSwitch01 

; Activates Portal door 


float EffectTime01

short Busy 

Short DoOnce 


begin OnActivate 

	if Busy == 0

		if KHTirasRef.GetDead

			if KHPortalActivatorRef.GetDisabled == 1 &&  DoOnce == 0

                                if player.getitemcount KHDragonEgg01 >= 1  && player.getitemcount AncientWarlockScroll01 >= 1

                                        playgroup forward 0  

                                        set Busy to 1

                                else 

                                        message " Seems to be somit missing "

                                        set Busy to 0

                               endif 

			                else

               			         messagebox " Tiras still lives! "

                endif 

        endif

endif

end 


begin Gamemode 

        if IsAnimPlaying == 0 && busy == 2

                set Busy to 0

        endif

        if Busy == 1

                set EffectTime01 to (EffectTime01 + GetSecondsPassed)

                if EffectTime01 >= 10

				message "Looks like I activated something"

                if EffectTime01 >= 8

                        KHPortalActivatorRef.enable

                if EffectTime01 >= 2

				KHLightingEnergy01Ref.Enable

				KHLightingEnergy02Ref.Enable

                        set DoOnce to 1

                        set Busy to 2

                endif

        endif

endif

endif

end


I should have said the Trigger was a triggbox rather than leave it to the script title sorry.

It is a green Triggbox that is placed across the bottom of the steps leading up to the switch. All it has to do when the player walks through it is activate the first 2 beams

then say 4 seconds after activate the second 2 beams and after that (2 to 4 seconds) display the message. They are al disabled till the player walks through the triggbox.

Have I left you with any unanswered questions at all? Just to be clear its the "scn KHTriggerShrinePowerScr" I mean is the triggbox

  • Upvote 1
Link to comment
Share on other sites

The Claw switch 02:

scn KHActivatorClawSwitch02 
; Activates Portal door
float EffectTime01
short Busy
Short DoOnce

begin OnActivate
if Busy == 0
if DoOnce == 0
if KHTirasRef.GetDead
if KHPortalActivatorRef.GetDisabled == 1
if player.getitemcount KHDragonEgg01 >= 1 && player.getitemcount AncientWarlockScroll01 >= 1
playgroup forward 0
set Busy to 1
set DoOnce to 1
else
message " Seems to be somit missing "
set Busy to 0
endif
endif
else
messagebox " Tiras still lives! "
endif
endif
endif
end

begin Gamemode
if busy == 2
if IsAnimPlaying == 0
set Busy to 0
endif
elseif Busy == 1
set EffectTime01 to (EffectTime01 + GetSecondsPassed)
if EffectTime01 >= 10
message "Looks like I activated something"
set Busy to 2
elseif EffectTime01 >= 8
KHPortalActivatorRef.enable
elseif EffectTime01 >= 2
KHLightingEnergy01Ref.Enable
KHLightingEnergy02Ref.Enable
endif
endif
end[/code]

Link to comment
Share on other sites

Kia Ora

Thank you very much,.. you said earlier that the triggbox script if it was to be used in a Green Triggzone it would need to be changed, could this be why the

Power Lightening energy's in the "TriggerBox Script" & the "Claw switch 02" are lighting up as soon as I enter the cell rather than being off till the trigbox is tripped

and the switch is activated?

Link to comment
Share on other sites

Please describe what you want if this is wrong.

1) The trigger box must be activated.

2) AND the claw switch 02 must be activated.

3) ONLY then the power lights will activate.

4) Is there a certain order for which must be activated first?

Why must the trigger box be activated? Is it in a seperate location from the player getting to the claw script? Is it before or after the claw script?

Link to comment
Share on other sites

Kia Ora

The TrigZone is before at the base of the steps leading up to the switch the idea is that PC kills the boss then walks up the steps to switch setting off the triggzone enabling

those energy beams, then activates claw switch 02 enableing the last two energy beams and Portal door.

at this time those last 6 beams light up as soon as I enter the cell for some reason ( the 4 in Trigzone and the 2 in the claw switch)

Edit:

Sorry forgot to mention, the Triggzone is to enable the first two set of energy, with a slit delay, something like a second after trigger the first 2

and 2 or 3 seconds after the second 2, this is what we have:


scn KHTriggerShrinePowerScr

short triggered

short next

Float PowerTrig


begin onTrigger Player

        if triggered == 0

                if player.getitemcount AncientWarlockScroll01 >= 1

                        set triggered to 1

                endif

        endif

end


Begin Gamemode

        if triggered == 1

                set PowerTrig to ( PowerTrig + getsecondspassed )

                if ( PowerTrig >= 20 )

                        Message  " Ooops,.  I've activated some Power source by the looks "

                        set triggered to 2

                elseif ( PowerTrig >= 10 )

                        if next == 1

                                KHLightingEnergy03Ref.enable

                                KHLightingEnergy04Ref.enable

                                set next to 2

                        endif

                elseif ( PowerTrig >= 2 )

                        if next == 0

                                KHLightingEnergy05Ref.enable

                                KHLightingEnergy06Ref.enable

                                set next to 1

                        endif

                endif

        endif

end


I think you said it had to be different for a triggzone tho

Edited by Kiwi-Hawk
Link to comment
Share on other sites

Ok, there is the triggerzone script. I thought you were using an 'OnActivate' block in the triggerzone which would not work.

So...

1) triggerzone ENABLES the light beams as shown in the script.

2) claw swich which is After the triggerzone is then used to light up the last two lights and enable the portal.

Sometimes I have seen trigger zones 'go off' even when the player is not near them when the cell is loaded, so that might be the problem you are seeing. Are you sure you dont already have the 'AncientWarlockScroll01' in your inventory when you enter the cell the trigger zone is in?

Link to comment
Share on other sites

Ok, there is the triggerzone script. I thought you were using an 'OnActivate' block in the triggerzone which would not work.

So...

1) triggerzone ENABLES the light beams as shown in the script.

2) claw swich which is After the triggerzone is then used to light up the last two lights and enable the portal.

Sometimes I have seen trigger zones 'go off' even when the player is not near them when the cell is loaded, so that might be the problem you are seeing. Are you sure you dont already have the 'AncientWarlockScroll01' in your inventory when you enter the cell the trigger zone is in?

Not till I pick it up after clearing the way through the cell to the point where I kill the Dreugh and get the head that ports me up to where the scroll and the egg are.

I guess I could use Tiras dead or alive as a check so if hes alive they stay off? or do I need a GetDisabled == 0 or 1 check in thos last two scripts to make sure theyer off?

Link to comment
Share on other sites

I would use 'GetDead' in the trigger zone script.

Change this line:

if player.getitemcount AncientWarlockScroll01 >= 1

to:

if KHTirasRef.GetDead

I coc into cell and I did a tcl to get to where I could see and got some screenies

http://picasaweb.google.com/Kiwi.Hawk.NZ/TestShots#

I had done nothing no fight no items etc

it jus came to mind that Tiras is in that area could he trigger it? or a triggzones for PC only?

Edited by Kiwi-Hawk
Link to comment
Share on other sites

Not sure why but they are sparking up as soon as I coc,.. I added a couple of shots from CS hoping to show you more of the lay out

I don't either, unless you have another script somewhere that is enabling them. Or, you have not set them to be initially disabled in the first place.

Link to comment
Share on other sites

I don't either, unless you have another script somewhere that is enabling them. Or, you have not set them to be initially disabled in the first place.

Thank you so very very much,.. I found some parenting I had not taking out,.. apart from adjusting the timing in the triggzone ( I had them a wee bit to slow) it's looking real choice

Only one script to work out to finish this cell off and that is the one that activates two external Portal doorways and move the player outside to the bottom one. PC has fought all the challanges and has activated a means to get up to a floating city but this requires Onra's Tamriel.esp and the TWMP_Summerset.esp when he's finished so I'm not sure it's wise to do stuff linking to the outside using his unfinished esp's

Edited by Kiwi-Hawk
  • Upvote 1
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

×
×
  • Create New...