Nanerinium Posted February 13, 2019 Share Posted February 13, 2019 Hello! I'm working on a Helm's Deep mod, and I'm looking for a way to make a enemies appear continuously until you kill a certain number or percentage of them. Just like you'd see in the Vanilla game when you do the civil war quests and have to take over Whiterun/ Windhelm, or various imperial/ stormcloak forts! Here is a link to my map so far. I've made changes since I made this video, but I've worked hard at getting the details right and would LOVE to see this thing finished to it's best potential! https://www.nexusmods.com/skyrimspecialedition/videos/3194 Thank you! Link to comment Share on other sites More sharing options...
Rizalgar Posted February 14, 2019 Share Posted February 14, 2019 (edited) You could use something like this script attached to the actor, that would spawn in a new actor each time the actor was killed. Scriptname EndlessEnemy Extends Actor ObjectReference Property SpawnMarker Auto Event OnDeath(Actor killer) If Self.IsDead() SpawnMarker.PlaceActorAtMe(Self.GetActorBase()) EndIf Utility.Wait(5) Self.Delete() EndEvent Change the timer in the Wait command to whatever you want it to be. Use a reasonable number, too many dead bodies can cause some lag. Alternatively, create a quest that starts once you enter the dungeon or whatever Helm's Deep is. Didn't care much for LoTR. Attach this script to it. ScriptName InfiniteEnemies Extends Quest ObjectReference Property Marker1 Auto ObjectReference Property Marker2 Auto etc etc GlobalVariable Property KillCount Auto Actor Property PlayerRef Auto Actor Property MonsterToSpawn Auto Event OnInit() RegisterforUpdate(5) EndEvent Event OnUpdate() Marker1.PlaceAtMe(MonsterToSpawn.GetActorBase()) Marker2.PlaceAtMe(MonsterToSpawn.GetActorBase()) etc EndEvent Change RegisterForUpdate to how often you want the enemies to spawn. Then, you could modify that script with this tidbit for a kill count. Create a GlobalVariable called KillCount or something, and add this to above script. The function call goes at the bottom of OnUpdate() while the function itself goes at the bottom of the script. Function KillCount() Int KC = KillCount.GetValueInt() If PlayerRef.GetCombatTarget().IsDead() (KC.SetValue((KC.GetValue()) + 1) If KC >= 100 QuestName.SetStage(10) ;;10 being whatever the completion stage is EndIf EndIf EndFunction I'm not going to guarantee these will work flawlessly, but they should more or less get the job done. Actually, you don't need a global variable for the killcount. Just make an Int KillCount and you'll be good. Edited February 14, 2019 by Rizalgar Link to comment Share on other sites More sharing options...
Nanerinium Posted February 14, 2019 Author Share Posted February 14, 2019 Hey! Thank you so much for your quick response. I just tried your first script but I must be doing something wrong. I'm totally new to the creation kit and have never added scripts before. I simply double clicked on the actor that I wanted to respawn; went to the scripts tab and clicked "add"; selected "new script" and called it "EndlessEnemy"; and then copy/pasted 100% of the script you wrote into the text box. Is there something else I need to do? Thank you again! Scriptname EndlessEnemy Extends Actor ObjectReference Property SpawnMarker Auto Event OnDeath(Actor killer) If Self.IsDead() SpawnMarker.PlaceActorAtMe(Self.GetActorBase()) EndIf Utility.Wait(5) Self.Delete() EndEvent Link to comment Share on other sites More sharing options...
Rizalgar Posted February 15, 2019 Share Posted February 15, 2019 (edited) Yes. You need to add the properties to the script, otherwise the script doesn't know what it's referring to. To do this, in the actor tab where you added the script, click the script, then select properties, and add the appropriate values to the properties. This may provide some insight https://www.creationkit.com/index.php?title=Variables_and_Properties In this particular case, you need to set the marker. Do this by placing an X Marker where you want the enemy to respawn. Double click the marker, name it Spawn1, go into the script on the actor, properties, then select SpawnMarker and select Spawn1 Marker you placed in the world. Edited February 15, 2019 by Rizalgar Link to comment Share on other sites More sharing options...
Recommended Posts