Jump to content

Fallout New Vegas GECK & Scripting Help 101


Recommended Posts

I want to set the game setting 'IActivatePickLength' via quest script. My script does not give me an error but it does not change the value either.

 

Purpose: I want to get the ref under the crosshair with a larger distance than the default one (vanilla default 150 units). The attached script works except that the distance of 150 units is not changed. 

 

Maybe I used SetNumericGameSettings wrong (Syntax: SetNumericGameSetting settingName:string float:float) or there is something else I do not see.

 

Please have a look at the script, maybe it's one of these stupid errors:

short doonce
ref 	FlirtTarget	
string_var FlirtPickDistanceName
float FlirtPickDistanceUnits

begin GameMode

; Set how often to execute the script (tweak later)
if doonce != 1
	SetQuestDelay 00RMFLSQuestMain .1
	set doonce to 1
endif

set FlirtKeyPressed to isKeyPressed 49			; "N"-Key
; PrintToConsole FlirtKeyPressed

; check for Flirt Key ('N' 49)
if (FlirtKeyPressed && BlockFlirtingFlag != 1)
	set BlockFlirtingFlag to 1
	
	set FlirtPickDistanceUnits to 1000.00
	let FlirtPickDistanceName := "IActivatePickLength" 
	SetNumericGameSetting  FlirtPickDistanceName FlirtPickDistanceUnits

	set FlirtTarget to GetCrosshairRef

	set FlirtPickDistanceUnits to 150.00
	SetNumericGameSetting  FlirtPickDistanceName FlirtPickDistanceUnits
	
	if FlirtTarget == 0 
		PrintToConsole "Flirt Target is not filled with a reference!"
	else
		PrintToconsole "%n" FlirtTarget
		;ShowMessage 00RMFLSNoteFlirtTargetAquired FlirtTarget -> CTD
	endif

	set BlockFlirtingFlag to 0
endif 

end
Link to comment

Have you tried with the actual string instead of the string var? For the purpose of this script passing it to a string var doesn't seem necessary, and some functions don't easily accept a string var as parameter instead of a string, needing either the ToString symbol $ or turning on the script compiler override.

Link to comment

Have you tried with the actual string instead of the string var? For the purpose of this script passing it to a string var doesn't seem necessary, and some functions don't easily accept a string var as parameter instead of a string, needing either the ToString symbol $ or turning on the script compiler override.

 

Hi Doc, thx for the answer. Tried around someting further and used the function without variables as well.

 

The problem I have/had seems to be a speed/timing thing. If I comment out the line which resets iActivatePickLength to its initial 150 everything is working. Seems I have to put in some kind of delay timer or so.

 

Consider this solved for now.

Link to comment

Just another stupid question:

 

I have to 'repair' my mod, because it doesn't work anymore ... suddenly.

 

http://www.loverslab.com/topic/23743-sexout-miss-moo/page-3

 

I've figured out the issue, but as I have the BETAS of SCR and Preg installed, GECKPowerUp doesn't save the edited script because it doesn't know the 'GestateingOffspringBighorner' anymore (they have been splitted into male and female versions).

I have to edit the script for the users of the stable SCR and Preg versions, and I don't want to go back to them, because this would mess up my complete instalation.

 

I have tried to edit the script with FNVEdit, but as I the whole script is displayed in one single line it seems that I am too stupid to delete a few ';' without breaking the whole mod.

 

So here is my question:

 

Is there another way to edit a script in a mod?

Link to comment

Because there's an error in your script, because you're using the wrong SCR.

 

Fix the script (WITH powerup) or reinstall the old SCR.

 

That issue is not a powerup issue, don't disable it. All it's doing is enabling the display of errors that Bethesda removed in one of the GECK updates. The reason it won't save without powerup is the same reason it won't save WITH powerup, powerup is just showing the error that the GECK is hiding.

Link to comment

Because there's an error in your script, because you're using the wrong SCR.

 

Fix the script (WITH powerup) or reinstall the old SCR.

 

That issue is not a powerup issue, don't disable it. All it's doing is enabling the display of errors that Bethesda removed in one of the GECK updates. The reason it won't save without powerup is the same reason it won't save WITH powerup, powerup is just showing the error that the GECK is hiding.

 

Oh! I thought the error check was in PowerUp ... I was always using PU, so I didn't know how Geck reacts on errors itsself.

As I have written: I can't demand the users of the mod to install the Betas, because in Preg Beta creatures doesn't work.

So I have to go the long and dangerous way and reinstall the old SCR and Preg versions, and Offspring and Drugging ...

 

Thank you very much, pride ;) (realy :) )

