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

1. First script: If its not parented to anything, then you don't need the parentage code:

                set myParent to GetParentRef 

                set mySelf to getSelf 

                myparent.activate mySelf 1 

If its not doing anything when you activate the switch, then check these conditions:

a) KHLightingEnergy01Ref must be ENABLED.

b) KHLightingEnergy02Ref must be ENABLED.

c) If the player has a KHDragonEgg01 then you get a message, otherwise after an hour, the lights should enable. Two hours later the portal should enable. Resting or sleeping will NOT advance time in the script.

I think what you want is the lights to be 'disabled' at start, not 'enabled'. Change the == 0 to == 1.

2. Second script: Make the change I noted in the previous post and see if it works.

I only need say a minute to the first enable and maybe two till second,.. have I got my time that wrong,.. I thought that was counting seconds not minutes.

I swaped the head script around and I didn't get moved at all I am reading your tutorials too BTW my biggest problem at comming up to 62 is remembering what I read but

I'm having a go

Link to comment
Share on other sites

The 'hour' is a game hour. (with vanilla game timimg that is '60') A 'game minute' would be '1' which is pretty fast. If you want a real world minute, that should be around 30 I think.

For the second script, what object is the script on?

If its on the 'LandDreughHeadTrophy' object, then change the script to:

Scn KHMovetoMarker 
Short DoOnce

Begin OnAdd Player
If DoOnce == 1
Return
Else
Set DoOnce to 1
Player.MoveTo KHRockTopRef
EndIf
End[/code]

Link to comment
Share on other sites

Kia Ora

That head script works like a charm, thank you very much

I think I was making a mistake putting stuff under ingamemod,.. if PC has the item in bag then things happen as soon as PC enters the cell

not after the activation of a switch,trigger or button as I wish them to.

After doing some reading I have revisted my other scripts, the WallClawSwitch I changed the parenting so the LightenEnergy is parented to switch that way both can be linked right?

Also am I right in understanding that in:

if (KHLightingEnergy01.GetDisabled == 1 && KHLightingEnergy01.GetDisabled == 1) && player.getitemcount KHDragonEgg01 >= 1

if KHLightingEnergy01.GetDisabled == 1 && KHLightingEnergy01.GetDisabled == 1 && player.getitemcount KHDragonEgg01 >= 1

The Brackets would be done first or if all needs to be true have no brackets? so that when PC activates switch (carrying the egg) the LighteningEnergy's are enabled.

No egg nothing happens and PC gets that message that somit is missing

I have changed my script to the following in the hope it only works once when the switch is activated



scn KHActivatorClawSwitch01 


ref myParent 

ref mySelf 

Short EffectTime01 

short Busy 

short DoOnce 


begin OnActivate

			set DoOnce to 0 

			set EffectTime01 to 0 

			set DoOnce to 0 

           if Busy == 0 

                        playgroup forward 0 

                        set myParent to GetParentRef 

                        set mySelf to getSelf 

                        myparent.activate mySelf 1 

                        set Busy to 1 

		if  (KHLightingEnergy01.GetDisabled == 1 && KHLightingEnergy01.GetDisabled == 1) &&  player.getitemcount KHDragonEgg01 <= 0  

  		         	messagebox " Seems to be somit missing " 

		  		      elseif (KHLightingEnergy01.GetDisabled == 1 && KHLightingEnergy01.GetDisabled == 1) &&  player.getitemcount KHDragonEgg01 >= 1  

 			         	      set EffectTime01 to (EffectTime01 + GetSecondsPassed) 

				                if EffectTime01 >= 10 

 			                         KHPortalActivatorRef.enable 

                                set DoOnce to 1 

                        endif 

                endif 

        endif 

endif

end 

begin Gamemode


	if IsAnimPlaying == 0

		set Busy to 0	

	endif

end


And my Trigger Script to, taking out the disable bit as PC will sortly leave the cell


scn KHTriggerShrinePowerScr


short triggered

short next

short busy

short opened

Short PowerTrig



begin onTrigger player

		set PowerTrig to 0

		 if  (KHLightingEnergy01.GetDisabled == 1 && KHLightingEnergy02.GetDisabled == 1) &&  player.getitemcount KHDragonEgg01 <= 0 

			messagebox " Seems to be somit missing "

			elseif (KHLightingEnergy01.GetDisabled == 1 && KHLightingEnergy02.GetDisabled == 1)  player.getitemcount KHDragonEgg01 >= 1

	set PowerTrig to (PowerTrig + getsecondspassed)

			if ( PowerTrig >= 10 ) 

				set triggered to 1

				KHLightingEnergy05Ref.enable

				KHLightingEnergy06Ref.enable

			if ( PowerTrig >= 30 )

				KHLightingEnergy03Ref.enable

				KHLightingEnergy04Ref.enable

       if triggered == 1 && PowerTrig >= 60

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

			set next to 1

			endif

		endif

	endif

