How can I check if the projectile hit a certain object type?

Post » Fri Nov 18, 2011 3:34 pm

My goal is to change Zap Away (for my own use) to destroy any goo or ash piles still laying around. I am using the Vanishing Piles mod but that doesn't work on the old piles.

I'm fairly sure the script effect operates on the thing it hit because it uses "GetDead" which is on the self reference. So, assuming for a minute that the piles have collision, and they might but I'm not certain how I would know for sure. Nifskope has collision info for them but I can't really read Nifskope details beyond changing skins. So if they have collision data, and I do a GetSelf, how do I compare that again DefaultAshPile1? Certainly the reference value is for an instanced pile so that won't work. I tried GetObjectType from FOSE but didn't seem to get a positive result.

Also, is there some sort of printf function I can use?

Thanks.
User avatar
Laurenn Doylee
 
Posts: 3427
Joined: Sun Dec 03, 2006 11:48 am

Post » Fri Nov 18, 2011 10:27 am

You can do a ref walk for activators (the vanilla piles are activators). Then get the base object of the reference and compare it to the DefaultAshPiles. If there's a match, then do a disable and markfordelete on the reference.

Ref walks: http://www.cipscis.com/fallout/tutorials/loops.aspx
User avatar
Charleigh Anderson
 
Posts: 3398
Joined: Fri Feb 02, 2007 5:17 am

Post » Fri Nov 18, 2011 7:50 pm

You can do a ref walk for activators (the vanilla piles are activators). Then get the base object of the reference and compare it to the DefaultAshPiles. If there's a match, then do a disable and markfordelete on the reference.

Ref walks: http://www.cipscis.com/fallout/tutorials/loops.aspx


Getting the base object, or base id, or base form... whatever, is exactly what I don't know how to do. I'm assuming I have the reference of the pile, but don't know how to access its base object.
User avatar
Taylor Bakos
 
Posts: 3408
Joined: Mon Jan 15, 2007 12:05 am

Post » Fri Nov 18, 2011 9:05 am

Ok I think it is the FOSE command getbaseobject. The trouble is that the script effect from the projectile only appears to run if it hits an actor, which the piles are not. I'm thinking I will add a script to the piles and see if I can have them run the equivalent script from OnHitWith.

Update, that didn't work. Maybe they don't have collision?
User avatar
Rudi Carter
 
Posts: 3365
Joined: Fri Sep 01, 2006 11:09 pm

Post » Fri Nov 18, 2011 6:08 pm

You can leave the object effect on the weapon alone. For the ashpiles, add a script to the weapon.

Have OnEquip, OnUnEquip, OnDrop blocks to set a control variable as the player equips, unequips, or drops the weapon. (so the gamemode script knows when it's ok to run - player has it equipped, etc)

When the control variable is valid, a GameMode block that uses the GetCrossHairREF constantly, but waits till the player pulls the trigger. Check this by using IsControlpressed http://fose.silverlock.org/fose_command_doc.html#IsControlPressed

When the trigger is pressed, the code then gets the base object of the captured REF under the crosshair, and compares it to the ashpiles. Since you have the ref, you can do whatever you want after that.
User avatar
jodie
 
Posts: 3494
Joined: Wed Jun 14, 2006 8:42 pm


Return to Fallout 3