Jump to content

[LE] Dynamic Follow Package


Recommended Posts

An undocumented aspect of AI packs, is you can fast forward to the immersive part instantly so to speak via disabling/enabling. Good example would be mounted refs. If you place the ref and the horse in a certain way, the actor will spawn onto the horse's back directly ready to go. Could be invoked this way for a mini army scenic summon

 

Rider.DIsableNoWait(); Or Place the rider using initiallydisabled flag

Utility.Wait(0.1); This is basically the important line, which makes this happen

Rider.Enable()

 

Assuming prereqs like traveling to the horse are meetable, the rider skips those and will appear on the horse. Kinda hard to explain, but basically that slight Wait() time can and does greatly affect AI processing

Link to comment
Share on other sites

Well I guess there is a function like GetsRideable() or IsRideable? Then I could add that. As I just move the objects to the player, it will be on top of him/her. There is however a cool script made for placing the item in from of the player, using Cos and Sin, and radiants. I better check how MoveTo() actually works in Skyrim, maybe it uses degrees instead of radients?

 

That seems very cool, but if we spawn a chest, and we try to force the rider to mount it, it would look a bit weird. :D I even think all references except static could be summonable really. They are in Oblivion at least. Moveto a static never works good, if it is not an Xmarker, not in Oblivion at least.

Link to comment
Share on other sites

When moving actors you need to 'Disable' and then enable them (as meantioned further above), because under the condition:
"If an actor is already in the cell, and the player is also in the cell, leaving the cell, or arriving in the cell, MoveTo() does not function"
Using 'DisableNoWait()' and 'EnableNoWait()' fixis this issue with actors.
Here you have a 'Move To Player' function that i use with one of my follower droids, it's actually a simple code that runs some math, it's just part of the script, the part that interests you:
FUNCTION TelepCall(Actor akCaster)
      float az = akCaster.GetAngleZ()
      Actor.SetAngle(0.0, 0.0, az + 180.0)
      Actor.DisableNoWait()
      Actor.MoveTo(akCaster, 200.0 * Math.sin(az), 200.0 * Math.cos(az), 0.0, false)
      Actor.Enable(true)
ENDFUNCTION

 

This will move and in my case teleport the actor 2 meters in front of the player in a rotation facing the player.

Edited by maxarturo
Link to comment
Share on other sites

MAX!!! That is awesome!!! That is what I do with all my stuff I summon in Oblivion, except we are forced to use radiants, some odd values I never used before calcutaing circles and degrees nor when I used trigonometry, and the distance to the object is the same as well. Well some stuff I summon to 180 from the player, like a chest. :smile: If you do not mind, I will use your function as it is :D Perfect. with 180 degrees, it will face the player as well right?

 

Hmm, I do not recall when I was forced to use radiants, as I did peek at those functions now in Oblivion CS wiki, well NM. It is degrees there as well.

 

-------------------------------------------------------------

 

Problems!!!! :D

 

 

Well Fish sings about him self really and his old drummer I guess. Never Mind, lets go back to scripting PROBLEMS!!!! :D I did had some email contact wit that drummer and when I ask if this song is about him and Fish, he ignores the question. Well Fish was alcoholic and did have problems. :D I do have problems as well, we all have problems: :wink:

 

Wrong song, the song about their fight is this one, well I suspect it is so as they did fight for real, the last time they met in person. So it is the new drummer playing this:

 

Never Mind. So funny... ;)

 

So I made a Mark spell and it works, I get the target as well. As it is a actor, well then we cannot target chests or any references but it is really actors mainly I want to be able to mark and summon. First I thought I was gonna be able to use formlists, but when we edit a formlist, then we see it wants the EditorValue and for me it is equivalent to BaseID. I do want the targets to be held in an array, so I made one inside a quest script.

 

We Start with the quest script:

Scriptname PekRefsSCR extends Quest conditional
{Holder for ObjectReferences}

 ObjectReference[] SummonAbleRefARR
 
Event OnInit()
	SummonAbleRefARR = New ObjectReference[10]
EndEvent

So in my world, the Oblivion world that is, if we add a script to an object or a quest, we call a variable from the QUEST or from the Reference running the scipts. Like this:

 

MyQuest.MyVariable

or

MyReference.HisVariable

 

as it is never the scripts them self we call. I do recall when I used Self(), I did not get the Spell name or my char as I got the Scriptname as GetSelf() do get the one effected by any script or effect or whatever in Oblivion at least. Well never mind, I did get the scriptname and that was not what I did expect, but I also noticed a single Object or reference can have multiple scripts, so ... I think I get it. I must specify the script as well somewhere when I want to read the crossreference variable right? Damn Skyrim :D

 