endif



	if busy == 1 && isAnimPlaying == 0

		set busy to 0

	endif

endif

end


Link to comment
Share on other sites

Not sure what you mean with the 'WallClawSwitch' script. Parenting only works one way, you cannot figure out 'who' the children are, only the parent.

The brackets do 'nothing' with the condition you have specified. Both ways work the same. Brackets are for:

if a=1 and b=1 or c=2 ==> a=1 and b=1 and c=anything. a=anything and b=anything or c=2.

if a=1 and (b=1 or c=2) ==> a must =1 and b=1 or c=2.

Now these two statements mean something different from each other.

I have been wondering, but does 'somit' mean the same thing as 'something'?

In your script, do NOT set the variables to 0 on activate unless there is a reason to do that. All variables start a new script with a default value of 0.

When you do a 'player.getitemcount, the count can never be less than 0. Re: <=

You have your 'count-up' inside the 'if busy == 0' condition. That is only performed once since you set busy to 1. So your count-up will never happen. Additionally, its inside the 'onActivate' block which only runs once per activate. It should go in your GameMode block.

OnTrigger blocks will not necessarily run forever either. It 'might' but its best to put repeating code in a gameMode block.

Link to comment
Share on other sites

Kia Ora

Wow my head hurts,.. I'm not sure I'm getting this so I'll try somit should be more straight forward and come back to those



Scn KHDarkshard01Scr


Short Busy

Short DoOnce

short active01

short Timer01

Ref KHEnergySource01

Ref KHDarkWarlockSigilstone01

Ref Target

Ref myself


begin onActivate


	if busy == 0

		set target to getParentRef

		set mySelf to getSelf

		target.activate mySelf 1

		playgroup forward 0

	endif

 endif

End


begin Gamemode


			if KHDarkWarlockSigilstone01.GetDisabled == 1 && KHEnergySource01.GetDisabled == 1

				if active01 == 0

					return

				endif

			if KHDarkWarlockSigilstone01.GetDisabled == 1 && KHEnergySource01.GetDisabled == 1

				if active01 == 1	 && player.getitemcount DarkWarlockSigilstone01 <= 0			

				      KHEnergySource01.Enable

				KHDarkWarlockSigilstone01.Enable

		    Set DoOnce to 1

		endif

	endif

endif

	if  KHEnergySource01.GetDisabled == 0

	 	if  (player.getitemcount DarkWarlockSigilstone01 >= 1 ) &&  (player.getitemcount DarkWarlockSigilstone02 >= 1 ) &&  (player.getitemcount DarkWarlockSigilstone03 >= 1 ) &&  (player.getitemcount DarkWarlockSigilstone04 >= 1 )

			set Timer01 to (Timer01 + GetSecondsPassed)

				KHDarkWarlockStaffRef.enable

					set Timer01 to (Timer01 + GetSecondsPassed)

						if Timer01 >= 30

							set Timer01 to 0

					       if IsAnimPlaying == 0

			              set Busy to 0  

					endif

				endif 

	      endif

	endif

end


Link to comment
Share on other sites

I replied to that script before, but you skipped it for being too hard. XD

[snip]

3. Your IF/ELSEIF/ENDIF structure is not complete. Please look at my code to see the proper spacing you should use so you can easily determine its not right.

4. Without knowing what objects you are using, I could not speak about using 'playgroup' or 'isanimPlaying' commands. I don't think you ever answered this, but I may be wrong.

5. Your best bet is to try it out and report what does or does not work. Then we can help more. See my comment in the code below.

scn KHActivatorClawSwitch01 
ref myParent
ref mySelf
float EffectTime01

short Busy
short DoOnce

begin OnActivate
if (KHLightingEnergy01.GetDisabled == 0)
set EffectTime01 to 0
set DoOnce to 0
if Busy == 0
playgroup forward 0
set myParent to GetParentRef
set mySelf to getSelf
myparent.activate mySelf 1
set Busy to 1
endif
endif
end

begin Gamemode
;What condition do you want for 'when' the light turns on? Just being in the cell?
if ( player.getitemcount KHDragonEgg01 <= 0 )
messagebox " Seems to be somit missing "
else
set EffectTime01 to (EffectTime01 + GetSecondsPassed)
if EffectTime01 >= 10
KHLightingEnergy01.enable
KHLightingEnergy02.enable
if EffectTime01 >= 200
KHPortalActivatorRef.enable
set DoOnce to 1
endif
endif
endif

if IsAnimPlaying == 0
set Busy to 0
endif
end[/code]

Link to comment
Share on other sites

Kia Ora

Maybe the easyest way to answer this is to comment it,.. BTW somit is English dialog for something,.. think its Londoners from menory

The Lightening is the SE08PowerEnergy.nif the activator is a spell shrine from Loast spires made into a standard Activator


scn KHActivatorClawSwitch01 

ref myParent 

ref mySelf 

