Script compiles but doesn't work. (Torch disableenable npcs

Post » Thu Jul 07, 2016 9:08 am

Here is the script in question yeah it's RIDICULOUSLY long but still not so long it can't fit. It's probably extremely similar to something that would work, but I suppose for whatever reason it doesn't work. Oddly enough I have a very similar script for Oblivion that worked perfectly but for Skyrim it doesn't seem to work so here is my altered version that compiles yet doesn't work.



And before anyone asks "WHY so many?" it's cause different smaller armies of undead go after the player at different days, some days have more giant skeletons, other days have more ghosts and so on, for variety and unpredictability.



Scriptname AAATehZomberStalkers extends Quest

Actor Property Player Auto
Actor Property TehZombers1 Auto
Actor Property TehZombers2 Auto
Actor Property TehZombers3 Auto
Actor Property TehZombers4 Auto
Actor Property TehZombers5 Auto
Actor Property TehZombers6 Auto
Actor Property TehZombers7 Auto
Actor Property TehZombers8 Auto
Actor Property TehZombers9 Auto
Actor Property TehZombers10 Auto
Actor Property TehZombers11 Auto
Actor Property TehZombers12 Auto
Actor Property TehZombers13 Auto
Actor Property TehZombers14 Auto
Actor Property TehZombers15 Auto
Actor Property TehZombers16 Auto
Actor Property TehZombers17 Auto
Actor Property TehZombers18 Auto
Actor Property TehZombers19 Auto
Actor Property TehZombers20 Auto
Actor Property TehZombers21 Auto
Actor Property TehZombers22 Auto
Actor Property TehZombers23 Auto
Actor Property TehZombers24 Auto
Actor Property TehZombers25 Auto
Actor Property TehZombers26 Auto
Actor Property TehZombers27 Auto
Actor Property TehZombers28 Auto
Actor Property TehZombers29 Auto
Actor Property TehZombers30 Auto
Actor Property TehZombers31 Auto
Actor Property TehZombers32 Auto
Actor Property TehZombers33 Auto
Actor Property TehZombers34 Auto
Actor Property TehZombers35 Auto
Actor Property TehZombers36 Auto
Actor Property TehZombers37 Auto
Actor Property TehZombers38 Auto
Actor Property TehZombers39 Auto
Actor Property TehZombers40 Auto

Actor Property TehZombers41 Auto
Actor Property TehZombers42 Auto
Actor Property TehZombers43 Auto
Actor Property TehZombers44 Auto
Actor Property TehZombers45 Auto
Actor Property TehZombers46 Auto
Actor Property TehZombers47 Auto
Actor Property TehZombers48 Auto
Actor Property TehZombers49 Auto
Actor Property TehZombers50 Auto
Actor Property TehZombers51 Auto
Actor Property TehZombers52 Auto
Actor Property TehZombers53 Auto
Actor Property TehZombers54 Auto
Actor Property TehZombers55 Auto
Actor Property TehZombers56 Auto
Actor Property TehZombers57 Auto
Actor Property TehZombers58 Auto
Actor Property TehZombers59 Auto
Actor Property TehZombers60 Auto
Actor Property TehZombers61 Auto
Actor Property TehZombers62 Auto
Actor Property TehZombers63 Auto
Actor Property TehZombers64 Auto
Actor Property TehZombers65 Auto
Actor Property TehZombers66 Auto
Actor Property TehZombers67 Auto
Actor Property TehZombers68 Auto
Actor Property TehZombers69 Auto
Actor Property TehZombers70 Auto


Actor Property TehZombers71 Auto
Actor Property TehZombers72 Auto
Actor Property TehZombers73 Auto
Actor Property TehZombers74 Auto
Actor Property TehZombers75 Auto
Actor Property TehZombers76 Auto
Actor Property TehZombers77 Auto
Actor Property TehZombers78 Auto
Actor Property TehZombers79 Auto
Actor Property TehZombers80 Auto
Actor Property TehZombers81 Auto
Actor Property TehZombers82 Auto
Actor Property TehZombers83 Auto
Actor Property TehZombers84 Auto
Actor Property TehZombers85 Auto
Actor Property TehZombers86 Auto
Actor Property TehZombers87 Auto
Actor Property TehZombers88 Auto
Actor Property TehZombers89 Auto
Actor Property TehZombers90 Auto


