Jump to content

General Geck help (Unequipping armor edition)


Guest user29

Recommended Posts

Posted
Fair point' date=' Hal. Stuff like this always has a coupla catches that you easily forget if it's been a while ;)

 

User, you should add a small check:

set rClothingItem to characterRefID.GetEquippedObject 2 ; check UB-slot gear
if rClothingItem
if -1 == ListGetFormIndex FormListID rClothingItem ;
characterRefID.unequipitem rClothingItem 0 0/1 ;(1 if you want to hide the message)
endif
endif [/Code]

[/quote']

Yeah, I'm not sure if trying to unequip "nothing" will crash the script or not.

Posted

Borrowing user29's thread again... :D

 

I wanted to implement a simple 'penalty' of sorts if the PC is naked or has either one of the sexoutBreeder's bigger tits equipped.

 

I made an .esp dependant on BrutalRapers and Breeder, and created the following quest script:

 

 

 

scn sexoutStalkerFrenzyScript

begin gameMode

   if playerREF.GetEquipped SexoutSLClothAppearNaked == 1 || playerREF.GetEquipped A5E4Tits == 1 || playerREF.GetEquipped A5E5Tits == 1 || playerREF.GetEquippedObject 2 < 1

       set SexoutRapers.stalkRate to 80

       else

           set SexoutRapers.stalkRate to 2

   endif

end

 

 

 

But it doesn't seem to do anything to the stalkRate, any ideas why?

Posted

Broc: try doing something like this:

 


scn sexoutStalkerFrenzyScript

ref rUBArmor

begin gameMode

set rUBArmor to player.GetEquippedObject 2
if rUBArmor
if player.getequipped SexoutSLClothAppearNaked || player.GetEquipped A5E4Tits || player.GetEquipped A5E5Tits
set SexoutRapers.stalkRate to 80
else
set SexoutRapers.stalkRate to 2
endif
else
set SexoutRapers.stalkRate to 80
endif

End
[/Code]

Posted

Lets say I have an npc that is initially disabled. I enable that NPC and it patrols when my quest gets to a certain point. Lets say that npc dies. Will it respawn? Or will it's reincarnation start disabled as well?

 

Is there a better way to make a patrol that only spawns (but will keep respawning if killed) after a certain point in a quest?

 

This is really not my area of expertise, but I'm guessing you make the NPC's character base, give him the AI he needs, add him to a levelled list, drag it into the cell, give the reference a name, mark it as persistent and initially disabled. Then enable the ref at some point.

 

A good example, although with creatures is Bonnie Springs, where the cazadores only start spawning when you killed the gang there. In the cell you'll find 'initially disabled' references (eg VERT3SMCazador14REF) of a creature-levelled list, consisting of a few creature base forms. So that's pretty much the template, I think.

Posted

Broc: try doing something like this:

 

 


scn sexoutStalkerFrenzyScript

ref rUBArmor

begin gameMode

set rUBArmor to player.GetEquippedObject 2
if rUBArmor
if player.getequipped SexoutSLClothAppearNaked || player.GetEquipped A5E4Tits || player.GetEquipped A5E5Tits
set SexoutRapers.stalkRate to 80
else
set SexoutRapers.stalkRate to 2
endif
else
set SexoutRapers.stalkRate to 80
endif

End
[/Code]

 

 

 

Still nothing, could it be that something in BrutalRapers MCM is overriding the variable?

Posted

Still nothing' date=' could it be that something in BrutalRapers MCM is overriding the variable?

[/quote']

 

Could be. I don't know the insides of BR - figured the problem was with "playerREF.GetEquippedObject 2 < 1"

Posted

Broc: try doing something like this:

 

 


scn sexoutStalkerFrenzyScript

ref rUBArmor

begin gameMode

set rUBArmor to player.GetEquippedObject 2
if rUBArmor
if player.getequipped SexoutSLClothAppearNaked || player.GetEquipped A5E4Tits || player.GetEquipped A5E5Tits
set SexoutRapers.stalkRate to 80
else
set SexoutRapers.stalkRate to 2
endif
else
set SexoutRapers.stalkRate to 80
endif

End
[/Code]

 

 

 

Still nothing' date=' could it be that something in BrutalRapers MCM is overriding the variable?

[/quote']

 

MCM should not interfere unless you access the menu.

try adding printC inside your if/else/endif block. At least you will confirm it is used.

  • 2 weeks later...
Posted

In-world radios often don't play when loading a save game made near one that was playing. At least they don't in my game. Whether it's a reference flagged as "on by default" (or something like that) or a reference with an auto-activate script on them that runs on load.

So it's kinda difficult to make sure, aside from the fact there's no function for it.

 

From what I've seen you can assume that a radio reference flagged as 'on by default' will begin playing when it first loads, or when you transition into the cell after leaving it. The only thing that can affect that is either the player turning it off manually or a game load. And we can check for that. Does this happen in a specific cell only?

Posted
Yes. That list works. I was using nudebodies' date=' but that one only seemed to work right for upperbody slot armors.[/quote']

SexoutNGSafeClothesM & SexoutNGSafeClothesF are the ones I'm adding all the SCR collars, gags, shackles etc to, so I assume they work.

  • 2 weeks later...
Posted

Ok. So I'm adding a random prospector to a formlist through dialogue. In my quest script I have this.

 

	if GetStage A4nVFQ >= 61 && (ListGetCount A4NovacRecruitsList > 0)
		set iFLCount to ListGetCount A4NovacRecruitsList
		Label 1
		set rFLRef to ListGetNthForm A4NovacRecruitsList iFLCount
		rFLRef.evp
		if rFLRef.getiscurrentpackage A4NovacWanderPackage == 0
			rFLRef.addscriptpackage A4NovacWanderPackage
			showmessage A4Attack
		endif
		set iFLCount to iFLCount - 1
		if iFLCount >= 1
		GoTo 1
		else
		;;run free
		showmessage A4DrinkBeer				
		endif

endif

 

Just ignore the messages' date=' they're how I'm debugging. The .evp was just something I was trying before I noticed it wasn't even detecting the prospector wasn't updating her package. Right now I'm not getting any messages. Which probably isn't good. Basically once the NPC is on this form list I want them to wander around Novac. This was the best way i could think of to do it.

 

I think I'm close but there's something there I'm just not seeing.

[/quote']

 

Lists are indexed from 0, so start with set LCount to LCount - 1

 

 if GetStage A4nVFQ >= 61 && (ListGetCount A4NovacRecruitsList > 0)
   set iFLCount to ListGetCount A4NovacRecruitsList
Label 1
	set iFLCount to iFLCount - 1
	set rFLRef to ListGetNthForm A4NovacRecruitsList iFLCount
	rFLRef.evp
	if rFLRef.getiscurrentpackage A4NovacWanderPackage == 0
		rFLRef.addscriptpackage A4NovacWanderPackage
		showmessage A4Attack
	endif
	if iFLCount > 0
		GoTo 1
	else
		;;run free
		showmessage A4DrinkBeer                
	endif

endif

  • 2 weeks later...
Posted
Easy one. I need to add a check to one of my scripts for if a specific reference is currently engaged in sex.

 

Is there some token or spell I can check for?

Sorry late getting back to your PM, posting here for others benefit You should be able to check for the Sexout Token

		if rZActor.GetItemCount 00SexoutActor > 0

If you need to know if it's rape there's Raper & Rapee tokes as well

		if rZActor.GetItemCount 00SexoutRapee
		DebugPrint "Preg2SexEvent %n is raped by %n" rZActor rZPartner
	elseif rZActor.GetItemCount 00SexoutRaper
		DebugPrint "Preg2SexEvent %n is raping %n" rZActor rZPartner
	else
		DebugPrint "Preg2SexEvent %n is fucking with %n" rZActor rZPartner
	endif

Posted

I assume your script runs in gamemode, so it doesn't catch your un- & re-equipping in menumode. Your rOldClothes is still set to your leather armor from before you un- & re-equipped it, so your rNewClothes equals rOldClothes & nothing happens.

You could try this:

 

 if 1 != player.getequipped rOldClothes
set rClothingItem to player.GetEquippedObject 2
if -1 == ListGetFormIndex A4ApprovedOutfitsForMutation rClothingItem
player.unequipitem rClothingItem 0 1
endif
set rOldClothes to player.GetEquippedObject 2
endif [/Code]

 

in which case you don't really need the rNewClothes variable at all; rOldClothes is either nil due to rClothingItem being removed last time it ran, or something you're still wearing from before that's supposed to stay on.

 

Caveats:

Are nude/preg bodies in your form list, anything that auto-equips if naked? There could be some interference there.

Also, I'm not sure how the script behaves if rOldClothes isn't set to anything & is checked with getequipped. You may need to add an additional check at the end if you run into trouble with that:

[Code] ...
set rOldClothes to player.GetEquippedObject 2
if rOldClothes
else
set rOldClothes to rDummyID ; with rDummyID being something equippable as clothing but never actually used or equipped
endif
endif[/Code]

Just covering the bases there. I could be completely wrong though, due to not being sufficiently caffeinated.

Posted
So I'm back to this again.

 

set rNewClothes to player.GetEquippedObject 2
	if rNewClothes != rOldClothes
		set rClothingItem to player.GetEquippedObject 2 ; check UB-slot gear
		if  -1 == ListGetFormIndex A4ApprovedOutfitsForMutation rClothingItem ; 
			player.unequipitem rClothingItem 0 1
		endif
	endif
	set rOldClothes to player.GetEquippedObject 2

 

What I'm trying to do now is to only have it run through that form list checking outfits if the outfit the pc is wearing is different from the last time it's checked.

 

Whats happening is' date=' it'll remove any outfit that's not on the list (lets say leather armor), unless after it removes the leather armor, I reequip the leather armor. Then for some reason it fails to remove it.

 

It isn't getting past the if rNewClothes != rOldClothes check if I try to just reequip an item basically.

 

I probably just have something in the wrong order.[/quote']

You will probably find the new clothing hasn't had time to equip when you check for it, it can take up to 1-2 runs of the script sometimes before it detects the new outfit. It's best to only grab variables once incase they differ, I could be wrong but I believe it may also be slightly more time consuming in a script for the engine to go check a slot than just copy a variable.

You also need a check to make sure there is an outfit, if you try to remove "" you get a script crash.

I'd also call rNewClothes rCurrClothes, and rOldClothes rPrevClothes it may save you some confusion later :)

Posted

Can you try:

 if player.getequipped rPrevClothes
; somethin'/nothin'
else
set rClothingItem to player.GetEquippedObject 2
if rClothingItem
; your list check
set rPrevClothes to rClothingItem ; get rid of the rest
endif
[/Code]

Posted


; your quest conds here
set rCurrClothes to player.GetEquippedObject 2
if rCurrClothes
if rCurrClothes == rPrevClothes
player.unequipitem rCurrClothes 0 1
set rCurrClothes to 0
elseif -1 == ListGetFormIndex A4ApprovedOutfitsForMutation rCurrClothes
set rPrevClothes to rCurrClothes
player.unequipitem rCurrClothes 0 1
set rCurrClothes to 0
endif
endif
; quest cond endif [/Code]

 

?

(exchanged rClothingItem for rCurrClothes there - makes more sense in this structure)

Posted
All right' date=' so I modified that to this

 

and it no longer freezes up the script. However, we're back to it not wanting to unequip the same outfit it's already unequiped, if it was the last outfit it unequiped.

 

So lets say I put on a merc outfit. It'll unequip that. But if I put that merc outfit back on, it won't unequip it. However, if I put on a leather armor, it'll unequip that. Then if I put back on the merc outfit after it unequiped the leather outfit it'll unequip the merc outfit again.

I think we're close, just got something out of order. I played around with it for 20 minutes and couldn't solve it though.[/quote']

Yeah you might want to look at my Bodyswapping Script in Pregnancy it does this stuff, I had the proglem of Freezing if was the equipped outfit (naked) :)

Posted

How's this tool set up? If it's in a quest script it may not be quick enough to avoid the armor being flagged as rPrevClothes in the elseif statement, causing it to be removed in the "if rCurrClothes == rPrevClothes" bit.

You could try exporting the add-to-list stuff to a spell script that dispels when done, and change "if rCurrClothes" to "if rCurrClothes && (actorRef.IsSpellTarget SpellID == 0)". Or something similar with a token that removes itself and a GetItemCount check instead.

Posted

You probably need to add "if rClothingItem" between those two lines, make sure it's actually been detected before adding it to the list. For that reason, you probably need to add a little menumode block that does the same thing if it hasn't been detected, if it's only in a block that runs once right now, like OnEquip.

 

I don't think directly writing to the rCurrClothes quest var is necessary - it keeps being detected anyway.

Posted

Any reason why I'm getting an "aborted due to 2.0" error while trying to start sex in the end result script of a package? I want the deathclaws to run up to the women instead of just jumping to them' date=' but every single time at the end of the package they just walk away and it tells me the 2.0 error.

 

Dunno if it's the problem, but the result script basically checks the quest script for the two references.

 

ref rBreeder to A4NVFQ.rBreeder
ref rBreedee to A4NVFQ.rBreedee

set SexoutNG.actorA to rBreeder
set SexoutNG.actorB to rBreedee
set SexoutNG.CBItemB to A4DCEVPToken
set SexoutNG.CBItemA to A4DCEVPToken
rBreedee.CIOS SexoutBegin

[/quote']

 

I wouldn't set a reference twice in the same frame. You should probably eliminate the local variables and set actorA to A4NVFQ.rBreeder and actorB to A4NVFQ.rBreedee. The idea is that the sets of rBreeder and rBreedee may take longer than 1 frame to complete and are empty when you set the SexoutNG quest vars.

 

The other possibility is that A4NVFQ is an unresolved reference at run-time but I'm guessing you're mastered to the file that has it or it's internal to your esp so probably not the issue.

 

So, basically:

set SexoutNG.actorA to A4NVFQ.rBreeder
set SexoutNG.actorB to A4NVFQ.rBreedee
set SexoutNG.CBItemB to A4DCEVPToken
set SexoutNG.CBItemA to A4DCEVPToken
rBreedee.CIOS SexoutBegin

 

EDIT: Notice how I avoided ranting and raving about using local variables in a script fragment? I'm getting better... ;)

Posted

Ok thanks that was it' date=' though it didn't like it when I

 

A4NVFQ.rBreedee.CIOS SexoutBegin

 

So I just declared one variable at the top for that CIOS and it didn't have any trouble with that.

[/quote']

 

Yeah, unfortunately, FONV does not support property chaining. You can only use one accessor character (meaning the property/method accessor known as a period). You can do the following:

Object.Method Object.Property

but not:

Object.Property.Method

 

So rBreedee.CIOS is ok but A4NVFQ.rBreedee.CIOS is not.

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

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