float EffectTime01 


short Busy 

short DoOnce 


begin OnActivate 

        if (KHLightingEnergy01.GetDisabled == 0)

                set EffectTime01 to 0 

                set DoOnce to 0 

                if Busy == 0 

                        playgroup forward 0 

                        set myParent to GetParentRef 

                        set mySelf to getSelf 

                        myparent.activate mySelf 1 

                        set Busy to 1 

                endif 

        endif

end 


begin Gamemode 

;What condition do you want for 'when' the light turns on? Just being in the cell?   ;<------ just nee the Lighten to enable like a power supply starting up and then the Actvitor enables a sort time after

        if  ( player.getitemcount KHDragonEgg01 <= 0 )                               ;  <--------- if the player has no egg nothing happens or he get message 

                messagebox " Seems to be somit missing "                            ; <------------ something to let PC know they need something esle

        else

             if  ( player.getitemcount KHDragonEgg01 >= 1 )                          ; <------------------ if they have the egg the lightenling enables

                set EffectTime01 to (EffectTime01 + GetSecondsPassed) 

                if EffectTime01 >= 10 

                        KHLightingEnergy01.enable 

                        KHLightingEnergy02.enable 

                        if EffectTime01 >= 200 

                                KHPortalActivatorRef.enable                                    ; <---------------- the Activator enables ready for clicking

                                set DoOnce to 1 

                        endif 

                endif 

        endif 


        if IsAnimPlaying == 0 

                set Busy to 0    

        endif 

end


there will be a script on the KHPortalActivatorRef later to enable to portal Doors and move the payer to an xmaker outside, these doors will be the means to get up to a floating city

and back down again in Summset.

Does that answer you question?

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

Now I am totally confused.

Perhaps you could say in english (instead of code) what you want to happen, and in what order...

1. If player has 'egg' and enters cell, the the activator can be used.

2. When #1 above happens, and the activator is used, the lights turn on.

etc..

Link to comment
Share on other sites

Now I am totally confused.

Perhaps you could say in english (instead of code) what you want to happen, and in what order...

1. If player has 'egg' and enters cell, the the activator can be used.

2. When #1 above happens, and the activator is used, the lights turn on.

etc..

Sorry Thought I had it clear,..

This i fact the last script in this cell,.. so from the very start right through as it should happen

