OnActivate with a creature?

Post » Tue May 17, 2011 6:14 am

First of all my problem from a while back that I haven't figured out...

I have a couple XMarkers firing railway spikes and for some reason I can't get the rounds to impact the NPC (or me I think, I tried setting them behind me when I activate it and they didn't hurt me). I made a new form based on the railway rifle for both the weapon and projectile, new rifle shoots the new projectile, got rid of the sounds and adjusted crit chance/damage and thats it (oh and playable). I don't even think I've changed the projectile other then its name, and I can't even shoot the normal Railway Rifle and hit me or the NPC, but missiles work, what is going on?

I'm also trying to have a robot "Deactivated" and then after you activate it and "repair it", it starts talking to you. Problem is I can't activate it, do OnActivate blocks not work on creatures? Here is the script attached to the creature.

scn MTHMetroPALSScriptShort myStateShort iButtonShort RepairedBegin OnActivate	If IsActionRef Player		If Repaired == 0			ShowMessage MTHMetroRobotRepair			Set myState to 1		EndIf	EndIfEndBegin GameMode	If myState		set iButton to GetButtonPressed		If iButton == -1			Return				ElseIf iButton == 0			If Player.GetItemCount FissionBattery > 1				Player.RemoveItem FissionBattery 2				Set Repaired to 1				Set myState to 2				EVP			Else				;ShowMessage MTHNoMaterials				Set myState to 0			EndIf		EndIf	EndIfEnd


Also is there a way to play the "dead animation"?
User avatar
Brandon Bernardi
 
Posts: 3481
Joined: Tue Sep 25, 2007 9:06 am

Post » Tue May 17, 2011 5:20 am

How did you 'deactivate' the robot?

Some commands make normally activatable objects 'invisible' to activation.
User avatar
Anna Beattie
 
Posts: 3512
Joined: Sat Nov 11, 2006 4:59 am

Post » Tue May 17, 2011 3:06 am

I haven't actually yet since I want to get it working first, but for some reason it works now so I don't even know I think I added a condition to one message box choice and thats it. I was planning on using setrestrict or whatever and playing the dead animation if possible, would that be fine?
User avatar
Isabella X
 
Posts: 3373
Joined: Sat Dec 02, 2006 3:44 am

Post » Tue May 17, 2011 3:11 am

Yeah, that will probably work.
If you use set destroyed, you cannot interact with it anymore.
User avatar
Kahli St Dennis
 
Posts: 3517
Joined: Tue Jun 13, 2006 1:57 am

Post » Tue May 17, 2011 12:53 am

You could take a look at the brahmin. If you activate the brahmin in Megaton while sneaking, it will be tipped over with a custom animation.
User avatar
!beef
 
Posts: 3497
Joined: Wed Aug 16, 2006 4:41 pm

Post » Mon May 16, 2011 11:52 pm

Or just look at the 'deactivated' robots in Big Town. Part of Big Towns defense involves
Spoiler
activating the robots, repairing it, where it then gets up and protects the town.

User avatar
Jessica Nash
 
Posts: 3424
Joined: Tue Dec 19, 2006 10:18 pm

Post » Tue May 17, 2011 12:05 pm

OnActivate replaces the default activation behaviour for a reference. If you want to trigger it, you need to call "Activate" from within the onactivate block.

You can play a robot 'dead-ish' animation by setting it to unconcsious using SetUnconscious 1 on it and making it pick an idle using PickIdle (and reverse it by using SetUnconscious 0 and Pickidle). Alternatively, you can havok the robot by reducing its fatigue below 0 using ModAV Fatigue -1000, or havok it in a less limp manner by Paralysing it (by using an ability or ModAV Paralysis 1).
User avatar
Chris Guerin
 
Posts: 3395
Joined: Thu May 10, 2007 2:44 pm

Post » Tue May 17, 2011 7:52 am

Thanks for the help guys, any ideas on the projectile impaling thing?

Also I've got this

Begin OnLoad		Set thisRef to GetSelf	thisRef.PlayIdle RobobrainUnconscious	thisRef.SetUnconscious 1	thisRef.SetRestrained 1End


On the robot but it doesn't seem to be working, and neither does the fatigue mod, any particular reason why? Is it because I'm trying to do it at the same time it's being loaded or should that not matter?


Nevermind, SetRestrained and SetUnconscious right after one another was the issue, getting rid of SetRestrained fixed it.
User avatar
Jessica Colville
 
Posts: 3349
Joined: Wed Oct 18, 2006 6:53 pm


Return to Fallout 3