Link to comment

It shouldn't be THAT dangerous or difficult if you used some kind of mod manager. You did....... didn't you? ;)

 

If you don't want your users to have to install the SCR beta, you need to make sure you never have it active when you're working on your mod. You could possibly put some version checking and buildref stuff in there to support both. That works as long as it's not quests or quest vars that are different between versions. If you do everything through spells, tokens, and NX vars then you can easily support both SCR versions at once in a single mod.

Link to comment

It shouldn't be THAT dangerous or difficult if you used some kind of mod manager. You did....... didn't you? ;)

 

If you don't want your users to have to install the SCR beta, you need to make sure you never have it active when you're working on your mod. You could possibly put some version checking and buildref stuff in there to support both. That works as long as it's not quests or quest vars that are different between versions. If you do everything through spells, tokens, and NX vars then you can easily support both SCR versions at once in a single mod.

 

Yes, it seems I was a little to anxious. Going back to stable was no problem. (Of course I am using YOUR FOMM :) )

 

Now I hope I have fixed the strange little issue (suddenly neither StartConversation nor CBDialogX seemed to work as long as the Courier was restrained by 'DisablePlayerControlls'. Both, corier and nps stood motionless forever. Removing 'DisablePlayerControlls' has fixed the error.

 

I have a new version of the mod, I was working on. And the plan was, to make this new version as a entire rework (bighorner are sheep and no cattle!) for the upcomming releases of SCR, Preg and SexoutNG.

As MissMooBeta1 was(!) working for more then a year I never planed to edit this version anymore.

 

Thanks again.

Link to comment

I may have broken something there, but if nobody tells me during beta testing (or afterwards).. I don't know, and can't fix it. Sexout is supposed to honor disableplayercontrols -- it uses GetPlayerControlsDisabled for every flag, saves them, sets them to what it needs itself, and then restores the old settings when it's done. It does the same thing with setrestrained/getrestrained. I can't think of anything that would have broken that, but if you run into problems with the new version, definitely let me know in the NG thread.

 

Those parts are really not tested or used very much as few mods actually bother to restrain the player or disable controls.

 

As a player I personally find disabling those things (especially pipboy and movement) to be pretty obnoxious, though others may feel differently.

Link to comment

I had to realize that 'DisablePlayerControls' wasn't needed at the place I used it. I this I tryed to get the scene more like a cutscene. But I will put the script and the description into the NG thread, maybe we can figure out something. I will ask in the MissMoo thread which version of NG the people where using ... I thing I have 90 installed, but maybe I have it overwritten with some beta ... can't realy remember.

Link to comment

Ok hopefully someone can help me with this, I know nothing about this animation stuff, this birthing animation in pregnancy was set up by someone else years ago and somehow in the last 6 months or so it's got broken, it used to work fine.

 

I have a idle according to FNVEdit that has a condition of a token being equipped

I also have a package I add which I assume triggers the idle some magical way.

 

This all works fine for the player but there are 2 problems when it is tried on NPC's

 

The first is when I add the token they reequip their armor I stripped off them.

The second problem is they just stand there instead of being animated, the birthing script runs fine till completetion adding the baby etc, they just seem to ignore the animation commands.

I tried to find how Sexout itself calls animations to happen but can't find which script does that.

 

to start animating I do this:

				if iBirthAnimation < 2
					if rActor == PlayerREF
						DisablePlayerControls 1 1 1 0 0 1 1
						con_tfc ; It won't play the animation unless TFC is toggled on a little after it's started playing.
						if 1 == IsPC1stPerson ; in first person, force to 3rd
							TapControl 13
						endif
					endif
					rActor.AddItem SexoutSP4TokenBirthAnimationF 1 1
					rActor.AddScriptPackage SexoutP4BirthingAnimation ; *** adding an AI script package to the player
to end the animation I do this:

					if rActor == PlayerREF
						EnablePlayerControls
						con_tfc
					endif
					rActor.RemoveItem SexoutSP4TokenBirthAnimationF 1 1
					rActor.RemoveScriptPackage
					rActor.PushActorAway rActor 2 ; *** Prevents NPC's crab walking
Link to comment

Sexout does it in a long and complicated manner.. as is required to get it to work reliably in all cases.. ;)

 

The main script is SexoutNGEffectBaseScriptF but really, it's almost 1000 lines of gibberish, and the ScriptEffectUpdate block runs from the bottom up.

 

Idles with conditions in sexout are triggered via a call to PickIdle, so maybe the package is calling that for you. You can also call "Playidle <name of idle>" from an effect, which ignores conditions, but will only work properly if the animation is set to loop indefinitely and no other idles interrupt it. Do you have one of these calls somewhere?