The player enters and fight through a dungeon where he fights a beast and get a head (this ports PC up onto a floating rock where he/she finds a scroll and an egg. he/she then finds a tower with 4 shards on it that on activation enables a powersource (lighteningEnergy) and 4 sigilstones.

When the Player has 4 stones it enables another powersource and a staff/activator, after activating the staff PC in moved to an xmarker and confronts 2 guards having killed them he/she activates a wallCaw switch that enable a portal and Telan (guard no; 3) and disables a secert wall door,. after killing Telan he/she can use the portal to get to a lower level and enter where the wall door is now gone to confront the Boss fight.

When PC (after the fight) goes up the stairs it triggers (that triggbox script) 4 pillers that have LighteningEnergy and lightsources and on the back wall is a second wallClaw switch that when activated will enable 2 LightenEnergy beams and sortly after an activator enables.

The scripts

Theres 4 shard to click on to get 4 stones the lightening should no enable till the shard is clicked if the frame it is going to be high the lightenings could be

disaibled after the stones are picked up

The Shads script


Scn KHDarkshard01Scr  ; 4 of these named DarkShard 01 02 03 04 to make them individual


Short Busy

Short DoOnce

short active01

short Timer01

Ref KHEnergySource01

Ref KHDarkWarlockSigilstone01

Ref Target

Ref myself


begin onActivate


        if busy == 0

                set target to getParentRef

                set mySelf to getSelf

                target.activate mySelf 1

                playgroup forward 0

        endif

 endif

End


begin Gamemode


                        if KHDarkWarlockSigilstone01.GetDisabled == 1 && KHEnergySource01.GetDisabled == 1

                                if active01 == 0

                                        return

                                endif

                        if KHDarkWarlockSigilstone01.GetDisabled == 1 && KHEnergySource01.GetDisabled == 1

                                if active01 == 1         && player.getitemcount DarkWarlockSigilstone01 <= 0                    

                                      KHEnergySource01.Enable

                                KHDarkWarlockSigilstone01.Enable

                    Set DoOnce to 1

                endif

        endif

endif

        if  KHEnergySource01.GetDisabled == 0

                if  (player.getitemcount DarkWarlockSigilstone01 >= 1 ) &&  (player.getitemcount DarkWarlockSigilstone02 >= 1 ) &&  (player.getitemcount DarkWarlockSigilstone03 >= 1 ) &&  (player.getitemcount DarkWarlockSigilstone04 >= 1 )

                        set Timer01 to (Timer01 + GetSecondsPassed)

                                KHDarkWarlockStaffRef.enable

                                        set Timer01 to (Timer01 + GetSecondsPassed)

                                                if Timer01 >= 30

                                                        set Timer01 to 0

                                               if IsAnimPlaying == 0

                                      set Busy to 0  

                                        endif

                                endif 

              endif

        endif

end


I didn't know when was best to enable the Staff and it's Lightening,.. in the shard script or in the staff script


Scn KHWarlockStaffScr


Short DoOnce

Short Stafftimer

Short triggered

Short effecttimer

Ref KHActivatorRef

Ref KHDarkWarlockStaffRef

Ref KHTowerEnergyBlueLargeRef


Begin OnAdd

			if KHDarkWarlockStaffRef.Disable == 1 && player.getitemcount AncientWarlockScroll01 <= 0                

		        Messagebox "Ummm,. Me tinks I be need'n something"

	 			elseif triggered <= 1 && player.getitemcount AncientWarlockScroll01 >= 1

					if player.getitemcount DarkWarlockSigilstone01 >= 1

						if player.getitemcount DarkWarlockSigilstone02 >= 1

							if player.getitemcount DarkWarlockSigilstone03 >=1

								if player.getitemcount DarkWarlockSigilstone04 >= 1

									KHTowerEnergyBlueLargeRef.Enable

										set effecttimer to (effecttimer + GetSecondsPassed)

									if (effecttimer >= 30)

								 KHDarkWarlockStaffRef.Enable

							Set Stafftimer to 1

 					    set triggered to 1

					endif

				endif

			endif

		endif

	endif

endif

end


Begin OnActivate

						if player.getitemcount KHDragonEgg01 >= 1

								KHTowerEnergyBlueLargeRef.enable

									if (KHDarkWarlockStaffRef.Disable == 0)

								set effecttimer to (effecttimer + GetSecondsPassed)

							if (effecttimer >= 60) || (Stafftimer >= 1)

						set effecttimer to 0

					set DoOnce to 1

				Player.moveto KHActivatorRef  ; this is an xmaker

			endif

		endif

	endif

end



then PC will encounter the 2 guards kill them and find a wallClaw Switch this is the one the enables the portal and Telen as well as disables the secert wall


scn KHPortalDoorClawSwitch01


; Activates Portal door and Telan


ref myParent

ref mySelf

ref EffectTime02


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   player.getitemcount KHDragonEgg01 <= 0 

					messagebox " Seems to be somit missing "

						elseif  KHMagicPortalRef.GetDisabled == 1 &&  KHTelanRef.GetDisabled == 1

							if player.getitemcount KHDragonEgg01 >= 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

					endif

				endif

			endif

		endif

	endif

end


begin Gamemode


		if  KHMagicPortalRef.GetDisabled ==1 &&  KHTelanRef.GetDisabled == 1

			if IsAnimPlaying == 0

				set Busy to 0	

			endif

		endif

end


After fighting Telen and using the Portal to get to a lower level to enter the last area and the Boss fight is over This is the triggbox script to trigger the 3 pillars


sscn KHTriggerShrinePowerScr


short triggered

short next

short busy

short opened

Short PowerTrig



begin onTrigger Player


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

            return

            if player.getitemcount KHDragonEgg01 >= 1

                set PowerTrig to (PowerTrig + getsecondspassed)

                    if ( PowerTrig >= 5 ) 

                        KHLightingEnergy05Ref.enable

                            KHLightingEnergy06Ref.enable

                                if ( PowerTrig >= 15 )

                                    KHLightingEnergy03Ref.enable

                                        KHLightingEnergy04Ref.enable

                                       if PowerTrig >= 30

                                    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

        if busy == 1 && isAnimPlaying == 0

            set busy to 0

        endif

    endif

end




After that PC finds the last wallClaw Switch and the trigger has enable the 4 pillars Clicking the last wall switch enables the last 2 lightenEnergy beams and sortly after the activator Again to save on frame hits the lightening could be diable once the activator is enabled just leaving the activator to activate the Doors outside and move PC to an outside marker. (when I get that far, I still need finish this stuff)


scn KHActivatorClawSwitch01 

ref myParent 

ref mySelf 

float EffectTime01 


short Busy 

short DoOnce 


begin OnActivate 

        if (KHLightingEnergy01.GetDisabled == 0)

                set EffectTime01 to 0 

                set DoOnce to 0 

                if Busy == 0 

                        playgroup forward 0 

                        set myParent to GetParentRef 

                        set mySelf to getSelf 

                        myparent.activate mySelf 1 

                        set Busy to 1 

                endif 

        endif

end 


begin Gamemode 

;What condition do you want for 'when' the light turns on? Just being in the cell?

        if  ( player.getitemcount KHDragonEgg01 <= 0 ) 

                messagebox " Seems to be somit missing " 

        else

                set EffectTime01 to (EffectTime01 + GetSecondsPassed) 

                if EffectTime01 >= 10 

                        KHLightingEnergy01.enable 

                        KHLightingEnergy02.enable 

                        if EffectTime01 >= 200 

                                KHPortalActivatorRef.enable 

                                set DoOnce to 1 

                        endif 

                endif 

        endif 


        if IsAnimPlaying == 0 

                set Busy to 0    

        endif 

end


I didn't do this before cause I didn't want to make a long post seems ppl don't like long posts

WarlockStaff
First WallClaw Switch
TriggerBox Script
Last WallClaw Switch
Edited by Kiwi-Hawk
Link to comment
Share on other sites

I am placing my comments inside this reply below. They will be Red in color.

What you want to do is complex and will take me some time to work through it. I will continually update this post and will let you know when I am done.

= = = = = = = = =

1) The player finds a tower with 4 shards on it that on each activation enables a powersource (lightning Energy) and one of each of 4 sigilstones.

