Jump to content

I plan a scene in a dungeon and need a little bit help


Recommended Posts

Hi guys.

 

For the new world space in my mod (http://www.nexusmods.com/fallout4/mods/19445/?) I have several dungeons in build.

 

By one of them I plan something special:

 

-The player should walk to the dungeon until he meet a special enemy.

-This enemy should first be friendly, because I plan that he say 1-3 sentences before he starts to attack the player.

-After he have say what he have to say, he should turn and be a enemy ->and<- another special enemy should spawn then behind the player.

 

So... how do I make this?

 

Btw. the both special enemys are RAD-Scorpions (I had just duplicate them in the ck and give them a unique id).

Edited by taryl80
Link to comment
Share on other sites

I don't know if there's a way to subscribe to a thread here on the Nexus website, but if there is I'd like to for this one. I want to know how to do this too (Edit: Found it.). Every item you've cited here, actually- the three lines of dialogue, the spontaneous transition of the NPC from neutral (or "friendly?") to foe, and the spawning of the additional enemy.

 

Anyway, I know it isn't much, but for what it's worth, here's a post. Maybe this extra comment will help make this thread stand out more to anyone browsing, including any users who know how to do this, and increase the chances they'll come, read and answer.

Edited by AnUnknownIncompetent
Link to comment
Share on other sites

Pretty easy. Set up your dialogue as normal. On whatever the last line is in the scene, add this script fragment to "Run On End" papyrus in the dialogue.

 

ACTORPROPERTY.StartCombat(ACTORPROPERTY2)

 

So if you want this guy to attack the player, and his name is Bob:

 

Bob.StartCombat(Game.GetPlayer())

 

Don't forget to set up an Actor property in the script called "Bob".

 

As for another actor spawning behind the player. Place an NPC where you want them to appear behind the player. Double click on them in the render window and the Reference Window pops up. Check the box "Initially Disabled". Make sure this NPC is part of a faction that's set to enemy with the playerally faction by default(or this the script above again.)

 

ACTORPROPERTY.Enable()

 

So, if the NPC you want to appear behind the player's name is Larry:

 

Larry.Enable()

 

And create an actor property called "Larry" that points to your new NPC. So on that line of dialogue, the whole fragment would be:

 

Bob.StartCombat(Game.GetPlayer())

Larry.Enable()

 

You could also have that line of dialogue set a quest stage, and put these papyrus fragments on that stage so it fires then. Hope this helps!

Link to comment
Share on other sites

I'm not sure I could muster a walk through on how to do it exactly, but that concept is possible.

 

Obviously a quest is needed, probably started with a trigger (maybe in the room, so that as you enter the room you enter the trigger).

Quickest way to learn dialogue is by checking how that's done in companions. Same with camera angles.

At some point, to make the 1st radscorpion become unfriendly, I'd say there will be a line of code/short script that changes its aggression level towards the player (setaggressionlevel...I think? ).

At that same time, a placeat call for a second radscorpion to be placed at coordinates (the coordinates part is where I completely fail at, ...possibly not use coordinates at all, maybe just place at an xmarker outside the doorway the player entered through and have the second baddie spawn at that).

 

I know it's not much, and someone else may walk you through it better or have a better idea, but also maybe that will give a head start at least.

 

Good luck.

 

Edit: Akav1r clearly had a better idea and clearer explanation while I was typing (truly not sarcasm). =)

...I might have to ask them when I start adding my quests, hehe. ;-)

Link to comment
Share on other sites

Hmpf something I make wrong.

 

I had set up a propertiy for npc 1 and 2 in the script. Also make a quest alias for each of them. I had put on the end of the last sentence then this script fragment:

 

AliasNPC1.StartCombat(AliasNPC1)
AliasNPC1.StartCombat(Game.GetPlayer())
AliasNPC2.Enable()

 

But I got this error message while compiling:

 

StartCombat is not a function or does not exist
StartCombat is not a function or does not exist
Enable is not a function or does not exist

 

Besides that, the quest dialogue did not appear. The visible radscoripion (npc 1) starts attacking on sight.

 

Have I may use not enough stages? I had only 1 stage build, with 3 phaes + the start phase. At the end of phase 3 I had try to implement the scriptfragment.

 

Conditions have I not use for this quest, besides the getid condition that points the quest and greeting topic on npc1.

Edited by taryl80
Link to comment
Share on other sites

Put "PlayerRef" actor property in your fragment and then do this:

(AliasNPC1.GetReference() as Actor).StartCombat(PlayerRef)

or if you do more stuff to those actors do this as first in the fragment:

Actor aAliasNPC1 = AliasNPC1.GetReference() as Actor

aAliasNPC1.StartCombat(PlayerRef)

also if you don't want to use property for player, do this instead of using Game.GetPlayer() multiple times in a row:

Actor aPlayer = Game.GetPlayer()
Actor aAliasNPC1 = AliasNPC1.GetReference() as Actor

aAliasNPC1.StartCombat(aPlayer)

Why your current thing doesn't work is, because you try use Actor function on ReferenceAlias, so you need to cast that RefAlias as Actor first. Same will work for Disable() too, since it's ObjectReference script and Actor is also ObjectReference.

 

If your Radscorpion is attacking at sight, you might need to lower his Aggression. Very aggressive will attack anything that is not Friend or Ally in his faction(s). You can put the scorpion in friendly faction, then use script to RemoveFromAllFactions() and after that AddToFaction(yourFactionProperty), that has player as enemy.

Edited by vkz89q
Link to comment
Share on other sites

Thanks you all for your help.

 

I have a good news and a bad. The good news is, that the script now work (I think, it should...), besides the enable part (the enable part still produces errors by compiling, but if I delete this part of the script it compiles).

 

The bad news is, that the rad-scorpion dialogue not start (and with it, not the script). I had already build many dialogue-quests and so I think, what I have make wrong is something small. Forgetting to set a checkmark, or so and to figure this out will need time, I'm afraid.

 

But as I said... (even if the outcome is not what was planned/actual), I thank everyone in this thread for his ideas.

Edited by taryl80
Link to comment
Share on other sites

  • Recently Browsing   0 members

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