Jump to content

[LE] How to make a boss flee?


Wolfstorm

Recommended Posts

I tried the RemovefromFaction(banditfaction) first, with the banditfaction assigned as a property, but it didnt work. Thats why I used RemovefromAllFactions.

The idea is to have him running away and then being disabled, disappearing from view. After the war is over, its follower version would be enabled. But I didnt find anything about it yet, only instructions to disable and enable via console. I want to use scripts for it.

He is running to Solitude because I'm only doing tests, and choose Solitude for it. This is not a definitive version, I'm just tinkering to find a solution.

Edited by Wolfstorm
Link to comment
Share on other sites

I'm running out of ideas, then.

I'm clutching at straws here, but when Bethesda do this sort of thing in a quest, they tended to do it in the quest stages and used the alias reference.

 

Example, from MQ106, stage 30...

 

;Delphine no longer treated as the innkeeper
Alias_Orgnar.GetActorRef().AddToFaction(RentRoomFaction)
Alias_Delphine.GetActorRef().RemoveFromFaction(RentRoomFaction)
Alias_Delphine.GetActorRef().SetRelationshipRank(Game.GetPlayer(), 2) ; make confidant

 

The bit about setting the relationship rank might be worth a try, too. Delphine has the JobRentRoomFaction on her base form and has no alias factions in that quest. The main quest script has the faction Property 'RentRoomFaction' added to the end of the code, so you'd need a 'BanditFaction' property added to your quest script in order to remove it this way. I'm also wondering if we're better off adding the script event to set this stage on the quest alias, which would have to be 'ScriptName 'Name' extends referenceAlias'. Set the stage here and do all of your 'StopCombat()', 'RemoveFromFaction(BanditFaction)' and possible 'SetrelationshipRank(Game.GetPlayer(), 2)' stuff in the stage fragment.

 

Worth a go?

Link to comment
Share on other sites

I decided to try another approach.
Instead of using a surrogate, have the follower herself go to the opposite side of the war.
I dropped the code used in the character tab, instead of it I'm going to use the AI packages.
I duplicated the follower AI package, and put the following conditions:

 

pl getquestcompleted quest: "CW01A" 0 OR
pl getquestcompleted quest: "CWObj" 1 OR

 

This would make the package stop working when the first imperial quest was completed, and return to work after the war is over. So I deleted the standard follower package from the follower, and put this one in its place.

 

Then I made three travel packages, where I was going to use fragments.
The fragments were not working initially, they just didnt compiled.
However, I removed the "property" and "auto" from the code, and it compiled this time. The code stayed like this:

 

Actor npcfollower
Faction CurrentFollowerFaction
Faction PotentialFollowerFaction
Faction PotentialMarriageFaction
npcfollower.RemoveFromFaction(CurrentFollowerFaction)
npcfollower.RemoveFromFaction(PotentialFollowerFaction)
npcfollower.RemoveFromFaction(PotentialMarriageFaction)

 

This was put in the "on begin" tab of the first travel package.
I'm omitting the name of the follower so that we can focus in the template.

As condition, the travel package have:

 

pl getquestcompleted quest: "CW01A" 1 AND

 

The "on end" tab have this code:

 

Actor npcfollower
Faction MQ101StormcloakFaction
npcfollower.AddToFaction(MQ101StormcloakFaction)
npcfollower.ModActorValue("health", 5000.0)

 

The travel destination is one of the Stormcloaks camps, pointing around a smithing device there, with radius set as 10.

The health is increased by 5000 points. The second travel package have as conditions:

 

pl getquestcompleted quest: "CW02A" 1 AND

s getactorvaluepercent health <=0.10 AND

 

So to not mess with her bleedout (she is still a essential npc) I set the health very high, and when it reaches 500 points she will run. This is the code on begin of the travel package:

 

Actor npcfollower
Faction MQ101StormcloakFaction
npcfollower.RemoveFromFaction(MQ101StormcloakFaction)
npcfollower.ModActorValue("health", -5000.0)

 

The destination would be the Dawnstar Inn. The third travel package have these conditions:

 

pl getquestcompleted quest: "CWObj" 1 AND

 

The destination would be her initial point of recruitment, and this code would be executed on end of the travel:

 