1. The 4 Shads scripts

1. Fixed the 'extra' endif you did not need in the OnActivate block of code.

2. Fixed 'tabbing' problems with your code. Make sure you use the 'tab' key, not spaces.

3. Lots of editing to follow what you specified above.


Scn KHDarkshard01Scr ; 4 of these named DarkShard 01 02 03 04 to make them individual
Short Busy
Ref Target
Ref myself

begin onActivate
if busy == 0
;This is only needed if you have the shard parented to another object that requires 'activation'.
;Otherwise you can delete the next 3 lines.
set target to getParentRef
set mySelf to getSelf
target.activate mySelf 1
playgroup forward 0
set busy to 1
endif
End

begin Gamemode
if busy == 1
KHEnergySource01.Enable
KHDarkWarlockSigilstone01.Enable
set busy to 2
endif
end
[/code] [color=#FF8C00]2) When the Player has the 4 sigilstones it enables another powersource and a staff/activator. [/color] [color=#00BFFF] [center][b]2. The 4 SigelStones scripts[/b] [/center] [/color] [b][color=#FF0000]1. This code goes on each of the 4 sigel Stones. 2. Make a global variable called KHStonesTotalGBL. Ask if you dont know how to do that. 3. Timers should always be setup as a 'float'.[/color][/b]
[code]
Scn KHSigelStoneScr
Short DoOnce
float Timer01

begin OnActivate
if DoOnce == 0
set DoOnce to 1
set KHStonesTotalGBL to KHStonesTotalGBL + 1
endif
if KHStonesTotalGBL >= 4
set Timer01 to 30
set DoOnce to 2
endif
Activate
end

begin GameMode
if DoOnce == 2
if Timer01 >= 0
set Timer01 to Timer01 - GetSecondsPassed
else
set DoOnce to 3
;enable your powersource
KHDarkWarlockStaffRef.enable
endif
endif
end
3) After activating the staff the player is moved to an xmarkerheading and confronts 2 guards.

Scn KHWarlockStaffScr
Short DoOnce

