kthonia Posted November 23, 2020 Share Posted November 23, 2020 (edited) So I'm working on a scripted boss fight. The boss encounter is in a large circular room, and the boss spawns on a platform in the middle. I have it so that the boss stays put at the spawn location by making him overburdened, because I just want him to stand still and cast magic at the player when the player is far away. When the player steps onto the platform, the boss becomes unburdened and starts melee combat, and if the player runs out of the ring then the boss will drop combat, run to the center, and then start combat again and stay in place and hopefully start casting spells. The problem I'm having is that if I'm far away enough, and sneaking, then I can just stay in stealth and keep getting sneak attacks with arrows while the boss doesn't do anything, and even though he should see me, he is not casting his spells at me... The detection icon in the middle of the screen is even lit up, but he still won't attack me half of the time if I am far away enough, even though I started combat with player via script. Also with console commands, I was testing what the detection level was after starting combat with getDetected Player and it usually returned -50 UPDATE: With more testing I've figured out that the problem is not that he isn't detecting me, its that there seems to be a set range at which he will cast a spell at me... He stands in place, and he always starts casting at the same distance.. I tried changing this in his combat style, but nothing worked. Edited November 24, 2020 by kthonia Link to comment Share on other sites More sharing options...
Oblivionaddicted Posted November 24, 2020 Share Posted November 24, 2020 (edited) So I'm working on a scripted boss fight. The boss encounter is in a large circular room, and the boss spawns on a platform in the middle. I have it so that the boss stays put at the spawn location by making him overburdened, because I just want him to stand still and cast magic at the player when the player is far away. When the player steps onto the platform, the boss becomes unburdened and starts melee combat, and if the player runs out of the ring then the boss will drop combat, run to the center, and then start combat again and stay in place and hopefully start casting spells. The problem I'm having is that if I'm far away enough, and sneaking, then I can just stay in stealth and keep getting sneak attacks with arrows while the boss doesn't do anything, and even though he should see me, he is not casting his spells at me... The detection icon in the middle of the screen is even lit up, but he still won't attack me half of the time if I am far away enough, even though I started combat with player via script. Also with console commands, I was testing what the detection level was after starting combat with getDetected Player and it usually returned -50You can probably do this by adding the player a capacity with the light effect through a scripted event. Edited November 24, 2020 by Oblivionaddicted Link to comment Share on other sites More sharing options...
kthonia Posted November 24, 2020 Author Share Posted November 24, 2020 With more testing I've figured out that the problem is not that he isn't detecting me, its that there seems to be a set range at which he will cast a spell at me... He stands in place, and he always starts casting at the same distance.. I tried changing this in his combat style, but nothing worked. So one work around I've found is to make an ai procedure for the boss to keep casting his spell when he is in his area, but I can't make the player the target in the "cast" type of ai procedure, so I have to get around that too by making him cast a "self" Script Effect spell, and in the script, on ScriptEffectStart it moves an activator above him and the activator ref casts the spell I want the boss to cast at the player. So now I'm just trying to get him to move back to the middle of the room (after the player crosses the start melee combat boundary) before the ai procedure to cast runs.. Which so far I've been unsuccessful :< Link to comment Share on other sites More sharing options...
Striker879 Posted November 24, 2020 Share Posted November 24, 2020 Just curious ... are we talking extreme distance here (as in multiple thousands of game units)? Link to comment Share on other sites More sharing options...
kthonia Posted November 24, 2020 Author Share Posted November 24, 2020 (edited) The farthest away from the middle of the room is like 2500 units, using the getdistance function in the console. And he starts casting spells at me when I'm around 1500 Edited November 24, 2020 by kthonia Link to comment Share on other sites More sharing options...
Striker879 Posted November 24, 2020 Share Posted November 24, 2020 If you are not sneaking does he start casting from beyond the 1500 distance? Link to comment Share on other sites More sharing options...
kthonia Posted November 24, 2020 Author Share Posted November 24, 2020 No, he still doesn't cast beyond 1500 even if I'm not sneaking. Link to comment Share on other sites More sharing options...
qwertyasdfgh Posted November 24, 2020 Share Posted November 24, 2020 There are game settings fMagicBallOptimalDistance and fMagicBallMaximumDistance (and similar ones for other projectile types), that determine the range at which actors use projectile attacks. This can be further modified by actor's Combat Style. Link to comment Share on other sites More sharing options...
kthonia Posted November 25, 2020 Author Share Posted November 25, 2020 Changing those values in the combat style doesn't seem to make any different at all :< Link to comment Share on other sites More sharing options...
JustChill Posted February 10, 2021 Share Posted February 10, 2021 Have you tried to use a scripted casting function onto your boss? <YourBoss>.Cast <YourSpell> Player You may try it like this: scn YourBossScript float fCastingTime Begin GameMode If GetDistance Player > 1000 if fCastingTime > 5 <YourBoss>.Cast <YourSpell> Player Let fCastingTime := 0 else Let fCastingTime += GetSecondsPassed endif endif End So now your boss should cast on the player every 5 seconds, as long as the player is further away than 1000 units.The GameMode should only run if you are nearby the boss, so I hope you are using it in an interior.As otherwise, it may try to cast spells onto your char even if he / she is far far away, as the GameMode of world space objects kicks in pretty early which could lead to bad results in that case. But if you use your boss only in a closed interior, it should work fine. :) Link to comment Share on other sites More sharing options...
Recommended Posts