Moonboy187 Posted January 18, 2022 Share Posted January 18, 2022 Hi, So I have been playing around with modding scripts and have taken a look specifically at the Yaga-Shura camp and Gromnir barracks as they are both instances I remember where hostile foes will keep respawning for a certain amount of time. I have been trying to replicate this in another area but I cannot seem to get it to work. The area in question is the restored D'Arnise hold, specifically during the final Roenall questline with the invading force. I am wanting to make a big battle take place, in which enemies will respawn continously until a particular enemy is killed which would then trigger a cutscene in which the player and party are teleported away. I have managed to get the cutscene activation working but cannot get the reinforcements concept to work. I tried creating Global triggers in which enemy units spawn in, which they do but its just a single wave of enemies. My other alternative was to make .bcs scripts so that when particular enemies die they spawn in other people elsewhere, but that feels way too cumbersome and time consuming. Is there an easier way to go about this? Any help would be appreciated, thank you. Quote Link to comment
jmerry Posted January 19, 2022 Share Posted January 19, 2022 Taking those areas as examples, how do they control the flow of reinforcements? For the barracks, there are two variables - a counter "Reinforce" and a timer "ReinforceTimer". When the timer runs down, a group of reinforcements comes in, incrementing the counter and resetting the timer. Once the counter gets high enough, reinforcements stop. For the siege camp, the reinforcements are controlled by several counter variables; MaxSpawn, ExtraCount, ExtraCount2, ExtraCount3, plus a Delay command. Once the event starts, if ExtraCountN is below a certain value and MaxSpawn is below its cap, one reinforcement of that type spawns in, and both MaxSpawn and ExtraCountN increment. When you kill an enemy, that decrements ExtraCountN; that's essentially a count of how many enemies of that type are out. The Delay(6) command puts a wait into things; you get about a round after killing an enemy before the new enemy comes in. Also, there's a termination clause if you reach Yaga-Shura, even if you haven't reached the cap on total enemies. The decrement on the ExtraCountN variables deserves special attention; that's a bit in the creature's script, rather than the area's script. If you use this tool, you'll need dedicated creatures for the event you're building. There are a couple other reinforcement areas in ToB; the orc horde AR3025 in Watcher's Keep and the slave corridor AR6102 in Sendai's enclave. The former uses a counter for how many creatures are active like the siege camp, and ends the encounter on a timer rather than a strict number of enemies. The latter uses timers like the barracks, only with no cap on how many enemies can spawn in total; you instead progress the event by moving forward and talking to the Slavemaster. In all four cases, the bulk of the reinforcement logic is in the area scripts. I hope that helps - make sure to understand the logic of whatever reinforcement method you choose for your own event. You should be able to reproduce one of these patterns with appropriate changes. Quote Link to comment
Moonboy187 Posted January 20, 2022 Author Share Posted January 20, 2022 Thank you so much for the reply and the explanation, I was not sure about how the variables worked out and couldn't figure out when I had implented it as a test why it was not working correctly. When I had used the Yaga Shura camp script which spawns enemies off screen, I had assumed it would place them near from where Player1 was located. But in the case of the AR1304 D'Arnise hold restored, the placings of the spawns were really randomly placed , some extremely far out. I had also tested using Gromnir barracks, as that used a transition in order for the solider to reach and then leave, subsequently returning with reinforments, but when I tried to use that method and had coded a particular script for one of the npcs to move there, he just did not respond and kept looping the string overhead words. I will try again today and post the code I use in the hopes that it might actually work this. Thank you again for your help ! Quote Link to comment
tipun Posted January 20, 2022 Share Posted January 20, 2022 If you are using the EE version, then you can use an ini file with the name of the location for reinforcements. There, to create each enemy, you can choose different positions in which it will appear. Spoiler [locals] [spawn_main] events=1_SECOND [1_SECOND] critters=DRUM_SUMMON_A,DRUM_SUMMON_B,DRUM_SUMMON_C,DRUM_SUMMON_D interval=15 [DRUM_SUMMON_A] cre_file = 30gobWRS spec = [0.0.0.0.200] ai_specifics = 200 script_name = DRUM_SUMMON_A spec_var = AR3000_DRUM_SUMMON spec_qty = 1 create_qty = 1 ignore_can_see = 1 spawn_point = [0363.0482:0],[2135.0594:0],[3358.0884:0],[0719.1851:0],[2021.1586:0],[3138.1719:0],[0430.2641:0],[2387.2786:0],[3467.2475:0] point_select = R script_Override = WR3000SA script_Specifics = 00WorgX script_Class = 30WrgSpn script_Race = 00aAtGN script_Default = 00aMvFP [DRUM_SUMMON_B] cre_file = 30gobWRS spec = [0.0.0.0.201] ai_specifics = 201 script_name = DRUM_SUMMON_B spec_var = AR3000_DRUM_SUMMON spec_qty = 1 create_qty = 1 ignore_can_see = 1 spawn_point = [0363.0482:0],[2135.0594:0],[3358.0884:0],[0719.1851:0],[2021.1586:0],[3138.1719:0],[0430.2641:0],[2387.2786:0],[3467.2475:0] point_select = R script_Override = WR3000SB script_Specifics = 00WorgX script_Class = 30WrgSpn script_Race = 00aAtGN script_Default = 00aMvFP [DRUM_SUMMON_C] cre_file = 30gobWRS spec = [0.0.0.0.202] ai_specifics = 202 script_name = DRUM_SUMMON_C spec_var = AR3000_DRUM_SUMMON spec_qty = 1 create_qty = 1 ignore_can_see = 1 spawn_point = [0363.0482:0],[2135.0594:0],[3358.0884:0],[0719.1851:0],[2021.1586:0],[3138.1719:0],[0430.2641:0],[2387.2786:0],[3467.2475:0] point_select = R script_Override = WR3000SC script_Specifics = 00WorgX script_Class = 30WrgSpn script_Race = 00aAtGN script_Default = 00aMvFP [DRUM_SUMMON_D] cre_file = 30gobWRS spec = [0.0.0.0.203] ai_specifics = 203 script_name = DRUM_SUMMON_D spec_var = AR3000_DRUM_SUMMON spec_qty = 1 create_qty = 1 ignore_can_see = 1 spawn_point = [0363.0482:0],[2135.0594:0],[3358.0884:0],[0719.1851:0],[2021.1586:0],[3138.1719:0],[0430.2641:0],[2387.2786:0],[3467.2475:0] point_select = R script_Override = WR3000SD script_Specifics = 00WorgX script_Class = 30WrgSpn script_Race = 00aAtGN script_Default = 00aMvFP Here new enemies appear when AR3000_DRUM_SUMMON=1. And the new DRUM_SUMMON_A will appear only after the previous one is killed. Likewise with the rest. Quote Link to comment
Moonboy187 Posted April 11, 2022 Author Share Posted April 11, 2022 Thank you guys so much for your help, its very much appreciated ! Quote Link to comment
Recommended Posts
Join the conversation
You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.