Actor Property TehZombers91 Auto
Actor Property TehZombers92 Auto
Actor Property TehZombers93 Auto
Actor Property TehZombers94 Auto
Actor Property TehZombers95 Auto
Actor Property TehZombers96 Auto
Actor Property TehZombers97 Auto
Actor Property TehZombers98 Auto
Actor Property TehZombers99 Auto
Actor Property TehZombers100 Auto


Actor Property TehZombers101 Auto
Actor Property TehZombers102 Auto
Actor Property TehZombers103 Auto
Actor Property TehZombers104 Auto
Actor Property TehZombers105 Auto
Actor Property TehZombers106 Auto
Actor Property TehZombers107 Auto
Actor Property TehZombers108 Auto
Actor Property TehZombers109 Auto
Actor Property TehZombers110 Auto
Actor Property TehZombers111 Auto
Actor Property TehZombers112 Auto
Actor Property TehZombers113 Auto
Actor Property TehZombers114 Auto
Actor Property TehZombers115 Auto
Actor Property TehZombers116 Auto
Actor Property TehZombers117 Auto
Actor Property TehZombers118 Auto
Actor Property TehZombers119 Auto
Actor Property TehZombers120 Auto


Actor Property TehZombers121 Auto
Actor Property TehZombers122 Auto
Actor Property TehZombers123 Auto
Actor Property TehZombers124 Auto
Actor Property TehZombers125 Auto
Actor Property TehZombers126 Auto
Actor Property TehZombers127 Auto
Actor Property TehZombers128 Auto
Actor Property TehZombers129 Auto
Actor Property TehZombers130 Auto
Actor Property TehZombers131 Auto
Actor Property TehZombers132 Auto
Actor Property TehZombers133 Auto
Actor Property TehZombers134 Auto
Actor Property TehZombers135 Auto
Actor Property TehZombers136 Auto
Actor Property TehZombers137 Auto
Actor Property TehZombers138 Auto
Actor Property TehZombers139 Auto
Actor Property TehZombers140 Auto
Actor Property TehZombers141 Auto
Actor Property TehZombers142 Auto
Actor Property TehZombers143 Auto
Actor Property TehZombers144 Auto
Actor Property TehZombers145 Auto
Actor Property TehZombers146 Auto
Actor Property TehZombers147 Auto
Actor Property TehZombers148 Auto
Actor Property TehZombers149 Auto
Actor Property TehZombers150 Auto
Actor Property TehZombers151 Auto

Actor Property TehZombers152 Auto
Actor Property TehZombers153 Auto
Actor Property TehZombers154 Auto
Actor Property TehZombers155 Auto
Actor Property TehZombers156 Auto
Actor Property TehZombers157 Auto
Actor Property TehZombers158 Auto
Actor Property TehZombers159 Auto
Actor Property TehZombers160 Auto
Actor Property TehZombers161 Auto
Actor Property TehZombers162 Auto
Actor Property TehZombers163 Auto
Actor Property TehZombers164 Auto
Actor Property TehZombers165 Auto
Actor Property TehZombers166 Auto
Actor Property TehZombers167 Auto
Actor Property TehZombers168 Auto
Actor Property TehZombers169 Auto
Actor Property TehZombers170 Auto
Actor Property TehZombers171 Auto
Actor Property TehZombers172 Auto
Actor Property TehZombers173 Auto
Actor Property TehZombers174 Auto
Actor Property TehZombers175 Auto
Actor Property TehZombers176 Auto
Actor Property TehZombers177 Auto
Actor Property TehZombers178 Auto
Actor Property TehZombers179 Auto
Actor Property TehZombers180 Auto
Actor Property TehZombers181 Auto
Actor Property TehZombers182 Auto
Actor Property TehZombers183 Auto
Actor Property TehZombers184 Auto
Actor Property TehZombers185 Auto
Actor Property TehZombers186 Auto
Actor Property TehZombers187 Auto
Actor Property TehZombers188 Auto
Actor Property TehZombers189 Auto
Actor Property TehZombers190 Auto
Actor Property TehZombers191 Auto
Actor Property TehZombers192 Auto
Actor Property TehZombers193 Auto
Actor Property TehZombers194 Auto
Actor Property TehZombers195 Auto
Actor Property TehZombers196 Auto
Actor Property TehZombers197 Auto
Actor Property TehZombers198 Auto
Actor Property TehZombers199 Auto
Actor Property TehZombers200 Auto
Actor Property TehZombers201 Auto
Actor Property TehZombers202 Auto
Actor Property TehZombers203 Auto
Actor Property TehZombers204 Auto
Actor Property TehZombers205 Auto
Actor Property TehZombers206 Auto
Actor Property TehZombers207 Auto
Actor Property TehZombers208 Auto
Actor Property TehZombers209 Auto
Actor Property TehZombers210 Auto


