Jump to content

Need a script? Maybe I can help.


fg109

Recommended Posts

I guess i have to put the bigger script on the dummy marker, if so how do i point them to the activator? By linking, parenting or script property ?

Also, about the DummyMarker , does it have to be a potion, leveled item or a simple marker(trigger box) ?

 

 

I changed the smaller script a little so that the dummy items will be static:

 

 

Scriptname ExampleObjectScript extends ObjectReference

Bool Property HavokOn Auto

Event OnInit()
BlockActivation()
if !HavokOn
	SetMotionType(Motion_Keyframed, False)
endif
EndEvent

Event OnActivate(ObjectReference akActionRef)
Disable()
akActionRef.AddItem(Self.GetBaseObject())
EndEvent

 

 

EDIT: I didn't feel like redoing the video so that it would be shorter. There are some unnecessary stuff I did in there.

Edited by fg109
Link to comment
Share on other sites

  • Replies 272
  • Created
  • Last Reply

Top Posters In This Topic

Now it's much more clearer thanks a lot fg will do this asap, kudos bro :)

Also, it's not really important, but if you could do the other script i mentioned it'd be nice (the container that activates a certain static object depending on the quantity of potatoes...), i'll try to do it myself as a test without peeking at your work if you do it anyway... also is it okay posting your name in the credits once the mod is done ( having a job makes it take a while )?

Edited by bobbythecamel
Link to comment
Share on other sites

Well, I messed around with the scripting a bit, and it's a lot more intuitive then I thought. Also, all I had to do was remove stuff, not really add anything so no problems there. I'm now at a point where I managed to prevent any items from being added or removed (both weapons and armor) during the whole changing into beastform and back process. Basically I got what I wanted, but there's just one little thing: When Farkas changes back he walks around in his underwear. This is not a really big problem because he equips his gear again when he enters another cell, but I find it silly he enters the ensueing 5 or 6 fights near-naked. Now all I need is a script that makes him equip the armor from his inventory. I tried to simply script him to 'resurrect' or disable/enable himself (which would solve the problem as well - turns out the script of the quest made him set his outfit to steel armor but I removed that line) but those commands (as entered in the console, which works fine) don't seem to work in Papyrus? Does anybody know a script command that either makes him equip all his gear or 'resurrect' himself?

 

T.

Link to comment
Share on other sites

