Vertibird script not working

Post » Fri May 06, 2011 1:33 pm

Hi!

Currently I've got this script which will call a vertibird, make it bomb and then it will fly away, but the vertibird won't even appear, nor will it add a single bottlecap into my inventory as a debug. Here is the script (that StartBombing is a global var which is set to 1 if a button is pressed):

scn PlayerVertibirdBombing02SCRIPTshort doOnceBomb02float timerBomb02short firingFlagBomb02float fireTimerBomb02ref VertibirdCallBomb02REFERENCEshort doOnceBegin gameMode	if (StartBombing == 1 && doOnce == 0)				player.additem f 1;DEBUG!!!		set VertibirdCallBomb02REFERENCE to player.PlaceAtMe PlayerVertibirdBomb02;Place Vertibird at player		VertibirdCallBomb02REFERENCE.SetAngle x 0 ;Make sure the Vertibird fires on the ground		VertibirdCallBomb02REFERENCE.SetAngle y 0 ;Make sure the Vertibird fires on the ground		set doOnceBomb02 to 1;Enable doOnceBomb02 to engage bombing run		set timerBomb02 to 1;Set the timer for the bombing run		set doOnce to 1	endif	if (doOnceBomb02 == 1)		if (VertibirdCallBomb02REFERENCE.HasLoaded3D != 0)			VertibirdCallBomb02REFERENCE.playgroup Forward 1			set fireTimerBomb02 to 0.5;vertibird going to shoot for this long once in position			set timerBomb02 to 12	;vertibird takes this long to get into hovering position			set doOnceBomb02 to 2		endif		elseif (doOnceBomb02 == 2)		if (VertibirdCallBomb02REFERENCE.isAnimPlaying Forward == 0)			VertibirdCallBomb02REFERENCE.disable		;disable the vertibird when it's done playing its forward animation			set PlayerVertibirdBomb02QUEST.StartBombing to 1			set doOnceBomb02 to 4		endif				if (timerBomb02 <=0)	;vertibird in position to start firing			set timerBomb02 to 4;vertibird hovers for this long before flying away			set firingFlagBomb02 to 1			set doOnceBomb02 to 3		else			set timerBomb02 to (timerBomb02 - GetSecondsPassed)		endif	elseif (doOnceBomb02 == 3)		if (timerBomb02 <= 0)			set doOnceBomb02 to 4		else			if (firingFlagBomb02 == 1)				if (fireTimerBomb02 <=0)					VertibirdCallBomb02REFERENCE.fireWeapon DLC03VertibirdMissileLauncher					set fireTimerBomb02 to .5					set firingFlagBomb02 to 2				else					set fireTimerBomb02 to (fireTimerBomb02 - GetSecondsPassed)				endif			elseif (firingFlagBomb02 == 2)				if (fireTimerBomb02 <=0)					VertibirdCallBomb02REFERENCE.fireWeapon DLC03VertibirdMissileLauncher					set fireTimerBomb02 to .5					set firingFlagBomb02 to 1				else					set fireTimerBomb02 to (fireTimerBomb02 - GetSecondsPassed)				endif			endif			set timerBomb02 to (timerBomb02 - GetSecondsPassed)		endif									set timerBomb02 to (timerBomb02 - GetSecondsPassed)		endifEnd

User avatar
Mizz.Jayy
 
Posts: 3483
Joined: Sat Mar 03, 2007 5:56 pm

Post » Sat May 07, 2011 1:48 am

At the console, does Show StartBombing return a 1 ?
User avatar
Daniel Brown
 
Posts: 3463
Joined: Fri May 04, 2007 11:21 am

Post » Fri May 06, 2011 7:17 pm

At the console, does Show StartBombing return a 1 ?

Nope, it returns a 0.
User avatar
Lizzie
 
Posts: 3476
Joined: Sun Nov 19, 2006 5:51 am

Post » Fri May 06, 2011 8:44 pm

Sounds to me like where ever your setting StartBombing to 1 is the issue, because its not setting it. Show us the script for the button that occurs at.
User avatar
Cccurly
 
Posts: 3381
Joined: Mon Apr 09, 2007 8:18 pm

Post » Fri May 06, 2011 2:59 pm

Will do:

(...)

EDIT:
I've found the solution (with help), here are the scripts (one is attached to a vertibird):