Begin OnActivate
if DoOnce == 0
set DoOnce to 1
Player.MoveTo KHActivatorRef ; this is an xmakerheading
endif
end
[/code] [b][color=#FF0000]This is as far as I can spend on this today. I will work on the below script when I have more time. Can you clarify what exactly is suppose to happen next? The text below seems out of order from your original post.[/color][/b] [color=#FF8C00]4) Having killed the guards the player activates a wallClawSwitch that enables a portal and Guard #3 and disables a secert wall door.[/color] After killing Telan the player can use the portal to get to a lower level and enter where the wall door is now gone to confront the Boss fight. When PC (after the fight) goes up the stairs it triggers (that triggbox script) 4 pillers that have LighteningEnergy and lightsources and on the back wall is a second wallClaw switch that when activated will enable 2 LightenEnergy beams and sortly after an activator Theres 4 shard to click on to get 4 stones the lightening should no enable till the shard is clicked if the frame it is going to be high the lightenings could be disaibled after the stone is picked up then PC will encounter the 2 guards kill them and find a wallClaw Switch this is the one the enables the portal and Telen as well as disables the secert wall [center] [b]First WallClaw Switch[/b] [/center]
[code]

scn [b]KHPortalDoorClawSwitch01[/b]

; Activates Portal door and Telan

ref myParent
ref mySelf
ref EffectTime02

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 player.getitemcount KHDragonEgg01 <= 0
messagebox " Seems to be somit missing "
elseif KHMagicPortalRef.GetDisabled == 1 && KHTelanRef.GetDisabled == 1
if player.getitemcount KHDragonEgg01 >= 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
endif
endif
endif
endif
endif
end

begin Gamemode

if KHMagicPortalRef.GetDisabled ==1 && KHTelanRef.GetDisabled == 1
if IsAnimPlaying == 0
set Busy to 0
endif
endif
end

After fighting Telen and using the Portal to get to a lower level to enter the last area and the Boss fight is over This is the triggbox script to trigger the 3 pillars


sscn KHTriggerShrinePowerScr

short triggered
short next
short busy
short opened
Short PowerTrig


begin onTrigger Player

if Triggered == 0 && player.getitemcount KHDragonEgg01 == 0
return
if player.getitemcount KHDragonEgg01 >= 1
set PowerTrig to (PowerTrig + getsecondspassed)
if ( PowerTrig >= 5 )
KHLightingEnergy05Ref.enable
KHLightingEnergy06Ref.enable
if ( PowerTrig >= 15 )
KHLightingEnergy03Ref.enable
KHLightingEnergy04Ref.enable
if PowerTrig >= 30
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
if busy == 1 && isAnimPlaying == 0
set busy to 0
endif
endif
end



[/code] After that PC finds the last wallClaw Switch and the trigger has enable the 4 pillars Clicking the last wall switch enables the last 2 lightenEnergy beams and sortly after the activator Again to save on frame hits the lightening could be diable once the activator is enabled just leaving the activator to activate the Doors outside and move PC to an outside marker. (when I get that far, I still need finish this stuff) [center] [b]Last WallClaw Switch[/b] [/center]
[code]

scn [b]KHActivatorClawSwitch01[/b]
ref myParent
ref mySelf
float EffectTime01

short Busy
short DoOnce

begin OnActivate
if (KHLightingEnergy01.GetDisabled == 0)
set EffectTime01 to 0
set DoOnce to 0
if Busy == 0
playgroup forward 0
set myParent to GetParentRef
set mySelf to getSelf
myparent.activate mySelf 1
set Busy to 1
endif
endif
end

begin Gamemode
;What condition do you want for 'when' the light turns on? Just being in the cell?
if ( player.getitemcount KHDragonEgg01 <= 0 )
messagebox " Seems to be somit missing "
else
set EffectTime01 to (EffectTime01 + GetSecondsPassed)
if EffectTime01 >= 10
KHLightingEnergy01.enable
KHLightingEnergy02.enable
if EffectTime01 >= 200
KHPortalActivatorRef.enable
set DoOnce to 1
endif
endif
endif

if IsAnimPlaying == 0
set Busy to 0
endif
end

I made the script name bold to help with ID'ing them, they will NOT have that in game

I didn't do this before cause I didn't want to make a long post seems ppl don't like long posts

3. The Warlock Staff scripts
1. This code goes on the staff that you enabled above. 2. All it needs to do is move the player since you should never come back to this cell, right?
TriggerBox Script
Link to comment
Share on other sites

Kia Ora

thank you very very much for ALL this help I know it a lot of your time

Just a wee Note I see i doubled up in sigilstone script and the warlockstaff,..

Which is easyer for you and can a disabled item run a script? I have the staff checking player for stones then enabling

that would be redundent after the sigilstone script right? I had an OnAdd checking for stones and OnActivate moving PC

in the WarlockStaff script

I may need help with that GlobalVariable I made one under Gameplay\Globals right its a short 0 value

Do I just add that to each stone only editing the enable data and let it add one each time it's run, I'm thnking the 1 value stacks up to 4 them

does what it has to

Link to comment
Share on other sites

I may not have time to look at this today, there is a lot going on for me today.

Disabled items do run their script. Such as a GameMode.

The 'staff' only needs to teleport the player, so all the other stuff can be removed. You cannot 'activate' the staff when its disabled, so checking for the OnActivate and OnAdd will not work on the staff. So, I put the script on the stones instead.

You made the global variable the correct way. It can now be used by ANY script from ANYWHERE. That is the beauty of global variables.

When the player has 4 stones, what exactly is supposed to happen.

I just changed the stones script since I am guessing you don't want the staff activated until 30 seconds after getting the last stone...

Link to comment
Share on other sites

I may not have time to look at this today, there is a lot going on for me today.

Disabled items do run their script. Such as a GameMode.

The 'staff' only needs to teleport the player, so all the other stuff can be removed. You cannot 'activate' the staff when its disabled, so checking for the OnActivate and OnAdd will not work on the staff. So, I put the script on the stones instead.

You made the global variable the correct way. It can now be used by ANY script from ANYWHERE. That is the beauty of global variables.

When the player has 4 stones, what exactly is supposed to happen.

I just changed the stones script since I am guessing you don't want the staff activated until 30 seconds after getting the last stone...

Theres no rush at all I'm feeling really really blessed to have your help and it's in your time as your can thank you very very much your a gem man,.. thank you

When the play has all 4 stones the staff activate sortly after as you have it than when player clicks staff he/she is moved the the xmaker ref

so I guess the whole onadd part of the staff script is gone I screwed up big time there

So as not to break stuff, double checking here

I put this "SigelStones script" on each stone as it is or do I have to change a number for each stone

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

Kia Ora

Thank you again for that.

yes your right PC should not need to enter the cell again,. if they do nothing needs to work

after PC clicks on staff he/she is moved to an xmarker where they fight 2 guards,. then they click folowing:

First WallClaw Switch

this Switch is parented to a secret door (invisable wall) that needs to open it also needs to enable Telen and the Portal door,.. that portal is prarent to the linked door

( the lower opposite door) the idea being when it enables so does the linked door right?

Lowering th invisable wall allows PC to got into that area where the Boss fight takes place after wich they actuvate triggerbox going up the stair to the last Wallclaw switch

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

I think this is the right place to put it.

I have a small issue. Im wanting the player to go through a gate leading into a garden labyrinth. But as soon as he/she/other enters, i want the gate to close and lock, i know how to make that happen using a script where the player activates something and it happens. but iwant it doen automatically, so they dont have a choice.

What ive done to remedy the issue is make a new ayleid push button ( My labyrinth is in a city floating above a new world space, so it matches the scenery) i have it scripted as sugh

scn thedoor

begin ontrigger player

theplate.activate

end

begin onactivate

mazegate.setopenstate 0

mazegate.lock 100

end

Only, when my character steps on the plate, nothing happens. i have to look at it and activate it. what is going wrong?

Link to comment
Share on other sites

Instead of using a 'button', why not use the floor pressure plate? You can find it in the Activators named "ARTrigPressurePlate01". Make a copy of it and put this script on it.

scn myTrigPressurePlate01Script
short activated

begin GameMode
if activated == 0
if getDistance player < 64
set activated to 1
playgroup forward 0
mazegate.setopenstate 0
mazegate.lock 100
endif
endif
end

begin onReset
reset3DState
set activated to 0
;You could unlock the gate here if you wish
end[/code]

The button does not work because its not a 'trigger zone' object. Now, I personally would use a trigger zone that animates the pressure plate and closes and locks the gate. I have a tutorial here on 'automatic doors' that might also help you with what you want to do.

Can I assume that 'mazegate' is the reference ID name you gave the gate and not the object ID name?

Link to comment
Share on other sites

Instead of using a 'button', why not use the floor pressure plate? You can find it in the Activators named "ARTrigPressurePlate01". Make a copy of it and put this script on it.

scn myTrigPressurePlate01Script

short activated


begin GameMode

	if activated == 0

		if getDistance player < 64

			set activated to 1

			playgroup forward 0

			mazegate.setopenstate 0

			mazegate.lock 100 

		endif

	endif

end


begin onReset

	reset3DState

	set activated to 0

	;You could unlock the gate here if you wish

end

The button does not work because its not a 'trigger zone' object. Now, I personally would use a trigger zone that animates the pressure plate and closes and locks the gate. I have a tutorial here on 'automatic doors' that might also help you with what you want to do.

Can I assume that 'mazegate' is the reference ID name you gave the gate and not the object ID name?

I actually Am using this exact trigger, i jsut duped it and named it something else( i dont like editing vanilla meshes.) Im gonna play test this script you gave me nao though looks more like the ones i see on the c s already. Lolz, I just didnt know i could add stuff to the middle of that part. Thaqnk you so much, You are a scholor

Link to comment
Share on other sites

4) Having killed the guards the player activates a wallClawSwitch that enables a portal and Guard #3 and disables a secert wall door.

