Перейти к содержанию

Sazan's Theme

Вопросы по моддингу Fallout 3 и New Vegas

Рекомендуемые сообщения

Методом сравнения имеющегося скрипта и тыка вывела такое:

if ListGetFormIndex aaHookUpsBannedNPC scan > -1 && ListGetFormIndex aaHookUpAllowedCells scan == 0

Правильно ли? 

 

Не понимаю, почему -1, но в этом же скрипте используются формлисты, и в условиях, где логически значение позитивное (НПС принадлежит этому списку), выставлено так.

Поделиться сообщением


Ссылка на сообщение

Тогда как-то так (может не работать, т.к. сходу я обычно косячу):

ref rCurCell

Begin GameMode

...

   Let rCurCell := Player.GPC ; Функция GetParentCell. Вместо Player можно подавать любой ref, необязательно НПС
   If (rCurCell.IsInList [ID листа]) && ([Ref ID НПС].IsInList [ID листа] == 0)
      что-то делаем
   Endif

...

End

Вообще фраза "(реф НПС) НЕ в списке запрещенных НПС" немного некорректная. Дело в том, что можно сделать лист, где хранятся именно REFы НПС, а можно, где Base Formы НПС. И если бы лист был именно с РЕФами, то IsInList не сработал бы, ибо он берёт реф, как параметр, смотрит его Base Form и ищет именно Base Form в листе. Всегда есть НВСЕшный IsRefInList, который сработает и с рефами, и с Base формами, но тут тебе это не нужно. Я почти что уверен, что список делается путём переноса НПС в сам лист.

Поделиться сообщением


Ссылка на сообщение

Методом сравнения имеющегося скрипта и тыка вывела такое:

if ListGetFormIndex aaHookUpsBannedNPC scan > -1 && ListGetFormIndex aaHookUpAllowedCells scan == 0

Правильно ли? 

 

Не понимаю, почему -1, но в этом же скрипте используются формлисты, и в условиях, где логически значение позитивное (НПС принадлежит этому списку), выставлено так.

Чуть более высокий уровень скриптинга - тут и НПС, и ячейки в одном листе. Эта функция возвращает -1 только, когда объекта нет в списке. Следовательно > -1 означает, что объект всё же где-то есть. Он может лежать под номером 0, под 10 и т.д. (нумерация объектов, как ты наверно заметила, начинается с 0). А вот == 0 - очень сомнительная вещь, ибо сработает только когда Scan = первому объекту в листе. Вероятно, имеется в виду == -1, т.е. объекта нет в листе. Тогда как раз таки твоя вторая формулировка "если ячейка НЕ в списке и НПС В списке - аборт (там есть такая команда)." будет выполняться.

  • Нравится 1

Поделиться сообщением


Ссылка на сообщение

Первый пост - явно не то. Мне нужно просто условие для уже имеющегося списка условий абортинга сканера - просто подставить новый мини-блок, а не писать новый скрипт.

 

Второй пост, т.е., должно быть так - 

if ListGetFormIndex aaHookUpsBannedNPC scan > -1 && ListGetFormIndex aaHookUpAllowedCells scan == -1

Верно?

 

Задача как раз стоит в том, чтобы задать условие - ячейки нет в списке, НПС есть. Решила так потому, что разрешенных ячеек будет мало (с десяток - бары и салуны), и запрещенных нпс, соответственно, тоже мало (квестовые именные, как то мориарти например).

Поделиться сообщением


Ссылка на сообщение

А, ну так бы и сказала, что тебе нужно просто условие. Тогда я не уверен, что сработает, ибо я не знаю, как задаётся переменная scan. Вполне вероятно напорется на ту проблему, которую я описал в первом посте. Но надо тестить. А так да, вроде верно.

Поделиться сообщением


Ссылка на сообщение

Ну, в других подблоках этого блока с формлистами так и сделано. Я честно не понимаю, что там и как, сделала просто по аналогии.

Поделиться сообщением


Ссылка на сообщение

Не работает, По крайней мере, ячейка - точно.

 

Вот полный текст скрипта:

 

 

 

scn 00SexoutHookupQuestScript

short playing
float approach
short legion
short powder
short kings
short khans
short ncrWhore
short Whoring

short doLegion
short doPowder
short doKings
short doKhans
short doNCRwhore
short doWhoring

short mLegion
short mPowder
short mKings
short mKhans
short mNCRwhore
short mWhoring

ref SexoutNCRWhore
ref targetRef
int iSelf

short init

short scanChance
short scanIndex
short scanCount
short subLoops
short loopDelay

float fDelay