Link to comment

Sexout does it in a long and complicated manner.. as is required to get it to work reliably in all cases.. ;)

 

The main script is SexoutNGEffectBaseScriptF but really, it's almost 1000 lines of gibberish, and the ScriptEffectUpdate block runs from the bottom up.

 

Idles with conditions in sexout are triggered via a call to PickIdle, so maybe the package is calling that for you. You can also call "Playidle <name of idle>" from an effect, which ignores conditions, but will only work properly if the animation is set to loop indefinitely and no other idles interrupt it. Do you have one of these calls somewhere?

Hmm yeah, I am now confused on a higher level :)

I only ever call the birthing from the one script as above other than that I only check for the token to prevent the player bodyswapping suring the animation as it makes their body invisible.

The package contains the animation in a special playIdle, the package has no conditions in GECK or FNVEdit, I can see a condition for the token count in FNVEdit of the Idle but not in GECK for whatever reason.

 

I'll try calling from PlayIdle instead as hopefully that will also fix the NPC re-equipping their armor issue.

Link to comment

the package has no conditions because they will be ignored if you call it via AddScriptPackage. The condition on the Idle is only used to prevent the idle to play on its own by the game engine if its location on the Idle Menu is somewhat above than General Idles. TL;DR it's not the token that's calling your idle, it's the AddScriptPackage, it's just another way to force the player to play an idle and be blocked/restrained in the meantime without extra code (like con_TFC, DisablePlayerControls etc.)

Link to comment

Switching between playidle/pickidle isn't going to help with the armor equpping I don't think. Sexout uses unequipitem itself and removes all their packages, adds the SexoutDoNothing package, and calls setrestrained 1 on them -- some combination of all this crap is probably responsible for them not trying to equip their armor again.

 

In your place I'd try to test manually with the console. SetRestrained 1 some NPC (testing on PC can introduce other issues and gotchas), add all the tokens and whatever else the conditions need, and call pickidle on them in the console. If they don't play the animation, a condition isn't being met. Pickidle via the console will show you a sort of halfassed call stack representing how it decided on which idle to play.

Link to comment

Cool, I'll try adding SetRestrained, Play Idle made no difference at all. I've narrowed down and sorted the re-equipping, it happens when ever I add an ARMOR token Cass re-evaluates her outfits, so I used a spell instead.

Link to comment

The only other thing that pops to mind is we add the birthing animation to Sexout's list of animations if I can't sort it without duplicating half of SexoutNG, the frustrating thing is this used to work fine, just something stupid and simple has changed, or maybe I shouldn't be testing it on Cass, maybe it never worked on her.

Link to comment

Well... I'm working through creating a way for plugins to register their own animations with sexout right now. Been working on it all day actually, and some of yesterday too. It won't be ready for even a beta release until probably some time next weekend, but when it's done you can basically 'use' sexout and its normal calls to run your own animations. For most people there will only be one step -- registering their animations with sexout so that other mods can use them.

 

For you I suppose there will be two steps. Registering as above, and then also calling sexout to play the animation.

 

This works exactly like any other sexout call, but there will be some additional arguments required to filter just the animations you want. If you give your animation flags that no other plugins (including sexout itself) are using, then the random picker will pick only from the animations flagged that way in your mod.

 

I don't want to get into the details now, the details are still potentially in flux and this is the wrong thread for it anyway, but if you can't get your issue figured out, there will be 'another way' before too long.

Link to comment

Hmm discovered some interesting things about UDF's

 

I firstly discovered they do run instantly and usually complete before the next line in the calling script.

 

But then I also found that the below script I designed to reset NX variables and remove pregnancy tokens failed and got stuck in a loop, it seemed iCnt just kept resetting to screwed up numbers so it was stuck in a continual While Loop.

I moved the same script to a token and added the valid actor checks and gave it to the Player and it all ran as designed with no problems.

 

 

 

scn SexoutP0SPregReset

; *** Resets NX & Tokens in SexoutPregnancy depending on groups

ref rActor
int iOkToRun
int iRemoving
int iResetNum
int iCnt
int iCntB
ref rList
ref rItem
int iItemCount

Begin GameMode

Set rActor to GetContainer

	if rActor && iRemoving < 1
		Set iOkToRun to 0
		if rActor.GetIsSex Female || rActor.GetIsSex Male || rActor.GetIsCreature
			Set iOkToRun to 1
		endif

		Set iResetNum to gPregNXSOPReset

		if iOkToRun