Well, I did read a lot of postings about this but the penny did not fall down. So maybe you can light up my day some and make me more wise? So I made a simple test to see if I was able to contact the quest... Which the compiler really disliked. :D

Scriptname PekMarkTargetRef extends ActiveMagicEffect  

Quest Property PekRefsQST  Auto  

Event OnEffectStart(Actor akTarget, Actor akCaster) 

	ObjectReference Testactor

	MiscUtil.PrintConsole ("Caster is: " + akCaster as String)
	MiscUtil.PrintConsole ("Target is: " + akTarget as String)

	PekRefsQST.SummonAbleRefARR[0] = akTarget
	Testactor = PekRefsQST.SummonAbleRefARR[0]
	
	MiscUtil.PrintConsole ("Target in Quest is: " + Testactor as String)	
	
EndEvent

I add the error code as well, not that you need it I guess :D

Starting 1 compile threads for 1 files...
Compiling "PekMarkTargetRef"...
I:\The Elder Scrolls - Skyrim - Special Edition\Data\Source\Scripts\temp\PekMarkTargetRef.psc(12,12): SummonAbleRefARR is not a property on script quest or one of its parents
I:\The Elder Scrolls - Skyrim - Special Edition\Data\Source\Scripts\temp\PekMarkTargetRef.psc(12,12): only arrays can be indexed
I:\The Elder Scrolls - Skyrim - Special Edition\Data\Source\Scripts\temp\PekMarkTargetRef.psc(12,11): type mismatch while assigning to a none (cast missing or types unrelated)
I:\The Elder Scrolls - Skyrim - Special Edition\Data\Source\Scripts\temp\PekMarkTargetRef.psc(13,24): SummonAbleRefARR is not a property on script quest or one of its parents
I:\The Elder Scrolls - Skyrim - Special Edition\Data\Source\Scripts\temp\PekMarkTargetRef.psc(13,24): only arrays can be indexed
No output generated for PekMarkTargetRef, compilation failed.

Batch compile of 1 files finished. 0 succeeded, 1 failed.
Failed on PekMarkTargetRef

No where did I really see how they set or get the variables from the quest script... I also looked in similar mods, but those modder's did not provide their sources.

I always provide my source, even in Oblivion, as TES4 files for Notepad as maybe it will make someone more wise? Maybe? Another modder complained I did, as I have so many files anyway :D It is just textfiles... But still, each will eat up a single cluster on the hard drive, at least, no matter size. :wink:

Edited by Pellape
Link to comment
Share on other sites

Well I do not know what an alias is. I am from Barcelona,

 

 

Well I am from Sweden actually, but I do feel bit like Manuel right now. :D

 

I should look up Aliases, but still, how do I call it from my spell script? Or where do you suggest I store the references for cross referencing? I do want a proper place to store them, that feels right and also right and easy to access. This is how I do it mainly in Oblivion, well how most scripters do things in Oblivion really, that I have contact with.

 

We use Quests as much as possible, both to have high performance but also as it is so easy in Oblivion. Using scripts at Objects and References in that game, will have huge impact on Performance, specially if you have lods of scripted stuff in the same cell. Oblivion will prioritize the scripts, and give a sh't about the performance. Skyrim seems to do vice verse. The sell stuff auto I made, would have sold everything within a single frame, here it takes 1 object in a second, or 1 every 5 second or something in between. :D I use a sorting script in Oblivion with 3000 objects I guess it is now. It runs within a second. BANG!!!! Done, everything sorted. :D I do guess Bethesda saw this as a problem, and changed it to how it works in Skyrim, as scripts usually do not need that high priority or need to run every FPS. But the loops in Skyrim are made by Bethesda and the Loops in Oblivion by the OBSE team, and they do things differently, OBSE is the equivalent to SKSE. So therefor I use Quest Scripts as much as I can, as they run every 3rd or 5th second by default and if they only need to run in a specific cell, I even use GetParentCell() which gives the cell ID, name and every info we need about the current cell. Everything to optimize as much as possible as we need to do that in that old game at least :D If I need it to run every second or twice, there is a Global for it that we set, or a GMST, so when we use it, it is only for the calling quest script, no other quests. Very convenient.

Edited by Pellape
Link to comment
Share on other sites

  • Recently Browsing   0 members

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