Begin GameMode

	if init < 5
		set init to 5
		set approach to 1.5
		set scanIndex to 0
		set subLoops to 5
		set loopDelay to 300 / subLoops
	endif

	if GetGameLoaded
		PrintC "SexoutHookups:	загрузка..."
		set iSelf to GetModIndex "SexoutHookups.esm"
		if 255 == iSelf
			set iSelf to GetModIndex "SexoutHookups.esp"
		endif
		if 255 == iSelf
			set iSelf to GetModIndex "SexoutHookupsAlt.esm"
		endif
		if 255 == iSelf
			set iSelf to GetModIndex "SexoutHookupsAlt.esp"
		endif
		set targetRef to BuildRef iSelf 2781
		PrintC "SexoutHookups:	Quest is %i" targetRef 
		set targetRef to BuildRef iSelf 18649
		PrintC "SexoutHookups:	DebugQuest is %i" targetRef 
		set targetRef to BuildRef iSelf 18651
		PrintC "SexoutHookups:	DebugOffQuest is %i" targetRef 
	endif

	if GetGameRestarted
		set SexoutNCRWhore to 0
		set mKhans to 0
		set mKings to 0
		set mLegion to 0
		set mNCRwhore to 0
		set mPowder to 0
		set mWhoring to 0

		if IsModLoaded "sexoutKhans.esp"
			set mKhans to GetModIndex "sexoutKhans.esp"
		endif
		if IsModLoaded "sexoutKhans.esm"
			set mKhans to GetModIndex "sexoutKhans.esm" 
		endif
		if IsModLoaded "sexoutKings.esp"
			set mKings to GetModIndex "sexoutKings.esp" 
		endif
		if IsModLoaded "sexoutKings.esm"
			set mKings to GetModIndex "sexoutKings.esm" 
		endif
		if IsModLoaded "sexoutLegion.esp"
			set mLegion to GetModIndex "sexoutLegion.esp"
		endif
		if IsModLoaded "sexoutLegion.esm"
			set mLegion to GetModIndex "sexoutLegion.esm"
		endif
		if IsModLoaded "sexoutNCR.esp"
			set mNCRwhore to GetModIndex "sexoutNCR.esp"
			set SexoutNCRWhore to BuildRef mNCRwhore 160621
		endif
		if IsModLoaded "sexoutNCR.esm"
			set mNCRwhore to GetModIndex "sexoutNCR.esm"
			set SexoutNCRWhore to BuildRef mNCRwhore 160621
		endif
		if IsModLoaded "sexoutPowderGangers.esp"
			set mPowder to GetModIndex "sexoutPowderGangers.esp"
		endif
		if IsModLoaded "sexoutPowderGangers.esm"
			set mPowder to GetModIndex "sexoutPowderGangers.esm"
		endif
		if IsModLoaded "sexoutProstitutes.esp"
			set mWhoring to GetModIndex "sexoutProstitutes.esp"
		endif
		if IsModLoaded "sexoutProstitutes.esm"
			set mWhoring to GetModIndex "sexoutProstitutes.esm"
		endif
		if IsModLoaded "sexoutWorkinhGirl.esp"
			set mWhoring to GetModIndex "sexoutWorkinhGirl.esp"
		endif
		if IsModLoaded "sexoutWorkinhGirl.esm"
			set mWhoring to GetModIndex "sexoutWorkinhGirl.esm"
		endif
	endif

	short startwhile
	short endwhile
	set endwhile to 1

	set doKhans to Khans * mKhans
	set doKings to Kings * mKings
	set doLegion to Legion * mLegion
	set doNCRwhore to NCRwhore * mNCRwhore
	set doPowder to Powder * mPowder
	set doWhoring to Whoring * mWhoring

	set targetRef to playerRef

	ref scan
	set scan to GetFirstRef 200

      ; lets put a little delay here
     if fDelay > 0
       set fDelay to fDelay - GetSecondsPassed
       return
    endif
     set fDelay to loopDelay

    set scanChance to (scanChance + 1) % subLoops ; one of 'subLoops' people tested at a time

    set scan to GetFirstRef 200
    set scanCount to 0
    set scanIndex to 0

    
    Label startwhile
    set scanIndex to (scanIndex +1) % subLoops

	if scan
        if (scanIndex == scanChance)
			if scan.IsChild
				set scan to GetNextRef
				Goto startwhile
			endif
			if ListGetFormIndex aaHookUpsBannedNPC scan > -1 && ListGetFormIndex aaHookUpAllowedCells scan == -1
					set scan to GetNextRef
					Goto startwhile
			endif
			if scan == playerRef
				set scan to GetNextRef
				Goto startwhile
			endif
			if scan.GetDisabled
				set scan to GetNextRef
				Goto startwhile
			endif
			if scan.GetIsCreature
				set scan to GetNextRef
				Goto startwhile
			endif
			if scan.GetPlayerTeammate || scan.GetFactionRank FollowerFaction > -1
				set scan to GetNextRef
				Goto startwhile
			endif
			if scan.IsChild
				set scan to GetNextRef
				Goto startwhile
			endif
			if scan == playerRef
				set scan to GetNextRef
				Goto startwhile
			endif
			if scan.GetDisabled
				set scan to GetNextRef
				Goto startwhile
			endif
			if scan.GetDead
				set scan to GetNextRef
				Goto startwhile
			endif
			if scan.GetUnconscious
				set scan to GetNextRef
				Goto startwhile
			endif
			if scan.GetRestrained
				set scan to GetNextRef
				Goto startwhile
			endif

			if ListGetFormIndex SexoutSLActorDataIsReserved scan > -1
					set scan to GetNextRef
					Goto startwhile
			endif
			if scan.IsInList SexoutSLActorDataIsReserved
					set scan to GetNextRef
					Goto startwhile
			endif

			if ListGetFormIndex SexoutListBannedActor scan > -1
				set scan to GetNextRef
				Goto startwhile
			endif
			if scan.IsInList SexoutListBannedActor
					set scan to GetNextRef
					Goto startwhile
			endif

			if ListGetFormIndex SexoutSLActorDataHatesSex scan > -1
				set scan to GetNextRef
				Goto startwhile
			endif
			if scan.IsInList SexoutSLActorDataHatesSex
					set scan to GetNextRef
					Goto startwhile
			endif

			if ListGetFormIndex SexoutSLActorDataIsNotLookingForSex scan > -1
				set scan to GetNextRef
				Goto startwhile
			endif
			if scan.IsInList SexoutSLActorDataIsNotLookingForSex
					set scan to GetNextRef
					Goto startwhile
			endif

			if ListGetFormIndex SexoutSLActorDataIsPartneredFaithfully scan > -1
				set scan to GetNextRef
				Goto startwhile
			endif
			if scan.IsInList SexoutSLActorDataIsPartneredFaithfully
					set scan to GetNextRef
					Goto startwhile
			endif

			if scan.GetIsClass Prostitute
				set scan to GetNextRef
				Goto startwhile
			endif

			if doPowder
				if scan.GetInFaction vDialoguePowderGangerFaction
					set scan to GetNextRef
					Goto startwhile
				endif
			endif

			if doLegion
				if scan.GetInFaction vCaesarsLegionFaction
					set scan to GetNextRef
					Goto startwhile
				endif
			endif

			if doKings
				if scan.GetInFaction vKingsDialogueFaction
					set scan to GetNextRef
					Goto startwhile
				endif
			endif

			if doKhans
				if scan.GetInFaction vGreatKhansDialogueFaction
					set scan to GetNextRef
					Goto startwhile
				endif
			endif

			if doNCRwhore
				if scan.GetinFaction vNCRMilitaryDialogueFaction
					if targetRef.GetEquipped SexoutNCRWhore
						set scan to GetNextRef
						Goto startwhile
					endif
				endif
			endif

			if doWhoring
				; what we really want is:
				;	set scan to BuildRef mWhoring 139704
				;	if scan.whoremode
				if targetRef.GetEquipped SexoutListProstituteOutfits	; far from perfect as WorkingGirl allows whoring in arbitrary clothes
					set scan to GetNextRef
					Goto startwhile
				endif
			endif

			if (0 == (scan.IsSpellTarget SexoutHookupEffect)) && (0 == (scan.IsSpellTarget SexoutHookupOld))
				short Limit
				; base change 50 over 200 (1 in 4)
				set Limit to 50
				;	if night, double limit
				if Gamehour > 19
					set Limit to 2 * Limit
				endif
				;	if nympho, double limit again or for first time if not night
				if ListGetFormIndex SexoutSLActorDataIsNymphomaniac scan > -1
					set Limit to 2 * Limit
				endif
				; boosts
				;	+ charisma * approach
				;	+ 1/100 of Evil Karma
				set Limit to (Limit + (scan.GetAv Karma / -100) + (targetRef.GetAV Charisma * approach))
				;	if wearing any armor with DT, make limit 0
				if player.getav damagethreshold > 25
					set Limit to 0 * Limit
				else
					set Limit to 1 * Limit
				endif
				short random
				set random to 2 * GetRandomPercent
				if random < Limit
					scan.CIOS SexoutHookupEffect
				else
					scan.CIOS SexoutHookupOld
				endif
			endif

		endif

		set scan to GetNextRef
		Goto startwhile
	endif