Light property Torch01 Auto
Actor Property PlayerRef Auto

Function SomeFunction()
RegisterForUpdateGameTime(0.5) ; Before we can use onUpdateGameTime() we must register.
endFunction

Event OnUpdateGameTime()

if PlayerRef.IsEquipped(Torch01)
TehZombers1.disable()
TehZombers2.disable()
TehZombers3.disable()
TehZombers4.disable()
TehZombers5.disable()
TehZombers6.disable()
TehZombers7.disable()
TehZombers8.disable()
TehZombers9.disable()
TehZombers10.disable()
TehZombers11.disable()
TehZombers12.disable()
TehZombers13.disable()
TehZombers14.disable()
TehZombers15.disable()
TehZombers16.disable()
TehZombers17.disable()
TehZombers18.disable()
TehZombers19.disable()
TehZombers20.disable()
TehZombers21.disable()
TehZombers22.disable()
TehZombers23.disable()
TehZombers24.disable()
TehZombers25.disable()
TehZombers26.disable()
TehZombers27.disable()
TehZombers28.disable()
TehZombers29.disable()
TehZombers30.disable()
TehZombers31.disable()
TehZombers32.disable()
TehZombers33.disable()
TehZombers34.disable()
TehZombers35.disable()
TehZombers36.disable()
TehZombers37.disable()
TehZombers38.disable()
TehZombers39.disable()
TehZombers40.disable()
TehZombers41.disable()
TehZombers42.disable()
TehZombers43.disable()
TehZombers44.disable()
TehZombers45.disable()
TehZombers46.disable()
TehZombers47.disable()
TehZombers48.disable()
TehZombers49.disable()
TehZombers50.disable()
TehZombers51.disable()
TehZombers52.disable()
TehZombers53.disable()
TehZombers54.disable()
TehZombers55.disable()
TehZombers56.disable()
TehZombers57.disable()
TehZombers58.disable()
TehZombers59.disable()
TehZombers60.disable()
TehZombers61.disable()
TehZombers62.disable()
TehZombers63.disable()
TehZombers64.disable()
TehZombers65.disable()
TehZombers66.disable()
TehZombers67.disable()
TehZombers68.disable()
TehZombers69.disable()
TehZombers70.disable()
TehZombers71.disable()
TehZombers72.disable()
TehZombers73.disable()
TehZombers74.disable()
TehZombers75.disable()
TehZombers76.disable()
TehZombers77.disable()
TehZombers78.disable()
TehZombers79.disable()
TehZombers80.disable()
TehZombers81.disable()
TehZombers82.disable()
TehZombers83.disable()
TehZombers84.disable()
TehZombers85.disable()
TehZombers86.disable()
TehZombers87.disable()
TehZombers88.disable()
TehZombers89.disable()
TehZombers90.disable()
TehZombers91.disable()
TehZombers92.disable()
TehZombers93.disable()
TehZombers94.disable()
TehZombers95.disable()
TehZombers96.disable()
TehZombers97.disable()
TehZombers98.disable()
TehZombers99.disable()
TehZombers100.disable()
TehZombers101.disable()
TehZombers102.disable()
TehZombers103.disable()
TehZombers104.disable()
TehZombers105.disable()
TehZombers106.disable()
TehZombers107.disable()
TehZombers108.disable()
TehZombers109.disable()
TehZombers200.disable()
TehZombers201.disable()
TehZombers202.disable()
TehZombers203.disable()
TehZombers204.disable()
TehZombers205.disable()
TehZombers206.disable()
TehZombers207.disable()
TehZombers208.disable()
TehZombers209.disable()
TehZombers210.disable()


