genericuser27 Posted May 8, 2015 Posted May 8, 2015 So I am having this problem where my character is entering the cell where the trigger is. My character ends up equipping and unequipping slave collars, I think the problem is that the script just continues to run over and over again (in the console it keeps repeating "enslaved finished"). I've tried using a "Begin OnTriggerEnter Player" but the script does not go off. This is also the first mod I'm working on so bare with me . scn testscript float timer begin GameModeif( playerRef.isSpellTarget SexoutSlaveryFreePlayer )if(timer < 1)set timer to timer + getSecondsPassedreturnendifset SexoutSlaveryPlayerQ.SlaveryID to 128set SexoutSlaveryPlayerQ.master to testnpcREFset SexoutSlaveryPlayerQ.slaveryType to 4set SexoutSlaveryPlayerQ.punishmentType to 2set SexoutSlaveryPlayerQ.takeItems to 1set SexoutSlaveryPlayerQ.workType to 1set SexoutSlaveryPlayerQ.stolenItemsContainer to testBoxREFset SexoutSlaveryPlayerQ.Collar to SexoutSKSTCollar02;set SexoutSlaveryPlayerQ.canSubmit to 1set SexoutSlaveryPlayerQ.noWeapons to 1set SexoutSlaveryPlayerQ.noClothes to 1set SexoutSlaveryPlayerQ.dismissCompanions to 1AddFormToFormList SexoutSlaverySafeCells testcellAddFormToFormList SexoutSlaveryEquipmentAllowed SexoutSlaverySlaveCollarAddFormToFormList SexoutSlaveryEquipmentAllowed SexoutSKSTCollar02playerRef.CIOS SexoutSlaveryEnslavePlayerRemoveMeelseif( playerRef.isSpellTarget SexoutSlaveryEnslavePlayer == 0)playerRef.CIOS SexoutSlaveryFreePlayerendifend EDIT: The issue was the first if statement, will look more into it later but I'm changing it to something simpler.
Guest Posted May 8, 2015 Posted May 8, 2015 if you need to do a single execution, you can set a variable scn testscript float timer INT BDOONCE begin GameMode if( playerRef.isSpellTarget SexoutSlaveryFreePlayer ) if(timer < 1) set timer to timer + getSecondsPassed return endif IF BDOONCE == 0 SET BDOONCE TO 1 ; AND NOW EVERYTHING ELSE set SexoutSlaveryPlayerQ.SlaveryID to 128 set SexoutSlaveryPlayerQ.master to testnpcREF set SexoutSlaveryPlayerQ.slaveryType to 4 set SexoutSlaveryPlayerQ.punishmentType to 2 set SexoutSlaveryPlayerQ.takeItems to 1 set SexoutSlaveryPlayerQ.workType to 1 set SexoutSlaveryPlayerQ.stolenItemsContainer to testBoxREF set SexoutSlaveryPlayerQ.Collar to SexoutSKSTCollar02 ;set SexoutSlaveryPlayerQ.canSubmit to 1 set SexoutSlaveryPlayerQ.noWeapons to 1 set SexoutSlaveryPlayerQ.noClothes to 1 set SexoutSlaveryPlayerQ.dismissCompanions to 1 AddFormToFormList SexoutSlaverySafeCells testcell AddFormToFormList SexoutSlaveryEquipmentAllowed SexoutSlaverySlaveCollar AddFormToFormList SexoutSlaveryEquipmentAllowed SexoutSKSTCollar02 playerRef.CIOS SexoutSlaveryEnslavePlayer RemoveMe elseif( playerRef.isSpellTarget SexoutSlaveryEnslavePlayer == 0) playerRef.CIOS SexoutSlaveryFreePlayer endif ENDIF end The OnTriggerEnter Player will work for a single frame, so the timer won't work as you expect. If you need that a code is executed during a certain amount of time, you can use the OnTriggerEnter to define the begin, and the you use a GameMode to handle the rest of the code, in this way: scn MyScript int bActivated Begin OnTriggerEnter Player if bActivated == 0 Let bActivated := 1 endif End Begin GameMode If bActivated == 1 Let bActivated := 2 ; do the rest of the code else Return endif End When you go in the trigger, you set the variable bActivated to 1, at that point the GameMode block will execute the code. Since bActivated is setted to 2 as first thing, it means ";do the rest of the code" will only have a single execution.
genericuser27 Posted May 8, 2015 Author Posted May 8, 2015 The first script where we added BDOONCE didn't work, in my head it seemed like it would. Will try the other script. EDIT: goofed on something, testing again. EDIT2: No luck Still, will try the other script now. Also does it matter that the script is in a trigger object?
Guest Posted May 8, 2015 Posted May 8, 2015 I don't know what the script is supposed to do and I only wrote you how to make a single execution of it. At this point, you should debug your script. For example, are you sure that the player is target of that spell? that's the culprit of all the script: if it won't happen, nothing else will be executed. To debug, I strongly suggest to run GECK with NVSE... it will allow you to use some functions that are very useful to debug. Look at this for example: ... begin GameMode if( playerRef.isSpellTarget SexoutSlaveryFreePlayer ) if(timer < 1) set timer to timer + getSecondsPassed return endif IF bDoOnce == 0 Set bDoOnce to 1 PRINTC "THE SCRIPT HAS EXECUTED" set SexoutSlaveryPlayerQ.SlaveryID to 128 ... If the player is spell target, after 1 second you must see on console the sentence "THE SCRIPT HAS EXECUTED" - if you don't see it, then you know there's a problem in the block before. Also does it matter that the script is in a trigger object? Yes. If it's simply a gamemode, it would be good to use a quest script. If you use OnTriggerEnter, then of course you will use a trigger
genericuser27 Posted May 8, 2015 Author Posted May 8, 2015 How do I run GECK with NVSE? Geck isnt letting the 2nd script you gave me work :/ I've spend almost two hours trying to figure this out, I want it done!
Guest Posted May 8, 2015 Posted May 8, 2015 Geck isnt letting the 2nd script you gave me work :/ Let bActivated := 2 This line uses NVSE 4+ You can replace it with: Set bActivated to 2
Guest Posted May 8, 2015 Posted May 8, 2015 To start GECK with NVSE, create a shortcut of nvse_loader and then add the -editor parameter at the end, like this: "c:\SteamApps\common\fallout new vegas\nvse_loader.exe" -editor
techiespeek Posted May 8, 2015 Posted May 8, 2015 You have to really have a great deal of patience with scripts and scripting vane000, it's a very long and painful road, some folks just are not good at wrapping their head around it, it's like "seeing" a 2D texture and knowing how it will look on a 3D mesh, that one still drives me insane. You will get it, one time it will just go off like a light bulb and things will become clear. Your fortunate to have A.J. to help , I can recall when she was still learning it.
genericuser27 Posted May 8, 2015 Author Posted May 8, 2015 It ended being the first if statement in the script, will look into it later. Thanks AJ!
Guest Posted May 8, 2015 Posted May 8, 2015 both the first and the second "if" script blocks are using Let
Guest Posted May 8, 2015 Posted May 8, 2015 scn MyScriptint bActivatedBegin OnTriggerEnter Player if bActivated == 0 Let bActivated := 1 endifEndBegin GameMode If bActivated == 1 Let bActivated := 2 ; do the rest of the code else Return endifEnd I've repeated the same error twice
Recommended Posts
Archived
This topic is now archived and is closed to further replies.