End

 

 

 

Что может быть не так?

Поделиться сообщением


Ссылка на сообщение

Насчет листов НПС вроде как вижу, что нужно добавить еще один подблок. Но что делать с ячейками? Сканер, судя по всему, сканирует только НПС.

 

Нужно как-то добавлять условие на то, в разрешенной ли ячейке ГГ, прямо в начале скрипта или как?

Поделиться сообщением


Ссылка на сообщение

Я попробовала всунуть условие из первого поста для работы скрипта как такового (в самое начало), но полезли эрроры:

 

8793bcacd1.png

 

 

3d7ccd3225.png

Поделиться сообщением


Ссылка на сообщение

А, ну естественно он работать не будет. Сканер тупо НПС и сканирует) В таком случае возвращаемся к моему первому посту, который я не зря написал. После блока проверки ребёнка (т.е. первого) пишем как-то так:

if ListGetFormIndex aaHookUpsBannedNPC scan > -1 && rCurCell.IsInList aaHookUpAllowedCells == 0
	set scan to GetNextRef
	Goto startwhile
endif

Про переменную вначале ты сама уже увидела. Строку вроде тоже написала.

Поделиться сообщением


Ссылка на сообщение

Ну, то, что я там написала, сделало так, что сканер не работает вообще.)

 