Elseif PlayerRef.IsEquipped(Torch01) == false
TehZombers1.enable()
TehZombers2.enable()
TehZombers3.enable()
TehZombers4.enable()
TehZombers5.enable()
TehZombers6.enable()
TehZombers7.enable()
TehZombers8.enable()
TehZombers9.enable()
TehZombers10.enable()
TehZombers11.enable()
TehZombers12.enable()
TehZombers13.enable()
TehZombers14.enable()
TehZombers15.enable()
TehZombers16.enable()
TehZombers17.enable()
TehZombers18.enable()
TehZombers19.enable()
TehZombers20.enable()
TehZombers21.enable()
TehZombers22.enable()
TehZombers23.enable()
TehZombers24.enable()
TehZombers25.enable()
TehZombers26.enable()
TehZombers27.enable()
TehZombers28.enable()
TehZombers29.enable()
TehZombers30.enable()
TehZombers31.enable()
TehZombers32.enable()
TehZombers33.enable()
TehZombers34.enable()
TehZombers35.enable()
TehZombers36.enable()
TehZombers37.enable()
TehZombers38.enable()
TehZombers39.enable()
TehZombers40.enable()
TehZombers41.enable()
TehZombers42.enable()
TehZombers43.enable()
TehZombers44.enable()
TehZombers45.enable()
TehZombers46.enable()
TehZombers47.enable()
TehZombers48.enable()
TehZombers49.enable()
TehZombers50.enable()
TehZombers51.enable()
TehZombers52.enable()
TehZombers53.enable()
TehZombers54.enable()
TehZombers55.enable()
TehZombers56.enable()
TehZombers57.enable()
TehZombers58.enable()
TehZombers59.enable()
TehZombers60.enable()
TehZombers61.enable()
TehZombers62.enable()
TehZombers63.enable()
TehZombers64.enable()
TehZombers65.enable()
TehZombers66.enable()
TehZombers67.enable()
TehZombers68.enable()
TehZombers69.enable()
TehZombers70.enable()
TehZombers71.enable()
TehZombers72.enable()
TehZombers73.enable()
TehZombers74.enable()
TehZombers75.enable()
TehZombers76.enable()
TehZombers77.enable()
TehZombers78.enable()
TehZombers79.enable()
TehZombers80.enable()
TehZombers81.enable()
TehZombers82.enable()
TehZombers83.enable()
TehZombers84.enable()
TehZombers85.enable()
TehZombers86.enable()
TehZombers87.enable()
TehZombers88.enable()
TehZombers89.enable()
TehZombers90.enable()
TehZombers91.enable()
TehZombers92.enable()
TehZombers93.enable()
TehZombers94.enable()
TehZombers95.enable()
TehZombers96.enable()
TehZombers97.enable()
TehZombers98.enable()
TehZombers99.enable()
TehZombers100.enable()
TehZombers101.enable()
TehZombers102.enable()
TehZombers103.enable()
TehZombers104.enable()
TehZombers105.enable()
TehZombers106.enable()
TehZombers107.enable()
TehZombers108.enable()
TehZombers109.enable()
TehZombers200.enable()
TehZombers201.enable()
TehZombers202.enable()
TehZombers203.enable()
TehZombers204.enable()
TehZombers205.enable()
TehZombers206.enable()
TehZombers207.enable()
TehZombers208.enable()
TehZombers209.enable()
TehZombers210.enable()
Endif
EndEvent

Here is the Oblivion script that worked for Oblivion btw if that helps at all.



scriptname AAATehZomberStalkers

begin gamemode

Ref Self

if PlayerRef.GetEquipped Torch02 == 0 && (gamehour >= 19 || gamehour < 7) && Player.IsInInterior == 0 && GetInWorldspace Tamriel == 1

enable
else
disable
endif

if getdead==0 && getdistance player > 16400 && PlayerRef.GetEquipped Torch02 == 0 && (gamehour >= 19 || gamehour < 7) && Player.IsInInterior == 0 && player.IsRidingHorse == 0
Self.moveto player
endif

if Player.IsInInterior == 1
Self.StopCombat
Endif


if getdead == 1 && getdistance player > 600 && && player.IsInCombat == 0
resurrect 1

EndIf

end

I tried to translate something very similar to Skyrim and my super long above one compiled but it doesn't work... I also this time am using a quest script unlike in Oblivion where I had said script applied to everything. All this script is supposed to do, is disable the zombies/ghosts/skeletons whenever the player has a torch out or is in an interior.


So can someone with better scripting knowledge please point out where I went wrong?

User avatar
Ymani Hood
 
Posts: 3514
Joined: Fri Oct 26, 2007 3:22 am

Post » Thu Jul 07, 2016 3:28 pm

Can't you use a FormList?

User avatar
Scott Clemmons
 
Posts: 3333
Joined: Sun Sep 16, 2007 5:35 pm

Post » Thu Jul 07, 2016 12:59 pm

Not to be rude, but a constantly-updating script is probably the least efficient way to do what you want.


I suggest taking a look at Dawnguard's vampire attacks, and using SM nodes instead. You can check if the player has a torch equipped in the node conditions.
User avatar
LuCY sCoTT
 
Posts: 3410
Joined: Sun Feb 04, 2007 8:29 am


Return to V - Skyrim