Jump to content

DOWNLOAD MODS

Are you looking for something shiny for your load order? We have many exclusive mods and resources you won't find anywhere else. Start your search now...

LEARN MODDING

Ready to try your hand at making your own mod creations? Visit the Enclave, the original ES/FO modding school, and learn the tricks of the trade from veteran modders...

JOIN THE ALLIANCE

Membership is free and registering unlocks image galleries, project hosting, live chat, unlimited downloads, & more...

Random Patrol Actor


Darlanio
 Share

Recommended Posts

Hello Everyone,

I am trying to make my own mod for more immersive NPCs. So far I am able to spawn wolves and bandits that attack the player and take care of the garbage without crashes or savegame bloating, but I plan more...

I have some trouble making the spawned soldiers (Imperials and Stormcloaks) do start patrolling instead of just standing around. Plan is to create a LinkedReference at a random position and make them patrol to that point and back to their spawningpoint (ping-pong-patrol) or use Vanilla PatrolIdleMarkers so that spawned soldiers first move fromm their spawningpoint to a first vanilla PatrolIdleMarker, then ping-pong-patrol between that first marker and a second vanilla PAtrolIdleMarker.

I also have trouble with my spawned groups of bandits, which I want to remain at the spawned point and not attack player until they discover the player. So far I am able to walk up to them and actually kill them before they attack me. When I have hit one of them, the others starts to fight, but that is a bit too late. I would like them to attack the player as soon as they can see the player.

Spawntimer is done with RegisterForSingleUpdate(60.0), so every minute the script checks what can be cleaned up (far enough from the player) and respawned.

Since I am doing all in Papyrus and NOT using Creation Kit more than to set up quest and fill the properties, I have not found any example that provides the answers I need. I would be very happy if someone could type the lines of papyrus code needed for this.

 

From my script, only the rows for one of the imperial guards, taken out of the full script:

ScriptName DarlanioImmersiveNPCs extends Quest

Actor property PlayerRef Auto

ActorBase property LvlGuardImperial auto

...

Float Direction = Utility.RandomFloat() * 360

MyActor = PlayerRef.PlaceActorAtMe(LvlBanditAmbushMeleeEvenTonedM, 2)
MyActor.MoveTo(PlayerRef, Math.Sin(Direction) * SpawnDistance, Math.Cos(Direction) * SpawnDistance, 0.0)

...

 

Maybe I need something similar to what I use for the wolves and solo bandits:

MyActor.StartCombat(PlayerRef)

Maybe something like:

MyActor.StartPatrol(SomeLinkedReference) ?

 

Please write answer in form of Papyrus lines and explanation - I do not want to use Creation Kit more than necessary and I do not want to make specific markers in the Tamriel World...

Link to comment
Share on other sites

Can anyone describe how to do this (better than tutorial on

http://www.creationkit.com/index.php?title=Bethesda_Tutorial_Encounters

how to activate and apply patrol to a spawned actor (PlaceActorAtMe is called to spawn the actor, so it is not clickable in CK). Another page of intrest seem to be the incomplete page

http://www.creationkit.com/index.php?title=Default_Master_Package

but I can't figure out how to check (or where) that my actorbases (or if I need to make my own templates for the actors) if they have DMF active and how to set a linked ref to them.

Please let me know if you have read my question and just don't have an answer. When I posted I saw some threads have updated the last few days, but now it seems that this forum is completely dead...

Link to comment
Share on other sites

  • 3 months later...

I don't know if you can call a package on a spawned NPC in a script, but I have never tried to do it; you could try adding a package to the NPC you were spawning (obviously copy a vanilla one)

I don't tend to do it this way - I usually would have the NPCs as quest alias' and attach the package to the alias. I trigger the quest based on the location or locations that the player enters via story manager. It then requires little scripting - just a few fragments.

Edited by agerweb
Link to comment
Share on other sites

Join the conversation

You can post now and register later. 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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...