Сейчас попробую еще этот подблок.

Поделиться сообщением


Ссылка на сообщение

Судя по всему, не работает (сканер вообще стопорится).

 

Текст текущего скрипта:

 

 

 

scn 00SexoutHookupQuestScript

short playing
float approach
short legion
short powder
short kings
short khans
short ncrWhore
short Whoring

short doLegion
short doPowder
short doKings
short doKhans
short doNCRwhore
short doWhoring

short mLegion
short mPowder
short mKings
short mKhans
short mNCRwhore
short mWhoring

ref SexoutNCRWhore
ref targetRef
int iSelf

short init

short scanChance
short scanIndex
short scanCount
short subLoops
short loopDelay

ref rCurCell

float fDelay

Begin GameMode

Let rCurCell := Player.GPC

	if init < 5
		set init to 5
		set approach to 1.5
		set scanIndex to 0
		set subLoops to 5
		set loopDelay to 300 / subLoops
	endif

	if GetGameLoaded
		PrintC "SexoutHookups:	загрузка..."
		set iSelf to GetModIndex "SexoutHookups.esm"
		if 255 == iSelf
			set iSelf to GetModIndex "SexoutHookups.esp"
		endif
		if 255 == iSelf
			set iSelf to GetModIndex "SexoutHookupsAlt.esm"
		endif
		if 255 == iSelf
			set iSelf to GetModIndex "SexoutHookupsAlt.esp"
		endif
		set targetRef to BuildRef iSelf 2781
		PrintC "SexoutHookups:	Quest is %i" targetRef 
		set targetRef to BuildRef iSelf 18649
		PrintC "SexoutHookups:	DebugQuest is %i" targetRef 
		set targetRef to BuildRef iSelf 18651
		PrintC "SexoutHookups:	DebugOffQuest is %i" targetRef 
	endif

	if GetGameRestarted
		set SexoutNCRWhore to 0
		set mKhans to 0
		set mKings to 0
		set mLegion to 0
		set mNCRwhore to 0
		set mPowder to 0
		set mWhoring to 0

		if IsModLoaded "sexoutKhans.esp"
			set mKhans to GetModIndex "sexoutKhans.esp"
		endif
		if IsModLoaded "sexoutKhans.esm"
			set mKhans to GetModIndex "sexoutKhans.esm" 
		endif
		if IsModLoaded "sexoutKings.esp"
			set mKings to GetModIndex "sexoutKings.esp" 
		endif
		if IsModLoaded "sexoutKings.esm"
			set mKings to GetModIndex "sexoutKings.esm" 
		endif
		if IsModLoaded "sexoutLegion.esp"
			set mLegion to GetModIndex "sexoutLegion.esp"
		endif
		if IsModLoaded "sexoutLegion.esm"
			set mLegion to GetModIndex "sexoutLegion.esm"
		endif
		if IsModLoaded "sexoutNCR.esp"
			set mNCRwhore to GetModIndex "sexoutNCR.esp"
			set SexoutNCRWhore to BuildRef mNCRwhore 160621
		endif
		if IsModLoaded "sexoutNCR.esm"
			set mNCRwhore to GetModIndex "sexoutNCR.esm"
			set SexoutNCRWhore to BuildRef mNCRwhore 160621
		endif
		if IsModLoaded "sexoutPowderGangers.esp"
			set mPowder to GetModIndex "sexoutPowderGangers.esp"
		endif
		if IsModLoaded "sexoutPowderGangers.esm"
			set mPowder to GetModIndex "sexoutPowderGangers.esm"
		endif
		if IsModLoaded "sexoutProstitutes.esp"
			set mWhoring to GetModIndex "sexoutProstitutes.esp"
		endif
		if IsModLoaded "sexoutProstitutes.esm"
			set mWhoring to GetModIndex "sexoutProstitutes.esm"
		endif
		if IsModLoaded "sexoutWorkinhGirl.esp"
			set mWhoring to GetModIndex "sexoutWorkinhGirl.esp"
		endif
		if IsModLoaded "sexoutWorkinhGirl.esm"
			set mWhoring to GetModIndex "sexoutWorkinhGirl.esm"
		endif
	endif

	short startwhile
	short endwhile
	set endwhile to 1

	set doKhans to Khans * mKhans
	set doKings to Kings * mKings
	set doLegion to Legion * mLegion
	set doNCRwhore to NCRwhore * mNCRwhore
	set doPowder to Powder * mPowder
	set doWhoring to Whoring * mWhoring

	set targetRef to playerRef

	ref scan
	set scan to GetFirstRef 200

      ; lets put a little delay here
     if fDelay > 0
       set fDelay to fDelay - GetSecondsPassed
       return
    endif
     set fDelay to loopDelay

    set scanChance to (scanChance + 1) % subLoops ; one of 'subLoops' people tested at a time

    set scan to GetFirstRef 200
    set scanCount to 0
    set scanIndex to 0

    
    Label startwhile
    set scanIndex to (scanIndex +1) % subLoops

	if scan
        if (scanIndex == scanChance)
			if scan.IsChild
				set scan to GetNextRef
				Goto startwhile
			endif
			if ListGetFormIndex aaHookUpsBannedNPC scan > -1 && rCurCell.IsInList aaHookUpAllowedCells == 0
					set scan to GetNextRef
					Goto startwhile
			endif
			if scan.IsInList aaHookUpsBannedNPC
					set scan to GetNextRef
					Goto startwhile
			endif
			if scan == playerRef
				set scan to GetNextRef
				Goto startwhile
			endif
			if scan.GetDisabled
				set scan to GetNextRef
				Goto startwhile
			endif
			if scan.GetIsCreature
				set scan to GetNextRef
				Goto startwhile
			endif
			if scan.GetPlayerTeammate || scan.GetFactionRank FollowerFaction > -1
				set scan to GetNextRef
				Goto startwhile
			endif
			if scan.IsChild
				set scan to GetNextRef
				Goto startwhile
			endif
			if scan == playerRef
				set scan to GetNextRef
				Goto startwhile
			endif
			if scan.GetDisabled
				set scan to GetNextRef
				Goto startwhile
			endif
			if scan.GetDead
				set scan to GetNextRef
				Goto startwhile
			endif
			if scan.GetUnconscious
				set scan to GetNextRef
				Goto startwhile
			endif
			if scan.GetRestrained
				set scan to GetNextRef
				Goto startwhile
			endif

			if ListGetFormIndex SexoutSLActorDataIsReserved scan > -1
					set scan to GetNextRef
					Goto startwhile
			endif
			if scan.IsInList SexoutSLActorDataIsReserved
					set scan to GetNextRef
					Goto startwhile
			endif

			if ListGetFormIndex SexoutListBannedActor scan > -1
				set scan to GetNextRef
				Goto startwhile
			endif
			if scan.IsInList SexoutListBannedActor
					set scan to GetNextRef
					Goto startwhile
			endif

			if ListGetFormIndex SexoutSLActorDataHatesSex scan > -1
				set scan to GetNextRef
				Goto startwhile
			endif
			if scan.IsInList SexoutSLActorDataHatesSex
					set scan to GetNextRef
					Goto startwhile
			endif

			if ListGetFormIndex SexoutSLActorDataIsNotLookingForSex scan > -1
				set scan to GetNextRef
				Goto startwhile
			endif
			if scan.IsInList SexoutSLActorDataIsNotLookingForSex
					set scan to GetNextRef
					Goto startwhile
			endif

			if ListGetFormIndex SexoutSLActorDataIsPartneredFaithfully scan > -1
				set scan to GetNextRef
				Goto startwhile
			endif
			if scan.IsInList SexoutSLActorDataIsPartneredFaithfully
					set scan to GetNextRef
					Goto startwhile
			endif

			if scan.GetIsClass Prostitute
				set scan to GetNextRef
				Goto startwhile
			endif

			if doPowder
				if scan.GetInFaction vDialoguePowderGangerFaction
					set scan to GetNextRef
					Goto startwhile
				endif
			endif

			if doLegion
				if scan.GetInFaction vCaesarsLegionFaction
					set scan to GetNextRef
					Goto startwhile
				endif
			endif

			if doKings
				if scan.GetInFaction vKingsDialogueFaction
					set scan to GetNextRef
					Goto startwhile
				endif
			endif

			if doKhans
				if scan.GetInFaction vGreatKhansDialogueFaction
					set scan to GetNextRef
					Goto startwhile
				endif
			endif

			if doNCRwhore
				if scan.GetinFaction vNCRMilitaryDialogueFaction
					if targetRef.GetEquipped SexoutNCRWhore
						set scan to GetNextRef
						Goto startwhile
					endif
				endif
			endif

			if doWhoring
				; what we really want is:
				;	set scan to BuildRef mWhoring 139704
				;	if scan.whoremode
				if targetRef.GetEquipped SexoutListProstituteOutfits	; far from perfect as WorkingGirl allows whoring in arbitrary clothes
					set scan to GetNextRef
					Goto startwhile
				endif
			endif

			if (0 == (scan.IsSpellTarget SexoutHookupEffect)) && (0 == (scan.IsSpellTarget SexoutHookupOld))
				short Limit
				; base change 50 over 200 (1 in 4)
				set Limit to 50
				;	if night, double limit
				if Gamehour > 19
					set Limit to 2 * Limit
				endif
				;	if nympho, double limit again or for first time if not night
				if ListGetFormIndex SexoutSLActorDataIsNymphomaniac scan > -1
					set Limit to 2 * Limit
				endif
				; boosts
				;	+ charisma * approach
				;	+ 1/100 of Evil Karma
				set Limit to (Limit + (scan.GetAv Karma / -100) + (targetRef.GetAV Charisma * approach))
				;	if wearing any armor with DT, make limit 0
				if player.getav damagethreshold > 25
					set Limit to 0 * Limit
				else
					set Limit to 1 * Limit
				endif
				short random
				set random to 2 * GetRandomPercent
				if random < Limit
					scan.CIOS SexoutHookupEffect
				else
					scan.CIOS SexoutHookupOld
				endif
			endif

		endif

		set scan to GetNextRef
		Goto startwhile
	endif

