cumbrianlad Posted January 10, 2020 Share Posted January 10, 2020 Your script should have a line like this at the top: Scriptname MBRVstealthSpiderLevellingScript extends Actor if it doesn't, that's likely what's giving rise to all the errors. Edit: the 'If' statement isn't wrong, it's just that i don't think it's needed, as long as you set the bleedout for the actor appropriately. Obviously, the name will not be the same! that's just the name I gave to a script that alters the actor's spells as the player levelled up. Link to comment Share on other sites More sharing options...
maxarturo Posted January 10, 2020 Share Posted January 10, 2020 Create a new script > give it a name > extend ACTOR > edit source the script > copy/paste it > save to compile. * You can also edit your first script but in the "extend" should be "Actor" and not "ObjectReferece". * The event i used was random (i used the first it came to mind) and as cumbrianlad point it out it dosen't makes too much sence, it was just an example to show how to write your script, check and use another actor event. You can also use "OnHit()". Link to comment Share on other sites More sharing options...
Wolfstorm Posted January 10, 2020 Author Share Posted January 10, 2020 (edited) Your script should have a line like this at the top: Scriptname MBRVstealthSpiderLevellingScript extends Actor if it doesn't, that's likely what's giving rise to all the errors. Edit: the 'If' statement isn't wrong, it's just that i don't think it's needed, as long as you set the bleedout for the actor appropriately. Obviously, the name will not be the same! that's just the name I gave to a script that alters the actor's spells as the player levelled up. Now it compiled. This is the end result: Scriptname StopCombatTest extends ActorActor Property ___EncBandit02Boss1HImperialM_TEST Auto{Link Ref the Actor} Event OnEnterBleedout() If ( ___EncBandit02Boss1HImperialM_TEST.GetActorValue("Health") <= 0.10 ) ___EncBandit02Boss1HImperialM_TEST.StopCombat()EndifEndEvent Now I'm going to test in-game, I will put the test boss in Potema's catacombs, first level. Edit: well, it didnt work. I just kept hitting him until his health dropped to zero. Then he dropped to his knees for some seconds, rise up and started fighting again with full health, like any essential character do. Maybe I put the script in the wrong place? Edited January 10, 2020 by Wolfstorm Link to comment Share on other sites More sharing options...
cumbrianlad Posted January 10, 2020 Share Posted January 10, 2020 It sounds like he's not going into bleedout. I had this just recently with my new pet follower. it turned out I hadn't assigned the 'Bleedout Default' in its class. have you assigned a 'Class' to the actor, or edited the 'Bleedout Override' in his 'Stats' tab? If not, that explains why he's going to zero and MaxArturo's event isn't firing. MaxArturo, I think the event you suggested first was a good one. It seems ideal for what the OP is trying to do, especially if the OP alters the 'Bleedout Override' to something like 0.5 or 0.6. OP. I notice from your screenshot that your actor is flagged as 'Essential'. You do realise this means he can't be killed by the player or anyone? If that's your intention, then fine. If not, un-check that box. The script being on the actor is fine. You could also have added it to a quest alias, if he has one. Putting it on the actor just means that this will always be his behaviour when someone hits him hard enough... Milk Drinker! Putting it on his alias, will mean he'll only be a Milk-Drinker while he's in the alias for that quest. Edit: the event 'OnHit' will also work fine, but it will fire every time he's hit. That's maybe OK for the OP and it gives them another choice. If the OP opts to alter the actor's confidence, though, even if that's reset as I suggested by an OnUpdate event, or a 'Wait' utility, it could get very tiresome for the player running around after our cowardly boss! Link to comment Share on other sites More sharing options...
cumbrianlad Posted January 10, 2020 Share Posted January 10, 2020 I've just had another thought about the 'Essential' flag. You can have him essential, either on his base form, as you have done, or on his quest alias. The advantage of the latter is that he can be only 'Essential' when he's being used in your quest. You can alter that at any time, though in a quest or by a script running on a trigger, for example. To alter it in a quest, simply add the line to a stage papyrus frament, as below: When you set this stage he becomes 'killable'. Alias_MyBoss.GetActorRef().GetActorBase().SetEssential(False), where MYBoss is the name you gave to the actor's alias.I know you aren't asking about this but i thought it could be useful. Link to comment Share on other sites More sharing options...
Wolfstorm Posted January 10, 2020 Author Share Posted January 10, 2020 (edited) His class is EncClassBanditMelee. There was nothing in the bleedout override. I set it to 6. It didnt accept 0.6, only full numbers. He stopped fighting when his health reached zero, not 10%, and he stucked in this animation: Question now would be to make him sheath his weapon and flee to some place, maybe the default location of Solitude, and after that, disable him from the game. Edit: he sheathed the weapon in a second run, but then attacked me again when he saw me. Maybe removing his faction through script could solve this? Edited January 10, 2020 by Wolfstorm Link to comment Share on other sites More sharing options...
Wolfstorm Posted January 10, 2020 Author Share Posted January 10, 2020 (edited) Actually, the question revolves around two of my characters, which will join the Civil War in opposite sides, in two different playthroughs. In my playthroughs, I turn my other characters into followers using racemenu and nifmerge. In this case, the follower joining the Civil War in the opposite side, would be disabled in a specific esp (in CK, not through the console) and a duplicate would be put in a enemy camp. Then my player character in that playthrough would fight him, but would not kill him. Instead, the follower surrogate would run to a specific place and be disabled. There was another idea of disabling the follower through script and then re-enabling him after the fight, but I think it would be too much scripting. Edited January 10, 2020 by Wolfstorm Link to comment Share on other sites More sharing options...
cumbrianlad Posted January 10, 2020 Share Posted January 10, 2020 That bit about not accepting decimals for the 'Bleedout Override' must be an error on my part. i've never used it. I'm assuming now that it uses a percent figure, rather than a decimal, like it does in the 'Class' form. CK is full of oddities like that. In that case, try setting it to 60, rather than 6, or else it could easilly be the case that you whack him from 7% to 0% in one hit. Alternatively, set his 'Bleedout Default' to 0.6 in a new class and give him that class. It's definitely decimals that are used there. Maybe Maxarturo's 'OnHit' event would be better for your purpose? To get him to flee to Solitude or anywhere else, with his weapon sheathed, you'll be best giving him a travel package in the script, which was the other one of my options to get him to be a Milk-Drinker and run away. Create a new package, give it an ID. Set its template to 'Travel'. Leave the rest on that tab, as is but edit the location you want him to run away to. Give it a small radius like 10 or something.You can set the radius to '0' but that may cause issues with him never completing the package. Now go to the flags tab of the package. Click preferred speed and set it to 'Run', or else he'll plod there and we don't want that. Also tick the 'Weapons Unequipped' box. that will make him sheathe his weapons or spells when he runs away. You can tick or un-tick any of the other boxes, too. To ensure he gets there as quickly as possible, un-tick 'Greet Corpse Behaviour', or else he'll stop to inspect every dead body he encounters on the way. UN-tick 'Hellos To Player', since I don't reckon he wants to talk to you after you whacked him on the head. The other flags you can play around with. Also in the template, you'll see conditions. You can set these to be at a certain stage of your quest, or whatever else, so that he won't run away as soon as the game loads. we need to hit him first! You can leave him with that one package, if you like. If he's needed later in another quest, the best place to add his package would be to his quest alias.although if it's conditioned correctly, you can just add it to his actor form. If you want him to sandbox in Solitude, you could add a trigger box around his destination that's 'default set stage'. that sets a new stage in your quest and if his package is conditioned to be only valid for the previous stage, he'll then stop standing on the spot and use his next package that is lower in his package list. You could make that package a 'Sandbox' package and have him wandering around the Winking Skeever'. You'll need to condition that package, too or else he'll go for a pint of mead when he's meant to be fighting you, if you put the package on the actor. This is where packages on the alias are really powerful... they take precedence over any packages on the 'Actor' form, so whilst in his alias, he'll ignore all thge packages on his actor form. Edit: I've been meaning to say in each post that I love your idea of a 'cowardly' boss! It's something not done in the game and as far as I know it's different and maybe unique to your mod... I love 'different and unique'! It will help to set your mod apart from the others. Lateral thinking... that's what the vanilla game lacks! Link to comment Share on other sites More sharing options...
Wolfstorm Posted January 10, 2020 Author Share Posted January 10, 2020 (edited) I made a new class, and there I could set the bleedout in decimals. Put it 0.6, then assigned the class.The if command is not needed, since the event already calls the condition, and the if is not working anyway. But I was having a problem where he stopped fighting, then started again when he saw me or when I tried talking to him. Its a situation similar to when your followers detect a thread, you hit stopcombat on console and they start combat again. The code is like this now: Scriptname StopCombatTest extends ActorActor Property ___EncBandit02Boss1HImperialM_TEST AutoEvent OnEnterBleedout() ___EncBandit02Boss1HImperialM_TEST.StopCombat() ___EncBandit02Boss1HImperialM_TEST.RemoveFromAllFactions()EndEvent However he is not removed from the Bandit Faction. I open the console, click on him and type getinfaction 0001BCC0 and it always returns 1, even after the bleedout state.I tried with a new script which I put together with the stopcombattest, only to remove him from all factions, and still didnt work. The travel package is working all fine, I put as conditions his own id and health below 10%. The target is a sack near the smith in Solitude. I set the radius as 10.But then I followed him, and this is what happened outside castle Dour (dont mind the black face, I didnt generate a face for him): He started attacking everybody, because he is still in the Bandit Faction. How do I remove it? Edit 1: Maybe if I use the delete function it could prevent him from attacking people?In fact, he would need to be disabled or deleted after the fight, since he is a friend of the character, just happening to be in the other side of the war. And he is meant to be a surrogate of the follower npc.The function would need to activate after he finishes his package, travelling to the sack in Solitude. Edit 2: I tried to use the OnLocationChange event, experimenting with the disable function (with fade-out) first: Scriptname DeleteTest extends ObjectReferenceObjectReference Property ___EncBandit02Boss1HImperialM_TEST AutoEvent OnLocationChange(Location PotemasCatacombs01, Location SolitudeCastleDourDistrict2) ___EncBandit02Boss1HImperialM_TEST.Disable(true)EndEvent The script compiled, but it didnt trigger when I entered the Castle Dour District. The npc was still there, attacking the guards. Edit 3: there is a begin/end/change tab in the travel package. I tried to put the code in the end window, but it didnt compiled. The only time I dealed with these fragments in the past was when I set dialogues in my follower mod, something like this:GetOwningQuest().setObjectiveDisplayed(20)GetOwningQuest().SetStage(20) What would be the structure to disable the npc with fragments? There is no need for the event OnLocationChange because its already being called by the package. I tried this: ObjectReference Property ___EncBandit02Boss1HImperialM_TEST Auto___EncBandit02Boss1HImperialM_TEST.Disable(true) But it didnt compiled, returning the message: "no viable alternative at input 'Property'". If I let only the last line, it says: "variable ___EncBandit02Boss1HImperialM_TEST is undefined". If I can disable him after he finishes the package, then there will be no need to remove his faction. Edited January 10, 2020 by Wolfstorm Link to comment Share on other sites More sharing options...
cumbrianlad Posted January 10, 2020 Share Posted January 10, 2020 Hmm... Before I try to get my head around the rest of the problem, I'd be wary of the package condition that his health is below 10%. It may not be, especially since you set his bleedout to 0.6 in his new class. I'll confess I've never used 'RemoveFromAllfactions(). I don't know how reliable it is. The CK pages don't say anything useful about it either. If the only issue is the bandit faction, which it should be if he's modelled on an ordinary bandit, can you not try 'RemovefromFaction(banditfaction) and add the bandit faction as a property? at least then, we know we're removing him. That way, if it works it may also stop him attacking the player when he comes out of bleedout, although I don't know how the game engine handles things like this. It's a very unusual scenario. Good to know the package is working, though... even if he does attempt to slaughter all of Solitude. I don't know... Milk-Drinker and running away from a single opponent one minute, homicidal berserk terrorist the next! You just don't get the right class of bandits these days. Wacky humour aside, I noted that you said he could be disabled once he completes his package. That implies he's never needed again and doesn't actually need to go to Solitude. We need to sort him attacking the player when he comes out of bleedout, that's for certain. but to be on the safe side, why send him to Solitude? Why not the top of an obscure mountain? He could potter off up to the top of the mountain, killing nothing more than the odd goat, fox or rabbit and we disable him there. To disable him with fragments, I've only ever done that in quest stage fragments via an alias. The line is... Alias_MyAlias.tryTodisable() This could still be used if he sets a stage in the quest when he gets to his destination. Link to comment Share on other sites More sharing options...
Recommended Posts