Looking for a function.

Post » Tue Apr 06, 2010 10:37 pm

Im searching for something that allows me to check what actor is wearing the piece of armor right now. I have a script that uses RestoreAV Health, and I was wondering if that goes to the wearer by default.
User avatar
ashleigh bryden
 
Posts: 3446
Joined: Thu Jun 29, 2006 5:43 am

Post » Wed Apr 07, 2010 1:53 am

http://geck.gamesas.com/index.php/GetEquipped maybe?
User avatar
u gone see
 
Posts: 3388
Joined: Tue Oct 02, 2007 2:53 pm

Post » Wed Apr 07, 2010 11:39 am

Well, the other way around :) I have a script attached to a armor, and I want to check who wears it at the moment. GetEquipped does it the other way around :)
User avatar
Andrew Lang
 
Posts: 3489
Joined: Thu Oct 11, 2007 8:50 pm

Post » Wed Apr 07, 2010 6:32 am

Well, the other way around :) I have a script attached to a armor, and I want to check who wears it at the moment. GetEquipped does it the other way around :)

Doh! :embarrass:

Maybe you could have the script store the ref (in a quest script or something) when it gets equipped?

You guys and your hard questions... :)
User avatar
Chase McAbee
 
Posts: 3315
Joined: Sat Sep 08, 2007 5:59 am

Post » Wed Apr 07, 2010 6:51 am

That would work, but I have no idea on how I would store the ref of an Actor.

Set Myvar to Actor? Something I'm missing here?

I appreciate the help here though :)

It's a simple enough script, if I want it to work on only the player. But I want this to work on all NPCs. Its a Power Armor script, and I would love it if NPCs could benefit from this script.
User avatar
Lucky Girl
 
Posts: 3486
Joined: Wed Jun 06, 2007 4:14 pm

Post » Wed Apr 07, 2010 7:56 am

The quest script thingie would probably only work if one person was wearing it at a time. If it's multiple people, that's over my head.

Like have a quest script that has: ref currentlyWearingMyArmor

Then in the armor script: onEquip, set quest.currentlyWearingMyArmor to GetActionRef

Don't know, just throwing stuff out there until the pros get back :)
User avatar
tiffany Royal
 
Posts: 3340
Joined: Mon Dec 25, 2006 1:48 pm

Post » Wed Apr 07, 2010 1:25 pm

You could try getcontainer.. .i think that's the one I remember.

it won't necessarily show the equipped status but maybe you don't need that explicitly.
User avatar
lucile
 
Posts: 3371
Joined: Thu Mar 22, 2007 4:37 pm

Post » Wed Apr 07, 2010 1:55 am

Thanks, it would seem this is what I needed :) I'll test it out with multiple NPCs though. This script will be attached to all Power Armors. It's my version of Damage Threshold. I'm using refs to do everything, not checking health. I'll see what happens :)
User avatar
meg knight
 
Posts: 3463
Joined: Wed Nov 29, 2006 4:20 am

Post » Wed Apr 07, 2010 10:27 am

You could try getcontainer.. .i think that's the one I remember.

it won't necessarily show the equipped status but maybe you don't need that explicitly.


Well, I would need that. Let's say the player has PA in his inventory but not equipped, that would screw my script up pretty badly.
User avatar
Samantha Mitchell
 
Posts: 3459
Joined: Mon Nov 13, 2006 8:33 pm

Post » Wed Apr 07, 2010 12:58 am

Well, I would need that. Let's say the player has PA in his inventory but not equipped, that would screw my script up pretty badly.


Edit: I see - - -

It should be possible to do with a really long script using lots of getequipped checks :/
User avatar
Alisha Clarke
 
Posts: 3461
Joined: Tue Jan 16, 2007 2:53 am

Post » Wed Apr 07, 2010 10:29 am

Does OnEquip work on NPCs? Because then that could work.
User avatar
Alexx Peace
 
Posts: 3432
Joined: Thu Jul 20, 2006 5:55 pm

Post » Wed Apr 07, 2010 12:57 am

Does OnEquip work on NPCs? Because then that could work.


I feel sure that it should.

http://cs.elderscrolls.com/constwiki/index.php/OnEquip

note how onequip player is a seperate blocktype that is available from onequip.
User avatar
Amber Hubbard
 
Posts: 3537
Joined: Tue Dec 05, 2006 6:59 pm

Post » Wed Apr 07, 2010 9:20 am

Ok, I'm screwed. Here's my script so far. I dumbed it down but this is the core.
scn H52DTBOSRef ActorRef WeaponRef DamageBegin Onhitwithset Weapon to GetHitWithSet Damage to GetAttackDamage WeaponSet Actor to GetActionRefIf Damage < 4 && GetWeaponIsAutomatic Weapon == 1Actor.RestoreAV Health DamageEndIfEnd


Only problem is, GetHitWith does not exist. I was so sure it existed. Is there a work around possible? I need this to calculate damage, and to see if the weapon is Automatic. But, since the function does not exist, I'm screwed.
User avatar
john page
 
Posts: 3401
Joined: Thu May 31, 2007 10:52 pm

Post » Tue Apr 06, 2010 9:38 pm

Ok, I'm screwed. Here's my script so far. I dumbed it down but this is the core.
scn H52DTBOSRef ActorRef WeaponRef DamageBegin Onhitwithset Weapon to GetHitWithSet Damage to GetAttackDamage WeaponSet Actor to GetActionRefIf Damage < 4 && GetWeaponIsAutomatic Weapon == 1Actor.RestoreAV Health DamageEndIfEnd


Only problem is, GetHitWith does not exist. I was so sure it existed. Is there a work around possible? I need this to calculate damage, and to see if the weapon is Automatic. But, since the function does not exist, I'm screwed.


The 'Onhitwith' will take a formlist. You could list automatic weapons in it, but then you would be stuck with vanilla weapons...
User avatar
Yung Prince
 
Posts: 3373
Joined: Thu Oct 11, 2007 10:45 pm

Post » Wed Apr 07, 2010 2:51 am

If you want a script to run on a piece of equipment when it is equipped, and affect the actor that has it equipped, you'll want to use a structure like this:
int bEquippedref rContainerBegin OnEquip	set bEquipped to 1	set rContainer to GetContainerEndBegin GameMode	if bEquipped		; Do stuff using rContainer	endifEndBegin OnUnequip	set bEquipped to 0End

There is no way to determine which weapon an actor has been hit with. The closest you can get is having separate http://geck.gamesas.com/index.php/OnHitWith blocks for a series of weapons, but that's only appropriate if you want to check for a few different weapons.

If you want to restore damage that is done to an actor, then you'll need to track their health in a http://geck.gamesas.com/index.php/GameMode block so you can detect when it changes.

Cipscis
User avatar
michael danso
 
Posts: 3492
Joined: Wed Jun 13, 2007 9:21 am


Return to Fallout 3

cron