End

 

 

 

Что может быть не так?

Поделиться сообщением


Ссылка на сообщение

Вот этот блок надо выкинуть

			if scan.IsInList aaHookUpsBannedNPC
					set scan to GetNextRef
					Goto startwhile
			endif

Не знаю, что может быть не так. Давай просто проверим работает ли сканер вообще.

После Label startwhile вставь строку print "1", после блока с детьми print "2", ну и после нашего блока print "3". А вообще не понимаю, почему тебе просто не убивать сканер вообще, если ГГ не в разрешённых ячейках находится?

Поделиться сообщением


Ссылка на сообщение

 

А вообще не понимаю, почему тебе просто не убивать сканер вообще, если ГГ не в разрешённых ячейках находится?

 

 

Потому что я понятия не имею, как это сделать?

Поделиться сообщением


Ссылка на сообщение

Как вариант, перед строкой с Label как раз таки и запихнуть

Let rCurCell := Player.GPC
If rCurCell.IsInList aaHookUpAllowedCells == 0

...
всё, что относится к циклу
...

Endif

То, что цифра 3 не появляется - это нормально, если ты не в разрешённой ячейке. Странно то, что 1 и 2 появились всего 1 раз. Походу весь скрипт ломается на какой-то строке...

Поделиться сообщением


