Scripting - OnHit Blocks

Post » Tue Jun 29, 2010 5:14 am

If he was wearing it from the begining, then the OnEquip block would never have run, so IsWearing would have never been set. Try it with a follower who you give the armor to, or just change the script to set Is Wearing to 1 by default. Or, if you use FOSE, you can add a check to see if the armor in slot 2 is Outcast PA with http://fose.silverlock.org/fose_command_doc.html#GetEquippedObjectand set IsWearing that way. Or instaed of a script on the armor, make it an enchantment

Or add this bit to the script:

Short DoOnceBegin OnLoad  If DoOnce == 0	Set self to getcontainer	self.UnequipItem ArmorPowerOutcast	self.EquipItem ArmorPowerOutcast	Set Doonce to 1  EndifEnd



You can then remove the "Set Self to GetContainer" line from the OnEquip block as it will be redundant. But that forces the NPC to wear the armor even if they would have chosen to wear something else, which may or may not be a problem. And check out http://geck.gamesas.com/index.php/Force_an_actor_to_equip_new_stuff for an alternative solution.


Hey pkleiss,
You must be happy that you can get some payback to your American neighbors now, eh?
Fantastic game. Both teams really were outstanding, though Luongo made my heart drop a few times. Sure wish Miller had been born in Windsor or somewhere a bit further North though!

Anyways... got a bit distracted trying to dial in sniping ballistics and had the Power armor on hold for a bit.
Tried it out today though and I have to say that the script still doesnt seem to be working for me. I was taking damage from dogs with no sign of returning health
Not only that, I added the object effect 'water breathing to the helm' and then proceded to drown in the river.
Doh!
Seems the damn suits are nerfed!
User avatar
FABIAN RUIZ
 
Posts: 3495
Joined: Mon Oct 15, 2007 11:13 am

Post » Tue Jun 29, 2010 7:59 am

I have to admit, it was glorious. On ESPN, the sportscaster was talking about a gold medal game defeat. I was thinking, "It sure didn't look like a defeat to me." And my neighbor, Danny, did get a bit a return flack as well.

If you used the script in the post you just sent, replace it with the script in the post right above yours. That script worked pretty well for me for both NPCs and followers and the player when I tested it. Its not perfect, but was functional for me at least, though I did not test versus dog bites, but it should work the same. I'm not sure where the waterbreathing went south, though.
User avatar
Verity Hurding
 
Posts: 3455
Joined: Sat Jul 22, 2006 1:29 pm

Post » Mon Jun 28, 2010 10:03 pm

Have you thought about how it would be possible to detect the type of damage? Because that would be cool for weapon-based damage reduction.
User avatar
Gemma Woods Illustration
 
Posts: 3356
Joined: Sun Jun 18, 2006 8:48 pm

Post » Mon Jun 28, 2010 9:51 pm

I have to admit, it was glorious. On ESPN, the sportscaster was talking about a gold medal game defeat. I was thinking, "It sure didn't look like a defeat to me." And my neighbor, Danny, did get a bit a return flack as well.

If you used the script in the post you just sent, replace it with the script in the post right above yours. That script worked pretty well for me for both NPCs and followers and the player when I tested it. Its not perfect, but was functional for me at least, though I did not test versus dog bites, but it should work the same. I'm not sure where the waterbreathing went south, though.

Man, I hate to say it, but I am still having no luck with this.
It is starting to drive me crazy.

Here is what I am doing:
I copied your script and pasted it verbatim into a new object script. To ensure I notice the effect, I upped 'self.RestoreAV Health 50' to 100.
In the ArmorPowerBrotherhoodOfSteel I selected UCDamageReducion10 in the Script menu. This armor already has an Object Effect - "EnchPowerArmor" with 4 effects: IncreasedCarryWeight, Incr Rad resistance, Incr Strength, Reduced Agility.
I saved and exited.
This mod is last in my load order.
With a 3rd level character I 'Player.additem' a set of Brotherhood armor, put it on then entered the Super Duper, and was promply swarmed with raiders.
I take quite a few hits from pistols and melee weapons and take damage, and eventually get knocked down to about half health, with no sign of health regenerating.

Similarly, I later SetRestrained a Brotherhood guy and then proceed to kill him with a silenced 10 mm in about a dozen shots.

I hate to keep on with this problem, but do you have any idea what am I doing wrong?
User avatar
jadie kell
 
Posts: 3497
Joined: Sat Jul 29, 2006 3:54 pm

Post » Tue Jun 29, 2010 4:46 am

Well, for one, its not an effect script. It just an object script that runs on the armor itself. I think thats what you have done. But that script is written specifically for "ArmorPowerOutcast". If you want it to work for a diffferent armor, you'll have to change every instance of "ArmorPowerOutcast" to "ArmorPowerBrotherhoodOfSteel" or any other armor name. That's why using FOSE would be better becasue we could make the script work for any armor by using the GetEqObj function to return the equipped armor instead of hard coding it for a specific armor.
User avatar
Nicole Kraus
 
Posts: 3432
Joined: Sat Apr 14, 2007 11:34 pm

Previous

Return to Fallout 3