I tried doing exactly this - and he does 1 of 2 things in-game. Nothing, or casts his highest damage spell repeatedly, and nothing else. Any other thoughts? I'm pretty sure I'll need to script some of it. Only 2 of the spells should be unscripted (aka: use magicka & require a startup time for dramatic effect. The one weaker spell he uses frequently can be fine with just the script animation. But the healing and the switch to melee need to be scripted I'm pretty sure. Any ideas?
Link to comment
Share on other sites

@tmanthewhite

 

You can use the Reset command. I do not have access to the CK right now, so I don't know exactly how the script for the quest is. But you know how to add properties to a script right? So assuming that the transformation is controlled by some script fragment somewhere, add this to it:

 

;Farkas is a human again, but he's naked!
;in the code here "Farkas" is referring to an actor property named Farkas
float offsetX = Farkas.X - Game.GetPlayer().X
float offsetY = Farkas.Y - Game.GetPlayer().Y
float offsetZ = Farkas.Z - Game.GetPlayer().Z
Farkas.Reset()
Utility.Wait(0.1)
Farkas.MoveTo(Game.GetPlayer(), offsetX, offsetY, offsetZ)

Link to comment
Share on other sites

@avenger404

 

Like I said before, Cast has absolutely no animation and no magicka cost... I think it's still a better idea to use the AI packages. You can use scripting to control exactly which packages are executed. Try these steps:

 

1. Create 3 factions (eg TestFaction01, TestFaction02, TestFaction03)

 

2. Create 4 UseMagic packages and 1 UseShout package. They should have the interrupt override set as Combat.

 

3. In one of the UseMagic packages, set the condition to "GetFactionRank 'TestFaction01' == 1", set the spell to a healing spell, and in the ending papyrus fragment, use this:

 

akActor.SetFactionRank(TestFaction01, 0)
akActor.EvaluatePackage()

 

4. In another UseMagic package, set the condition to "GetFactionRank 'TestFaction02' == 1" and "GetFactionRank 'TestFaction03' >= 5", set the spell to your spell2 (the rune spell), and in the papyrus fragment, use:

 

akActor.SetFactionRank(TestFaction03, 0)
akActor.EvaluatePackage()

 

5. Repeat step 4 for the remaining packages, except with the condition for TestFaction02 be 2, 3, and 4, and the appropriate spell/shout.

 

6. Add the three factions to your NPC. Add the packages to your NPC (the healing package should be on top). Give your NPC only 1 spell (spell1 that you keep casting 5 times in a row).

 

7. Create a constant effect on self magic effect with this script:

 

Scriptname TestMEScript extends ActiveMagicEffect

Spell Property OwningSpell Auto
Spell Property DefaultSpell Auto
Faction Property TestFaction01 auto
Bool Healed

Event OnEffectStart(Actor akTarget, Actor akCaster)
if !Healed
	Healed = True
	akTarget.SetFactionRank(TestFaction01, 1)
	akTarget.EvaluatePackage()
else
	akTarget.RemoveSpell(DefaultSpell)
	akTarget.RemoveSpell(OwningSpell)
endif
EndEvent

 

Add the magic effect to an ability, with the condition "GetActorValuePercentage 'Health' < 0.25". Owning spell should be the ability. DefaultSpell should be spell1. Give your NPC this ability.

 

8. Add this script to the magic effect of spell1:

 

Scriptname TestME02Script extends ActiveMagicEffect

Faction Property TestFaction02 Auto
Faction Property TestFaction03 Auto

Event OnEffectStart(Actor akTarget, Actor akCaster)
int counter = akCaster.GetFactionRank(TestFaction03) + 1
if (counter >= 5)
	int pkgcontrol = akCaster.GetFactionRank(TestFaction02) + 1
	if (pkgcontrol > 4)
		pkgcontrol = 1
	endif
	akCaster.SetFactionRank(TestFaction02, pkgcontrol)
endif
akCaster.SetFactionRank(TestFaction03, counter)
if (counter >= 5)
	akCaster.EvaluatePackage()
endif
EndEvent

 

EDIT: In order to add properties to the script fragments of a package, you need to close the package window, and then re-open it first.

Edited by fg109
Link to comment
Share on other sites

@lobohotpants

 

Scriptname TestObjScript extends ObjectReference

Potion property FoodToPlace auto
Int property MinAmount = 1 auto
Int property MaxAmount = 10 auto
Float property MinInterval = 5.0 auto
Float property MaxInterval = 5.0 auto
Actor MyOwningActor

Event OnEquipped(Actor akActor)
MyOwningActor = akActor
RegisterForSingleUpdate(Utility.RandomFloat(MinInterval, MaxInterval))
EndEvent

Event OnUnequipped(Actor akActor)
UnregisterForUpdate()
EndEvent

Event OnUpdate()
MyOwningActor.PlaceAtMe(FoodToPlace, Utility.RandomInt(MinAmount, MaxAmount))
RegisterForSingleUpdate(Utility.RandomFloat(MinInterval, MaxInterval))
EndEvent

Edited by fg109
Link to comment
Share on other sites

Would love some help on this one. Tell an actor (the undead dragon in labyrinthian) to hold it's idle pose so i can use him in my house as a museum piece. From what I can gather, I have to use the send animation event? Maybe? If that is correct, I still don't have a clue on how to write the rest. I've gone thru the tut's on ck.com but it's confusing to me.... :(

 

Thanks in advance,

 

Armor

Link to comment
Share on other sites

OK so I've got another one for you.

 

A new Mannequin Script that only allows you to place Helms on the mannequin.

 

 

I had a look at the mannequin script and it's gibberish to me, level design, NPC's that I can handle. But scripting.... gah you guys that can do it impress me :)

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.

×
×
  • Create New...