Thats correct,.. this wallswitch enables a portal (that has the other end parented to it so it enables at same time) and Telen (guard 3) and disables a secret wall

these are the items KHMagicPortalRef.enabled & KHTelanRef.enabled plus KHSecretwallRef.Disable

First WallClaw Switch



scn [b]KHPortalDoorClawSwitch01[/b]


; Activates Portal door and Telan


ref myParent

ref mySelf

ref EffectTime02


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   player.getitemcount KHDragonEgg01 <= 0 

					messagebox " Seems to be somit missing "

						elseif  KHMagicPortalRef.GetDisabled == 1 &&  KHTelanRef.GetDisabled == 1

							if player.getitemcount KHDragonEgg01 >= 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

					endif

				endif

			endif

		endif

	endif

end


begin Gamemode


		if  KHMagicPortalRef.GetDisabled ==1 &&  KHTelanRef.GetDisabled == 1

			if IsAnimPlaying == 0

				set Busy to 0	

			endif

		endif

end


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


sscn KHTriggerShrinePowerScr


short triggered

short next

short busy

short opened

Short PowerTrig



begin onTrigger Player


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

            return

            if player.getitemcount KHDragonEgg01 >= 1

                set PowerTrig to (PowerTrig + getsecondspassed)

                    if ( PowerTrig >= 5 ) 

                        KHLightingEnergy05Ref.enable

                            KHLightingEnergy06Ref.enable

                                if ( PowerTrig >= 15 )

                                    KHLightingEnergy03Ref.enable

                                        KHLightingEnergy04Ref.enable

                                       if PowerTrig >= 30

                                    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

        if busy == 1 && isAnimPlaying == 0

            set busy to 0

        endif

    endif

end




