Hannibalektr Posted February 26, 2013 Share Posted February 26, 2013 (edited) First, you have to put an activator (let's say a pullchain). Then, you have to put an xmarker (type xmarker in the filter box and select *all) in the cage you want. Then double click on the activator reference, go to scripts, add, new script. Give it a name (let's say SpawnChainSCR) and leave ObjectReference as the type. Right click on the script and click "edit source". Now paste this Scriptname SpawnChainSCR Extends ObjectReference import game import debug ActorBase property myNPC auto ObjectReference property SpawnPlace auto Event OnActivate(ObjectReference akActionRef) SpawnPlace.PlaceActorAtMe(myNPC, x) EndEvent Where x is the difficulty of the encounter (0-4). If the NPC doesn't attack you, replace the placeatme stuff with SpawnPlace.PlaceActorAtMe(myNPC, x).StartCombat(Game.GetPlayer()) Save the script and exit. Then double click on the script and edit the properties values with the stuff you want (so myNPC with any actor you want and SpawnPlace with the xmarker). This script will spawn a NPC everytime you activate the pullchain. You can also spawn different enemies depending on how many times you activate it, but it's a bit more tricky. Let me know Worked like clockwork.. gangbusters! thanks and kudos for putting this quick and easy script to just get it done. That was the last thing I wanted in my instance.. finally i can take a break. BTW if this doesnt compile for you (as it didnt for me), I had to put a real npc name and give the x a number, I used 4. That compiled fine.. then you adjust the variables as he says. Edited February 26, 2013 by Hannibalektr Link to comment Share on other sites More sharing options...
Flanderino00 Posted June 1, 2013 Share Posted June 1, 2013 First, you have to put an activator (let's say a pullchain). Then, you have to put an xmarker (type xmarker in the filter box and select *all) in the cage you want. Then double click on the activator reference, go to scripts, add, new script. Give it a name (let's say SpawnChainSCR) and leave ObjectReference as the type. Right click on the script and click "edit source". Now paste this Scriptname SpawnChainSCR Extends ObjectReference import game import debug ActorBase property myNPC auto ObjectReference property SpawnPlace auto Event OnActivate(ObjectReference akActionRef) SpawnPlace.PlaceActorAtMe(myNPC, x) EndEvent Where x is the difficulty of the encounter (0-4). If the NPC doesn't attack you, replace the placeatme stuff with SpawnPlace.PlaceActorAtMe(myNPC, x).StartCombat(Game.GetPlayer()) Save the script and exit. Then double click on the script and edit the properties values with the stuff you want (so myNPC with any actor you want and SpawnPlace with the xmarker). This script will spawn a NPC everytime you activate the pullchain. You can also spawn different enemies depending on how many times you activate it, but it's a bit more tricky. Let me know this one don´t work for me. i can compile the skript without errors but when i start giving it Propertys it do not compile.CK drops the edited propertys outside the Script and returns me a compiling error. if i fix it manualy by putting it inside the event the compiler works flawless but the script do not work in the game :/ Link to comment Share on other sites More sharing options...
QaxeIsKaze Posted February 13, 2016 Share Posted February 13, 2016 (edited) By the powers of necromancy I bring back this thread! I appreciate this old thread. Worked really well for me too several years later. I wonder though, does anybody know what I might add to this script to get more than 1 enemy spawning in at 1 time? Flip the lever/button and 3 giants appear and so on. Thanks. Edited February 13, 2016 by Ahondara Link to comment Share on other sites More sharing options...
ThadeusCalvin Posted June 7, 2016 Share Posted June 7, 2016 First, you have to put an activator (let's say a pullchain). Then, you have to put an xmarker (type xmarker in the filter box and select *all) in the cage you want. Then double click on the activator reference, go to scripts, add, new script. Give it a name (let's say SpawnChainSCR) and leave ObjectReference as the type. Right click on the script and click "edit source". Now paste this Scriptname SpawnChainSCR Extends ObjectReference import game import debug ActorBase property myNPC auto ObjectReference property SpawnPlace auto Event OnActivate(ObjectReference akActionRef) SpawnPlace.PlaceActorAtMe(myNPC, x) EndEvent Where x is the difficulty of the encounter (0-4). If the NPC doesn't attack you, replace the placeatme stuff with SpawnPlace.PlaceActorAtMe(myNPC, x).StartCombat(Game.GetPlayer()) Save the script and exit. Then double click on the script and edit the properties values with the stuff you want (so myNPC with any actor you want and SpawnPlace with the xmarker). This script will spawn a NPC everytime you activate the pullchain. You can also spawn different enemies depending on how many times you activate it, but it's a bit more tricky. Let me know Thanks gasti89, This is very clear and worked perfectly. I'm respawning goats for my werewolf faster than you can say Colonel Sanders. Link to comment Share on other sites More sharing options...
joshep1986 Posted September 6, 2016 Share Posted September 6, 2016 Hi all i have one problem with the second script. I use it and is working but, the npcs spawn in wrong place not in the xmarker point. The npcs spawn out of the room in the void of the cell. Can you help me¿? Link to comment Share on other sites More sharing options...
Korodic Posted September 6, 2016 Share Posted September 6, 2016 Did you set the property properly for SpawnPlace?Assuming you did, the issue is likely that you did not navmesh the area if it is a new cell you are making. Link to comment Share on other sites More sharing options...
joshep1986 Posted September 6, 2016 Share Posted September 6, 2016 (edited) Did you set the property properly for SpawnPlace? Assuming you did, the issue is likely that you did not navmesh the area if it is a new cell you are making. Yeah, you're right Korodic, the navmesh. I figured that would be the mistake and I've solved it (I had to look for a video tutorial in goggle) but I got it. Thanks for your quick response. :smile: Edited September 6, 2016 by joshep1986 Link to comment Share on other sites More sharing options...
Recommended Posts