Ссылка на сообщение

 

 

То, что цифра 3 не появляется - это нормально, если ты не в разрешённой ячейке.

 

Она не появилась и когда я зашла в разрешенную (второй скрин, салун мориарти).

Поделиться сообщением


Ссылка на сообщение

Давай попробуем так, потом посмотрим.

 

scn SexoutHookupQuestScript

short playing
float approach
short legion
short powder
short kings
short khans
short ncrWhore
short Whoring

short doLegion
short doPowder
short doKings
short doKhans
short doNCRwhore
short doWhoring

short mLegion
short mPowder
short mKings
short mKhans
short mNCRwhore
short mWhoring

ref SexoutNCRWhore
ref targetRef
int iSelf

short init

short scanChance
short scanIndex
short scanCount
short subLoops
short loopDelay

ref rCurCell

float fDelay

Begin GameMode

	if init < 5
		set init to 5
		set approach to 1.5
		set scanIndex to 0
		set subLoops to 5
		set loopDelay to 300 / subLoops
	endif

	if GetGameLoaded
		PrintC "SexoutHookups:	загрузка..."
		set iSelf to GetModIndex "SexoutHookups.esm"
		if 255 == iSelf
			set iSelf to GetModIndex "SexoutHookups.esp"
		endif
		if 255 == iSelf
			set iSelf to GetModIndex "SexoutHookupsAlt.esm"
		endif
		if 255 == iSelf
			set iSelf to GetModIndex "SexoutHookupsAlt.esp"
		endif
		set targetRef to BuildRef iSelf 2781
		PrintC "SexoutHookups:	Quest is %i" targetRef 
		set targetRef to BuildRef iSelf 18649
		PrintC "SexoutHookups:	DebugQuest is %i" targetRef 
		set targetRef to BuildRef iSelf 18651
		PrintC "SexoutHookups:	DebugOffQuest is %i" targetRef 
	endif

	if GetGameRestarted
		set SexoutNCRWhore to 0
		set mKhans to 0
		set mKings to 0
		set mLegion to 0
		set mNCRwhore to 0
		set mPowder to 0
		set mWhoring to 0

		if IsModLoaded "sexoutKhans.esp"
			set mKhans to GetModIndex "sexoutKhans.esp"
		endif
		if IsModLoaded "sexoutKhans.esm"
			set mKhans to GetModIndex "sexoutKhans.esm" 
		endif
		if IsModLoaded "sexoutKings.esp"
			set mKings to GetModIndex "sexoutKings.esp" 
		endif
		if IsModLoaded "sexoutKings.esm"
			set mKings to GetModIndex "sexoutKings.esm" 
		endif
		if IsModLoaded "sexoutLegion.esp"
			set mLegion to GetModIndex "sexoutLegion.esp"
		endif
		if IsModLoaded "sexoutLegion.esm"
			set mLegion to GetModIndex "sexoutLegion.esm"
		endif
		if IsModLoaded "sexoutNCR.esp"
			set mNCRwhore to GetModIndex "sexoutNCR.esp"
			set SexoutNCRWhore to BuildRef mNCRwhore 160621
		endif
		if IsModLoaded "sexoutNCR.esm"
			set mNCRwhore to GetModIndex "sexoutNCR.esm"
			set SexoutNCRWhore to BuildRef mNCRwhore 160621
		endif
		if IsModLoaded "sexoutPowderGangers.esp"
			set mPowder to GetModIndex "sexoutPowderGangers.esp"
		endif
		if IsModLoaded "sexoutPowderGangers.esm"
			set mPowder to GetModIndex "sexoutPowderGangers.esm"
		endif
		if IsModLoaded "sexoutProstitutes.esp"
			set mWhoring to GetModIndex "sexoutProstitutes.esp"
		endif
		if IsModLoaded "sexoutProstitutes.esm"
			set mWhoring to GetModIndex "sexoutProstitutes.esm"
		endif
		if IsModLoaded "sexoutWorkinhGirl.esp"
			set mWhoring to GetModIndex "sexoutWorkinhGirl.esp"
		endif
		if IsModLoaded "sexoutWorkinhGirl.esm"
			set mWhoring to GetModIndex "sexoutWorkinhGirl.esm"
		endif
	endif

	short startwhile
	short endwhile
	set endwhile to 1

	set doKhans to Khans * mKhans
	set doKings to Kings * mKings
	set doLegion to Legion * mLegion
	set doNCRwhore to NCRwhore * mNCRwhore
	set doPowder to Powder * mPowder
	set doWhoring to Whoring * mWhoring

	set targetRef to playerRef

	ref scan
	set scan to GetFirstRef 200

      ; lets put a little delay here
     if fDelay > 0
       set fDelay to fDelay - GetSecondsPassed
       return
    endif
     set fDelay to loopDelay

    set scanChance to (scanChance + 1) % subLoops ; one of 'subLoops' people tested at a time

    set scan to GetFirstRef 200
    set scanCount to 0
    set scanIndex to 0

    Let rCurCell := Player.GPC
	printc "%i" rCurCell
	If rCurCell.IsInList aaHookUpAllowedCells

 	   Label startwhile
	    set scanIndex to (scanIndex +1) % subLoops

		if scan
   	     if (scanIndex == scanChance)
				if scan.IsChild
					set scan to GetNextRef
					Goto startwhile
				endif
				if scan.IsInList aaHookUpsBannedNPC
						set scan to GetNextRef
						Goto startwhile
				endif
				if scan == playerRef
					set scan to GetNextRef
					Goto startwhile
				endif
				if scan.GetDisabled
					set scan to GetNextRef
					Goto startwhile
				endif
				if scan.GetIsCreature
					set scan to GetNextRef
					Goto startwhile
				endif
				if scan.GetPlayerTeammate || scan.GetFactionRank FollowerFaction > -1
					set scan to GetNextRef
					Goto startwhile
				endif
				if scan.GetDead
					set scan to GetNextRef
					Goto startwhile
				endif
				if scan.GetUnconscious
					set scan to GetNextRef
					Goto startwhile
				endif
				if scan.GetRestrained
					set scan to GetNextRef
					Goto startwhile
				endif

				if ListGetFormIndex SexoutSLActorDataIsReserved scan > -1
						set scan to GetNextRef
						Goto startwhile
				endif
				if scan.IsInList SexoutSLActorDataIsReserved
						set scan to GetNextRef
						Goto startwhile
				endif

				if ListGetFormIndex SexoutListBannedActor scan > -1
					set scan to GetNextRef
					Goto startwhile
				endif
				if scan.IsInList SexoutListBannedActor
						set scan to GetNextRef
						Goto startwhile
				endif

				if ListGetFormIndex SexoutSLActorDataHatesSex scan > -1
					set scan to GetNextRef
					Goto startwhile
				endif
				if scan.IsInList SexoutSLActorDataHatesSex
						set scan to GetNextRef
						Goto startwhile
				endif

				if ListGetFormIndex SexoutSLActorDataIsNotLookingForSex scan > -1
					set scan to GetNextRef
					Goto startwhile
				endif
				if scan.IsInList SexoutSLActorDataIsNotLookingForSex
						set scan to GetNextRef
						Goto startwhile
				endif

				if ListGetFormIndex SexoutSLActorDataIsPartneredFaithfully scan > -1
					set scan to GetNextRef
					Goto startwhile
				endif
				if scan.IsInList SexoutSLActorDataIsPartneredFaithfully
						set scan to GetNextRef
						Goto startwhile
				endif

				if scan.GetIsClass Prostitute
					set scan to GetNextRef
					Goto startwhile
				endif

				if doPowder
					if scan.GetInFaction vDialoguePowderGangerFaction
						set scan to GetNextRef
						Goto startwhile
					endif
				endif

				if doLegion
					if scan.GetInFaction vCaesarsLegionFaction
						set scan to GetNextRef
						Goto startwhile
					endif
				endif

				if doKings
					if scan.GetInFaction vKingsDialogueFaction
						set scan to GetNextRef
						Goto startwhile
					endif
				endif

				if doKhans
					if scan.GetInFaction vGreatKhansDialogueFaction
						set scan to GetNextRef
						Goto startwhile
					endif
				endif

				if doNCRwhore
					if scan.GetinFaction vNCRMilitaryDialogueFaction
						if targetRef.GetEquipped SexoutNCRWhore
							set scan to GetNextRef
							Goto startwhile
						endif
					endif
				endif

				if doWhoring
					; what we really want is:
					;	set scan to BuildRef mWhoring 139704
					;	if scan.whoremode
					if targetRef.GetEquipped SexoutListProstituteOutfits	; far from perfect as WorkingGirl allows whoring in arbitrary clothes
						set scan to GetNextRef
						Goto startwhile
					endif
				endif

				if (0 == (scan.IsSpellTarget SexoutHookupEffect)) && (0 == (scan.IsSpellTarget SexoutHookupOld))
					short Limit
					; base change 50 over 200 (1 in 4)
					set Limit to 50
					;	if night, double limit
					if Gamehour > 19
						set Limit to 2 * Limit
					endif
					;	if nympho, double limit again or for first time if not night
					if ListGetFormIndex SexoutSLActorDataIsNymphomaniac scan > -1
						set Limit to 2 * Limit
					endif
					; boosts
					;	+ charisma * approach
					;	+ 1/100 of Evil Karma
					set Limit to (Limit + (scan.GetAv Karma / -100) + (targetRef.GetAV Charisma * approach))
				;	if wearing any armor with DT, make limit 0
					if player.getav damagethreshold > 25
						set Limit to 0 * Limit
					else
						set Limit to 1 * Limit
					endif
					short random
					set random to 2 * GetRandomPercent
					if random < Limit
						scan.CIOS SexoutHookupEffect
					else
						scan.CIOS SexoutHookupOld
					endif
				endif

			endif

			set scan to GetNextRef
			Goto startwhile
		endif
	endif
