Jump to content

Questions on Packages


Halstrom

Recommended Posts

Posted

I haven't done any of this package stuff before so I'm a bit out of water.

 

What I want to do is have an NPC Patrol an area, killing any random aggressive critters with a gun etc.

 

But if it spots a female it will walk up to them and ask them to surrender

 

If answered no or attacked by a female it will close to melee and use a knockout drug on them

 

Once they have been drugged the npc will back off that target and try on any others, then wait till the targets collapse then enslave them

 

Problem I've been trying to work out is how to set the target ref in the packages as it will vary of course, probably the player and or companions, in the packages you can't set to a variable, just by cell references which is useless. I've been looking into the Flee, Dialogue & Use Weapon Packages but they all have the same problem in setting the target by a script.

 

 

Posted

Doable in Skyrim, since the CK supports running quests through Story Manager and has quest aliases which support dynamic reference selection when certain conditions are met. So you can create an "attack females" quest that has a target NPC and then run the quest on conditions such as if there's any female NPC within a certain radius and if the attacker has LoS etc. through Story Manager. GECK otoh is a rather primitive version of the CK and I doubt it has all these features.

 

I recommend watching some of these video tutorials for Skyrim.

 

http://www.creationkit.com/Video_Tutorials

 

This one in particular is pretty good. It deals with custom AI packages some of which may apply to GECK.

 

Posted

Mr. Halstrom you know I'm the last one so don't take my suggestion too openly, I'm sure there are better ways to do it.

 

But on "peculiar" packages like that, I usually prefer scripting the behaviours.

 

In this case I would try use travel packages (or sandboxes across many spots, I don't really know how the guard must move) instead of a guard package, and I would attach a script with a actor/creature range check so that I could specify the getissex, resulting in a startcombat/moddisposition or starting a dialogue in case of female actor (when guardREF.isincombat == 0 of course)

Posted

Ok any ideas on GetFirstRef and how to get it to detect added Companions

 

I've been playing with the following script in an item worn by a NPC it seems to detect NPC's 10000 units away but not Kirina a 3rd party companion it also doesn't detect the player so I had to add the first bit to do that

; *** Scan for Victim
			Set rTarget to NVFakeGolfBall
			Set fDistance to rZActor.GetDistance PlayerREF
DebugPrint "SB:%n Mark2" rZActor
			if fDistance < 1500 && PlayerREF.GetEquipped SOCStimBeltActive != 1 && PlayerREF.IsSpellTarget SOC3PerpetualOrgasm != 1
				Set rTarget to PlayerREF
				DebugPrint "%n Target is %n at %6.1f" rZActor rTarget fDistance
			else
				Set rTemp to rZActor.GetFirstRef 200 1
				Set iCnt to 0
				Label 1
				Set iCnt to iCnt + 1		
				Set rTemp to rZActor.GetNextRef
				Set fDistance to rZActor.GetDistance rTemp
				DebugPrint "%n Temp is %n at %6.1f" rZActor rTemp fDistance
				if fDistance < 1500 && rTemp.GetEquipped SOCStimBeltActive !=1
DebugPrint "SB:%n Mark3" rZActor
					Set rTarget to rTemp
					DebugPrint "%n Target is %n at %6.1f" rZActor rTarget fDistance
				endif
				DebugPrint "%n Target is %n at %6.1f" rZActor rTarget fDistance
				if iCnt < 9 && fDistance < 1500 && rTarget == NVFakeGolfBall
					goto 1
				endif
			endif
Posted

You are skipping the first ref. move the call to getnextref at the end of the if loop.

As for the player, I don't think its ref is in the same list as others, or maybe its type is not 200.

Posted

I wasn't using the GetNumRefs to scan all the refs in the cell.

The GetRef commands don't work from the distance of the caster outwards they just go through the list by whatever order the were added or something so you need to check how many refs in the cell then check every one of them and see if they are close by distance.

Posted

what I meant is, in this sequencce:

Set rTemp to rZActor.GetFirstRef 200 1

Set iCnt to 0

Label 1

Set iCnt to iCnt + 1

Set rTemp to rZActor.GetNextRef

 

the first value of rTemp is lost, so it could be your missing follower.

Also, I don't think calling GetFirstRef/GetNextRef on an object matters. The source will always be the player cell.

Posted

Ah yeah I fixed that missing fist ref one easy enough, but I really needed the GetNumRefs, that gave me the full list of actors in the cell to scan through and found Kirina ok, no Player but I can live with that.

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

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