; *** Single Actor with token
			rActor.NX_ClrEVFl "SOP" 2
			rActor.NX_ClrEVFo "SOP" 2
			Set iCntB to ListGetCount SexoutPFLTokens
			While iCntB > 0
				Set iCntB to iCntB - 1
				Set rItem to ListGetNthForm SexoutPFLTokens iCntB
				Set iItemCount to rActor.GetItemCount rItem
				if iItemCount > 0
					if rActor.GetEquipped ritem > 0
						rActor.UnEquipItem ritem 1 1
					endif
					rActor.RemoveItem rItem iItemCount 1
					DebugPrint "PregUDFReset1NX %1.0f: %n Removed %1.0fx %n" iCntB rActor rItem iItemCount
				endif
			Loop
			DebugPrint "PregUDFReset1NX %1.0f: SOP Variables Reset %3.0f %n" gPregNXSOPReset iCnt rActor

			if iResetNum > 1
; *** Pick list of Actors
				Set rList to SexoutPFertileActorsGroup2F
				Set iCnt to ListGetCount rList
				While iCnt > 0
					Set iCnt to iCnt - 1
					Set rActor to ListGetNthForm rList iCnt
					rActor.NX_ClrEVFl "SOP" 2
					rActor.NX_ClrEVFo "SOP" 2
					Set iCntB to ListGetCount SexoutPFLTokens
					While iCntB > 0
						Set iCntB to iCntB - 1
						Set rItem to ListGetNthForm SexoutPFLTokens iCntB
						Set iItemCount to rActor.GetItemCount rItem
						if iItemCount > 0
							if rActor.GetEquipped ritem > 0
								rActor.UnEquipItem ritem 1 1
							endif
							rActor.RemoveItem rItem iItemCount 1
							DebugPrint "PregUDFReset2NX %1.0f: %n Removed %n" iCntB rActor rItem
						endif
					Loop
					DebugPrint "PregUDFReset2NX %1.0f: SOP Variables Reset %3.0f %n" gPregNXSOPReset iCnt rActor
				Loop
			endif

			if iResetNum > 2
				Set rList to SexoutPFertileActorsGroup3F 
				Set iCnt to ListGetCount rList
				While iCnt > 0
					Set iCnt to iCnt - 1
					Set rActor to ListGetNthForm rList iCnt
					rActor.NX_ClrEVFl "SOP" 2
					rActor.NX_ClrEVFo "SOP" 2
					Set iCntB to ListGetCount SexoutPFLTokens
					While iCntB > 0
						Set iCntB to iCntB - 1
						Set rItem to ListGetNthForm SexoutPFLTokens iCntB
						Set iItemCount to rActor.GetItemCount rItem
						if iItemCount > 0
							if rActor.GetEquipped ritem > 0
								rActor.UnEquipItem ritem 1 1
							endif
							rActor.RemoveItem rItem iItemCount 1
							DebugPrint "PregUDFReset3NX %1.0f: %n Removed %n" iCntB rActor rItem
						endif
					Loop
					DebugPrint "PregUDFReset3NX %1.0f: SOP Variables Reset %3.0f %n" gPregNXSOPReset iCnt rActor
				Loop
			endif

			if iResetNum > 3
				Set rList to SexoutSFLDataActorsUsingNX
				Set iCnt to ListGetCount rList
				While iCnt > 0
					Set iCnt to iCnt - 1
					Set rActor to ListGetNthForm rList iCnt
					rActor.NX_ClrEVFl "SOP" 2
					rActor.NX_ClrEVFo "SOP" 2
					Set iCntB to ListGetCount SexoutPFLTokens
					While iCntB > 0
						Set iCntB to iCntB - 1
						Set rItem to ListGetNthForm SexoutPFLTokens iCntB
						Set iItemCount to rActor.GetItemCount rItem
						if iItemCount > 0
							if rActor.GetEquipped ritem > 0
								rActor.UnEquipItem ritem 1 1
							endif
							rActor.RemoveItem rItem iItemCount 1
							DebugPrint "PregUDFReset4NX %1.0f: %n Removed %n" iCntB rActor rItem
						endif
					Loop
					DebugPrint "PregUDFReset4NX %1.0f: SOP Variables Reset %3.0f %n" gPregNXSOPReset iCnt rActor
				Loop
			endif

			DebugPrint "PregUDFResetNX END"
			Set gPregNXSOPReset to 0
			Set iOkToRun to -1
		endif ; *** iOkToRun
	
		if iOkToRun < 0
			Set iRemoving to 1
			RemoveMe
		endif
	endif ; *** rActor & IRemoving < 1

End

 

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more information, see our Privacy Policy & Terms of Use