scn PlayerVertibirdBombing02SCRIPTshort doOnceBomb02float timerBomb02short firingFlagBomb02short FirstTimefloat fireTimerBomb02Begin OnLoad 	 VertibirdBomb02REF.PlayGroup idle 0;Make sure Vertibird uses correct animations	 VertibirdBomb02REF.PlayGroup forward 1;Make sure Vertibird uses correct animationsend Begin gameMode	if (StartBombing == 1 && doOnceBomb02 == 0 && FirstTime == 0 && VertibirdBomb02REF.GetDisabled == 0)		player.additem Caps001 50		set DoOnceBomb02 to 1		set timerBomb02 to 1	endif	if (StartBombing == 1 && doOnceBomb02 == 4 && FirstTime == 1 && VertibirdBomb02REF.GetDisabled == 0)		player.additem Caps001 100		set DoOnceBomb02 to 1		set timerBomb02 to 1	endif		if (doOnceBomb02 == 1 && IsAnimPlaying Backward == 0 && IsAnimPlaying left == 0 && IsAnimPlaying forward == 0)		VertibirdBomb02REF.disable 		set doOnceBomb02 to 0		set StartBombing to 0	endif	if (VertibirdBomb02REF.IsAnimPlaying Forward == 0 && StartBombing == 1)		ShowMessage PlayerVertibirdReturned;Debug message for players		VertibirdBomb02REF.disable 		set doOnceBomb02 to 0		set StartBombing to 0	endif	if (doOnceBomb02 == 1)		if (VertibirdBomb02REF.HasLoaded3D != 0)			VertibirdBomb02REF.playgroup Forward 1			set fireTimerBomb02 to 0.5;vertibird going to shoot for this long once in position			set timerBomb02 to 12	;vertibird takes this long to get into hovering position			set doOnceBomb02 to 2		endif		elseif (doOnceBomb02 == 2)		if (VertibirdBomb02REF.isAnimPlaying Forward == 0)			VertibirdBomb02REF.disable		;disable the vertibird when it's done playing its forward animation			set doOnceBomb02 to 4			set StartBombing to 0			set FirstTime to 1			player.additem caps001 5000		endif				if (timerBomb02 <=0)	;vertibird in position to start firing			set timerBomb02 to 4;vertibird hovers for this long before flying away			set firingFlagBomb02 to 1			set doOnceBomb02 to 3		else			set timerBomb02 to (timerBomb02 - GetSecondsPassed)		endif	elseif (doOnceBomb02 == 3)		if (timerBomb02 <= 0)			set doOnceBomb02 to 4		else			if (firingFlagBomb02 == 1)				if (fireTimerBomb02 <=0)					VertibirdBomb02REF.fireWeapon DLC03VertibirdMissileLauncher					set fireTimerBomb02 to .5					set firingFlagBomb02 to 2				else					set fireTimerBomb02 to (fireTimerBomb02 - GetSecondsPassed)				endif			elseif (firingFlagBomb02 == 2)				if (fireTimerBomb02 <=0)					VertibirdBomb02REF.fireWeapon DLC03VertibirdMissileLauncher					set fireTimerBomb02 to .5					set firingFlagBomb02 to 1				else					set fireTimerBomb02 to (fireTimerBomb02 - GetSecondsPassed)				endif			endif			set timerBomb02 to (timerBomb02 - GetSecondsPassed)		endif									set timerBomb02 to (timerBomb02 - GetSecondsPassed)		endifEnd


scn PlayerVertibirdCallerSCRIPT;See also: PlayerVertibirdSCRIPTshort Actionshort VertibirdCalledshort VertibirdTakingOffshort Buttonref VertibirdCallREFERENCEref VertibirdCallBomb02REFERENCE;global VertibirdEnable;global VertibirdTakeoffOrders ;PlayerVertibird = BaseID of Vertibird with script PlayerVertibirdSCRIPT and NIF "Vehicles\VertibirdEncount02.NIF";VertibirdCallREF = REF of Vertibird mentioned above (make sure it's persistent)begin ScriptEffectStart 	if (player.IsInInterior == 0);Check if player is interior		set VertibirdCalled to 1;Vertibird has been called by player		ShowMessage CallVertibirdMessage;Show option screens	endif	player.AddItem EcvCallVertibirdRadio 1;Add a new radio, as the previous one will be removedendbegin ScriptEffectUpdate set Button to GetButtonPressed;Check which button will be pressedif (Button == 0 && VertibirdCalled == 1 && VertibirdEnable == 0)	  set VertibirdEnable to 1	  set VertibirdCallREFERENCE to player.PlaceAtMe PlayerVertibird 1;Place Vertibird at player	  VertibirdCallREFERENCE.SetAngle x 0;Make sure the Vertibird is put on the ground	  VertibirdCallREFERENCE.SetAngle y 0;Make sure the Vertibird is put on the ground	  VertibirdCallREFERENCE.PlayGroup forward 1;Play Vertibird animation	  set VertibirdCalled to 0;Let the PC know the Vertibird is called	  set VertibirdTakingOff to 1;Make sure Vertibird is ready to moveelseif (Button == 1 && VertibirdCalled == 1 && VertibirdEnable == 1)	set VertibirdTakeoffOrders to 1;Workaround to make the Vertibird fly away, see PlayerVertibirdSCRIPT	set VertibirdCalled to 0elseif (Button == 2 && StartBombing == 0)		player.additem caps001 1;Debug		set VertibirdCallBomb02REFERENCE to VertibirdBomb02REF		VertibirdBomb02REF.MoveTo player;Place Vertibird at player		VertibirdBomb02REF.SetAngle x 0 ;Make sure the Vertibird fires on the ground		VertibirdBomb02REF.SetAngle y 0 ;Make sure the Vertibird fires on the ground		set StartBombing to 1		VertibirdBomb02REF.enableendif endbegin ScriptEffectFinish ;Do nothingend

User avatar
Lloyd Muldowney
 
Posts: 3497
Joined: Wed May 23, 2007 2:08 pm


Return to Fallout: New Vegas