Actor npcfollower
Faction CurrentFollowerFaction
Faction PotentialFollowerFaction
Faction PotentialMarriageFaction
npcfollower.AddToFaction(CurrentFollowerFaction)
npcfollower.AddToFaction(PotentialFollowerFaction)
npcfollower.AddToFaction(PotentialMarriageFaction)

 

However, nothing of this is working. First, I open the console and check her health, and get 191 as value. Then, I set the stage of CW01A as 200, completing the quest. She is still following me, and her health is still 191. No code have fired, not even the first travel package is working. It seems the conditions wont work for AI packages, or I'm missing something.

Edited by Wolfstorm
Link to comment
Share on other sites

I think my idea about solving this by way of doing everything within the quest is still worth considering and much neater if it works.

 

Having said that, you can't assign properties to a package fragment right away, according to 'CreationKit.com'. I wouldn't know because I've never had to use them. According to 'CreationKit.com', when you create a fragment, you need to close the Package Dialog window and re-open it. Then you can assign properties. If you tried this and it still wouldn't assign properties the normal way (Faction Property MQ101Stormcloakfaction Auto, etc), I don't know. However 'Faction PotentialFollowerfaction' may compile but not do anything.

Link to comment
Share on other sites

The problem is that the quest papyrus fragment box is greyed-out (in quest stages tab). I cant write anything there.

I never created a quest before, only dialogues. My followers have dialogues explaining about their unique perks, but the quest stages (set by these dialogues) never opened that papyrus fragment box, its always greyed-out, so I dont have any idea how to do it.

I remember I tried to make a scene between two of my followers, but it never worked, they just dont talk to each other.

 

Thats why I tried the character window, and now the AI packages. But the conditions I put in the follower package are not working, so even if I close the dialog before setting properties (for the travel packages) it will not do too much, since the first package did not fire, and the travel packages depends in this one being disabled. I did not put any fragment in the follower package, only the two conditions.

Link to comment
Share on other sites

It's out of my depth, then.

 

I'm the opposite. I've only used quests for stuff like this.

 

BTW, you can't enter anything in the stage papyrus fragment until you give the quest an ID, close and re-open it. Then you still can't enter anything in it until you click in the 'log entry' box for that stage and select 'New'. You don't need to add an entry. You just need to put one in, even if it's empty. Now you can add script into the stage fragment to your heart's content!

Link to comment
Share on other sites

  • 2 weeks later...

Some things that may have helped along the way...

 

Writing a property line in the script is not enough. The property itself needs to be filled. The screenshot in one of the earlier posts showing where the script was attached indicated that the properties were not filled. A plus icon next to the script indicates that that script is attached. A plus icon with a small pencil next to the script indicates that that script is attached and had its property values defined. A script that has default values for integers, floats and bools may not need to have the properties defined. But a script that needs a specific actor does. Highlight the script in question, the property button should be available, click it, a new window appears with all properties listed, select one, the grey space on the right hand side has different input fields available depending upon the type of property, use those to assign the correct object(s). If any property variable has the same name as the intended object(s) editor ID, then the Auto-Fill button can fill those automatically.

 

Fragment scripts are functions housed on a larger script created by the Creation Kit specifically for the object containing those fragments. They cannot have property designations written within. In order to work with property variables they have to be added via the properties button. However, that won't be available until the script is created. To that end, entering a single semi-colon ( ; ), compiling the script, exiting the record and re-opening it will allow you to add the properties, assign the correct data and then enter the code as needed.

 

EDIT: Adjusted text due to automatic smiley replacement

Edited by IsharaMeradin
Link to comment
Share on other sites

IsharaMeredin, it took me ages to work that one about the properties and fragments out. I eventually tried sticking a remark and compiling as you say. Up until then i thought... what? I need a property but it won't let me add one. I need the script but it won't compile without the property... catch 22.

 

OP, in case you didn't know, I found when I need to use properties in stage fragments, you need to first edit the quest script and add the property after the list of fragments. Then you can use it in the fragment. Try to do it the other way around and you can end up in a real mess. If you haven't generated a quest script, use IsharaMeredin's tip and stick a ; in a random stage fragment and compile.

 

Hope you're getting somewhere.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...