End

 

  • Нравится 1

Поделиться сообщением


Ссылка на сообщение

Выдает такое (айдишник появляется раз в несколько игровых часов, т.к. насколько я поняла, у сканера есть кд):

 

df7587cbc4.jpg

 

Первый айди появился на улице мегатонны, второй регулярно появляется раз в несколько часов в салуне мориарти. Тем не менее, никто не разе не подкатил (в настройках выставила макс. шанс, т.. харизма ГГ*5), т.е. сканер все еще не работает как надо.

Поделиться сообщением


Ссылка на сообщение

Так, ID верный (это ай ди ячейки), значит мы на верном пути. Докинь теперь после if (scanIndex == scanChance) строку printc "%n" scan

И в блок if scan.IsInList aaHookUpsBannedNPC строку print "1"

Сейчас мы проверим условие на НПС.

Поделиться сообщением


Ссылка на сообщение

Если закомментить сроки 

Let rCurCell := Player.GPC
    printc "%i" rCurCell
    If rCurCell.IsInList aaHookUpAllowedCells

И endif в конце соответственно - мод работает, как и раньше.

 

В консоль спамятся айдишники НПС (я так понимаю, не прошедших проверку)

 

efe8fd3f77.jpg

 

 

Мне кажется, тут нужен принципиально другой подход - нужно сделать так, чтобы этот скрипт вообще запускался только в нужных ячейках. Как минимум из-за его кулдауна - если ГГ пришел в Мегатонну и сразу рванул в салун - скрипт уже отбомбил, и в салуне он напорется на банальный кулдаун, и в итоге работа мода сведется на нет.

Поделиться сообщением


Ссылка на сообщение

Для публикации сообщений создайте учётную запись или авторизуйтесь

Вы должны быть пользователем, чтобы оставить комментарий

Создать учетную запись

Зарегистрируйте новую учётную запись в нашем сообществе. Это очень просто!

Регистрация нового пользователя

Войти

Уже есть аккаунт? Войти в систему.

Войти


×
×
  • Создать...