Need Scripting Help Plz

Post » Thu Apr 28, 2011 1:35 pm

I need help to get this script to just activate when it targets a talking NPC not creatures. The script is part of project I am working on that Makes the Player talk to Npcs. As of right now the Player is talking to the npcs but still talks to the packbarmins. I don't want that to happen. Is there anyway to fix this. I realy need some help on this thanks.


float fAngleref rTargetref rCurrentReffloat fCurrentfloat fCurrentRefAnglefloat PCTalkedfloat ButtonTimer float timer float timer2Ref AngleBegin GameMode;Button Timerif (ButtonTimer == 1)	if (timer2 < 5.0)		set timer2 to timer2 + GetSecondsPassed	else		set ButtonTimer to 0			set timer2 to 0	endifendifif Player.IsInCombat == 0	set rTarget to GetCrosshairRef	elseif Player.IsInCombat == 1	set rTarget to player.GetCombatTarget	endif	if Player.IsChild == 1		return	elseif GetVATSMode == 1 || GetVATSMode == 2 || GetVATSMode == 3 || GetVATSMode == 4		return	elseif Player.IsSneaking == 1		return	elseif Player.IsSwimming == 1		return	endifif rTarget			if rTarget.IsActor			set rCurrentRef to GetCrosshairRef			if rCurrentRef.GetSleeping == 1			set ButtonTimer to 1			endif	endifendif	if (ButtonTimer == 0)			if rTarget					if rTarget.IsActor					set rCurrentRef to GetCrosshairRef   ;PART I NEED HELP WITH 				if rCurrentRef 					if rTarget.GetDead	 == 1						if rCurrentRef.SamesixAsPC == 0									if Player.GetCannibal == 0												set PCTalked to GetRandomPercent								if PCTalked >= 0 ;percent chance 																				PlaySound PCHELLOMFN1											set ButtonTimer to 1											set PCTalked to 0											set timer to 0									endif								endif								elseif Player.GetCannibal == 1										set PCTalked to GetRandomPercent								if PCTalked >= 0 ;percent chance 																				PlaySound PCHELLOMFN1											set ButtonTimer to 1											set PCTalked to 0											set timer to 0									endif								endif							endif							elseif rCurrentRef.SamesixAsPC == 1									if Player.GetCannibal == 0												set PCTalked to GetRandomPercent								if PCTalked >= 0 ;percent chance 																				PlaySound PCHELLOMFN1											set ButtonTimer to 1											set PCTalked to 0											set timer to 0									endif								endif								elseif Player.GetCannibal == 1										set PCTalked to GetRandomPercent								if PCTalked >= 0 ;percent chance 																				PlaySound PCHELLOMFN1											set ButtonTimer to 1											set PCTalked to 0											set timer to 0									endif								endif							endif							endif			 					else									if rCurrentRef.SamesixAsPC == 0														if Player.IsWeaponOut == 0 ;NPC says somthing to player with gun out										set PCTalked to GetRandomPercent									if PCTalked >= 85 || PCTalked <= 100																				Player.PlaySound PCHELLOMFN1											 rCurrentRef.SetAlert 1 											set PCACTIVATE to 2											set ButtonTimer to 1											set PCTalked to 0									elseif PCTalked >= 65 || PCTalked <= 84																						Player.PlaySound PCHELLOMFN2											 rCurrentRef.SetAlert 1 											set PCACTIVATE to 2											set ButtonTimer to 1											set PCTalked to 0									elseif PCTalked >= 40 || PCTalked <= 64																						Player.PlaySound PCHELLOMFN3											 rCurrentRef.SetAlert 1 											set PCACTIVATE to 2											set ButtonTimer to 1											set PCTalked to 0									elseif PCTalked >= 15 || PCTalked <= 39																				Player.PlaySound PCHELLOMFN4											 rCurrentRef.SetAlert 1 											set PCACTIVATE to 2											set ButtonTimer to 1											set PCTalked to 0									elseif PCTalked >= 0 || PCTalked <= 14																					Player.PlaySound PCHELLOMFN5											 rCurrentRef.SetAlert 1 											set PCACTIVATE to 2											set ButtonTimer to 1											set PCTalked to 0									endif									elseif Player.IsWeaponOut == 1 ;NPC says somthing to player with gun out											set PCTalked to GetRandomPercent									if PCTalked >= 81 || PCTalked <= 100																				Player.PlaySound PCWEAPONOUT1											 rCurrentRef.SetAlert 1 											set PCACTIVATE to 2											set ButtonTimer to 1											set PCTalked to 0									elseif PCTalked >= 71 || PCTalked <= 80																						Player.PlaySound PCWEAPONOUT2											 rCurrentRef.SetAlert 1 											set PCACTIVATE to 2											set ButtonTimer to 1											set PCTalked to 0									elseif PCTalked >= 61 || PCTalked <= 70																						Player.PlaySound PCWEAPONOUT3											 rCurrentRef.SetAlert 1 											set PCACTIVATE to 2											set ButtonTimer to 1											set PCTalked to 0									elseif PCTalked >= 51 || PCTalked <= 60																				Player.PlaySound PCWEAPONOUT4											 rCurrentRef.SetAlert 1 											set PCACTIVATE to 2											set ButtonTimer to 1											set PCTalked to 0									elseif PCTalked >= 41 || PCTalked <= 50																				Player.PlaySound PCWEAPONOUT5											 rCurrentRef.SetAlert 1 											set PCACTIVATE to 2											set ButtonTimer to 1											set PCTalked to 0									elseif PCTalked >= 31 || PCTalked <= 40																					Player.PlaySound PCWEAPONOUT6											 rCurrentRef.SetAlert 1 											set PCACTIVATE to 2											set ButtonTimer to 1											set PCTalked to 0									elseif PCTalked >= 21 || PCTalked <= 30																					Player.PlaySound PCWEAPONOUT7											 rCurrentRef.SetAlert 1 											set PCACTIVATE to 2											set ButtonTimer to 1											set PCTalked to 0									elseif PCTalked >= 11 || PCTalked <= 20																				Player.PlaySound PCWEAPONOUT8											 rCurrentRef.SetAlert 1 											set PCACTIVATE to 2											set ButtonTimer to 1											set PCTalked to 0									elseif PCTalked >= 0 || PCTalked <= 10																					Player.PlaySound PCWEAPONOUT9											 rCurrentRef.SetAlert 1 											set PCACTIVATE to 2											set ButtonTimer to 1											set PCTalked to 0									endif									endif																								elseif rCurrentRef.SamesixAsPC == 1														if Player.IsWeaponOut == 0 ;NPC says somthing to player with gun out											set PCTalked to GetRandomPercent									if PCTalked >= 85 || PCTalked <= 100																				Player.PlaySound PCHELLOMFN1											 rCurrentRef.SetAlert 1 											set PCACTIVATE to 2											set ButtonTimer to 1											set PCTalked to 0									elseif PCTalked >= 65 || PCTalked <= 84																						Player.PlaySound PCHELLOMFN2											 rCurrentRef.SetAlert 1 											set PCACTIVATE to 2											set ButtonTimer to 1											set PCTalked to 0									elseif PCTalked >= 40 || PCTalked <= 64																						Player.PlaySound PCHELLOMFN3											 rCurrentRef.SetAlert 1 											set PCACTIVATE to 2											set ButtonTimer to 1											set PCTalked to 0									elseif PCTalked >= 15 || PCTalked <= 39																				Player.PlaySound PCHELLOMFN4											 rCurrentRef.SetAlert 1 											set PCACTIVATE to 2											set ButtonTimer to 1											set PCTalked to 0									elseif PCTalked >= 0 || PCTalked <= 14																					Player.PlaySound PCHELLOMFN5											 rCurrentRef.SetAlert 1 											set PCACTIVATE to 2											set ButtonTimer to 1											set PCTalked to 0									endif									elseif Player.IsWeaponOut == 1 ;NPC says somthing to player with gun out											set PCTalked to GetRandomPercent									if PCTalked >= 81 || PCTalked <= 100																				Player.PlaySound PCWEAPONOUT1											 rCurrentRef.SetAlert 1 											set PCACTIVATE to 2											set ButtonTimer to 1											set PCTalked to 0									elseif PCTalked >= 71 || PCTalked <= 80																						Player.PlaySound PCWEAPONOUT2											 rCurrentRef.SetAlert 1 											set PCACTIVATE to 2											set ButtonTimer to 1											set PCTalked to 0									elseif PCTalked >= 61 || PCTalked <= 70																						Player.PlaySound PCWEAPONOUT3											 rCurrentRef.SetAlert 1 											set PCACTIVATE to 2											set ButtonTimer to 1											set PCTalked to 0									elseif PCTalked >= 51 || PCTalked <= 60																				Player.PlaySound PCWEAPONOUT4											 rCurrentRef.SetAlert 1 											set PCACTIVATE to 2											set ButtonTimer to 1											set PCTalked to 0									elseif PCTalked >= 41 || PCTalked <= 50																				Player.PlaySound PCWEAPONOUT5											 rCurrentRef.SetAlert 1 											set PCACTIVATE to 2											set ButtonTimer to 1											set PCTalked to 0									elseif PCTalked >= 31 || PCTalked <= 40																					Player.PlaySound PCWEAPONOUT6											 rCurrentRef.SetAlert 1 											set PCACTIVATE to 2											set ButtonTimer to 1											set PCTalked to 0									elseif PCTalked >= 21 || PCTalked <= 30																					Player.PlaySound PCWEAPONOUT7											 rCurrentRef.SetAlert 1 											set PCACTIVATE to 2											set ButtonTimer to 1											set PCTalked to 0									elseif PCTalked >= 11 || PCTalked <= 20																				Player.PlaySound PCWEAPONOUT8											 rCurrentRef.SetAlert 1 											set PCACTIVATE to 2											set ButtonTimer to 1											set PCTalked to 0									elseif PCTalked >= 0 || PCTalked <= 10																					Player.PlaySound PCWEAPONOUT9											 rCurrentRef.SetAlert 1 											set PCACTIVATE to 2											set ButtonTimer to 1											set PCTalked to 0									endif										endif																									endif						endif					endif								endif			endif				elseif rTarget == 0	;No Target Idle		endif	endif						if PCACTIVATE == 1								set timer to timer + GetSecondsPassed							if (timer > 2)								rCurrentRef.StartConversation player, Greeting rCurrentRef player 1 0								set PCACTIVATE to 0								set timer to 0							endif						endif						if PCACTIVATE == 2								set timer to timer + GetSecondsPassed							if (timer > 2)								rCurrentRef.StartConversation player, Greeting rCurrentRef player 1 0								set PCACTIVATE to 0								set timer to 0							endif						endifEND

User avatar
Claire Mclaughlin
 
Posts: 3361
Joined: Mon Jul 31, 2006 6:55 am

Post » Thu Apr 28, 2011 11:34 am

As of right now the Player is talking to the npcs but still talks to the packbarmins. I don't want that to happen. Is there anyway to fix this. I realy need some help on this thanks.


Try changing this...
			if rTarget.IsActor					set rCurrentRef to GetCrosshairRef   ;PART I NEED HELP WITH 


To this..
			if (rTarget.IsActor == 1) && (rTarget.GetIsCreatureType 1 != 1)					set rCurrentRef to GetCrosshairRef   ;PART I NEED HELP WITH 

and see if it helps. It should disallow continuing if rTarget is creature type mutated animal, which the brahmin are.
User avatar
Stay-C
 
Posts: 3514
Joined: Sun Jul 16, 2006 2:04 am

Post » Thu Apr 28, 2011 10:50 pm

Ty I will give that a try.
User avatar
Cesar Gomez
 
Posts: 3344
Joined: Thu Aug 02, 2007 11:06 am


Return to Fallout 3