at top of stairs at back wall PC finds the last wallClaw Switch Clicking the last wall switch enables the last 2 lightenEnergy beams and sortly after the activator enables. Again to save on frame hits the lightening could be diable once the activator is enabled just leaving the activator to activate the Doors outside and move PC to an outside marker. (when I get that far, I still need Onra to finish the exterior) Parts KHLightingEnergy01.enable KHLightingEnergy02.enable KHPortalActivatorRef.enable


scn [b]KHActivatorClawSwitch01[/b] 

ref myParent 

ref mySelf 

float EffectTime01 


short Busy 

short DoOnce 


begin OnActivate 

        if (KHLightingEnergy01.GetDisabled == 0)

                set EffectTime01 to 0 

                set DoOnce to 0 

                if Busy == 0 

                        playgroup forward 0 

                        set myParent to GetParentRef 

                        set mySelf to getSelf 

                        myparent.activate mySelf 1 

                        set Busy to 1 

                endif 

        endif

end 


begin Gamemode 

;What condition do you want for 'when' the light turns on? Just being in the cell?

        if  ( player.getitemcount KHDragonEgg01 <= 0 ) 

                messagebox " Seems to be somit missing " 

        else

                set EffectTime01 to (EffectTime01 + GetSecondsPassed) 

                if EffectTime01 >= 10 

                        KHLightingEnergy01.enable 

                        KHLightingEnergy02.enable 

                        if EffectTime01 >= 200 

                                KHPortalActivatorRef.enable 

                                set DoOnce to 1 

                        endif 

                endif 

        endif 


        if IsAnimPlaying == 0 

                set Busy to 0    

        endif 

end


I made the script name bold to help with ID'ing them, they will NOT have that in game

I didn't do this before cause I didn't want to make a long post seems ppl don't like long posts

TriggerBox Script
Last WallClaw Switch
  • Upvote 1
Link to comment
Share on other sites

I am a list type of guy. So lets do this step by step instead of overwhealming me with everything. When you get one part done, then we can move onto the next.

4) Having killed the guards the player activates a wallClawSwitch that enables a portal and Guard #3 and disables a secert wall door.

Thats correct,.. this wallswitch enables a portal (that has the other end parented to it so it enables at same time) and Telen (guard 3) and disables a secret wall

these are the items:

KHMagicPortalRef.enabled

KHTelanRef.enabled

KHSecretwallRef.Disable

First WallClaw Switch


scn KHPortalDoorClawSwitch01
; Activates Portal door and Telan
ref myParent
ref mySelf

float EffectTime02
short Busy
Short DoOnce

begin OnActivate
if Busy == 0
set busy to 1
playgroup forward 0
set myParent to GetParentRef
set mySelf to getSelf
myparent.activate mySelf 1
if player.getitemcount KHDragonEgg01 <= 0
messagebox " Seems to be somit missing "
elseif KHMagicPortalRef.GetDisabled == 1 && KHTelanRef.GetDisabled == 1
if player.getitemcount KHDragonEgg01 >= 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
endif
else
messagebox " Seems to be somit missing "
endif
endif
endif
end

begin Gamemode
if IsAnimPlaying == 0 && busy == 1
set Busy to 0
endif
end
[/code]

1. Timers are 'float' type variables.

2. What is the purpose of checking how many KHDragonEgg01 the player has? Where is he getting these?

3. Your 'OnActivate' had one too many 'endif's.

4. I added code for the 'busy' control. Your 'GameMode' did not need the first 'IF' statement.

Link to comment
Share on other sites

I am not sure if you have covered this before or nor or if it can be done. My current character,ninja type, is using a parry dagger. The down side is that he always has it out. Is there a way to script it so that he only equips it when he draws his sword,do no need it while using a bow,or do I need to script his sword to equip the parry dagger when he draws his sword?

Thank you for your help.

Link to comment
Share on other sites

I am a list type of guy. So lets do this step by step instead of overwhealming me with everything. When you get one part done, then we can move onto the next.

1. Timers are 'float' type variables.

2. What is the purpose of checking how many KHDragonEgg01 the player has? Where is he getting these?

3. Your 'OnActivate' had one too many 'endif's.

4. I added code for the 'busy' control. Your 'GameMode' did not need the first 'IF' statement.

The egg is picked up earlier when PC is moved way up onto a floating rock shrine, theres the egg and scroll on a shrine that are used as checks, if PC doesn't

have them then nothing happens

The idea is that PC has to kill the 2 guards to get to switch then when the switch is activated (provided PC has egg) the wall is disabled and the portal and Telen are enabled

BTW I am sorry about posting to much,.. I don't mean to get your aggro up I thought it would be helpful to see the path thing where taking

I am really greatful your helping an ole bloke out and don't wish to get in your face

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

The idea is that PC has to kill the 2 guards to get to switch then when the switch is activated (provided PC has egg) the wall is disabled and the portal and Telen are enabled

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.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

×
×
  • Create New...