Jump to content

leveled npc go on npc reference list question


romeck

Recommended Posts

does leveled npc go on npc reference list or is there another list for leveled npc(same for creature) . i ask bacause on NVSE function list there is :

42: NPC

43: Creature

44: LeveledCreature

45: LeveledCharacter

and i do mod that check all references on the list , but i travel through many locations( like mcnamara camp where there are many soldier who seems to be leveled, mojawe wastelend and many more) and 44 and 45 list are empty . is it ok and 44 and 45 are used for something else ?

Link to comment
Share on other sites

does leveled npc go on npc reference list or is there another list for leveled npc(same for creature) . i ask bacause on NVSE function list there is :

42: NPC

43: Creature

44: LeveledCreature

45: LeveledCharacter

and i do mod that check all references on the list , but i travel through many locations( like mcnamara camp where there are many soldier who seems to be leveled, mojawe wastelend and many more) and 44 and 45 list are empty . is it ok and 44 and 45 are used for something else ?

 

i assume your refwalking

 

are you suing the commands getfirstref or getnextref with loops?

thats refwalking, if so use 200 instead.

it deals with all actors.

 

also if you need item refs through refwalking 201 is the best way to go.

Link to comment
Share on other sites

does leveled npc go on npc reference list or is there another list for leveled npc(same for creature) . i ask bacause on NVSE function list there is :

42: NPC

43: Creature

44: LeveledCreature

45: LeveledCharacter

and i do mod that check all references on the list , but i travel through many locations( like mcnamara camp where there are many soldier who seems to be leveled, mojawe wastelend and many more) and 44 and 45 list are empty . is it ok and 44 and 45 are used for something else ?

 

i assume your refwalking

 

are you suing the commands getfirstref or getnextref with loops?

thats refwalking, if so use 200 instead.

it deals with all actors.

 

also if you need item refs through refwalking 201 is the best way to go.

 

yes i use loops , and thanks for advice it will cut my mod in two :) but is it list of all actors reference in cell or whole world ? does killed actors dissapear from that list ? or is it grow infinity ?

Link to comment
Share on other sites

it affects all actors in cell or however many cells you specify with the getfirstref and getnextref commands. and yes that is including dead ones.

 

if you need the script to ignore them use

 

ActorREF.GetDead != 1

 

i actually have a pretty awesome example script thatll distinguish between actors and their current states, i tried to make it as legible as possible as i pass this script on to help people often: this should have everything you need to deduce how to use ref-walking on actors.

 

this is not a cut and paste script thatll have you up an running, just a guideline so you can read it and try things based on the methods there.

 

 

 

SCN SUBdetect

ref creatureREF
int creatureREFcount
float rTimer

BEGIN GAMEMODE
if player.getitemcount SUBaedACT == 0
	stopquest SUBdetectquest
endif
if player.getitemcount AmmoMicroFusionCell < ( SUBskillcostREF.skillcost )
	stopquest SUBdetectquest
	showmessage SUBmfcellsneededMSG
endif

set rTimer to rTimer - GetSecondsPassed
if rTimer <= 0
	set SUBskillcostREF.indicatorREF to 0
	listclear SUBkilllist
ENDIF

set creatureREFcount to GetNumRefs 200 2
set creatureREF to GetFirstRef 200 2
if (creatureREF.GetDistance player < 10000)

	creatureREF.sms NightkinCloakFXShader

	if ( creatureREF.getdead )	 ;dead -> BLACK
	creatureREF.PMS SUBDeadSpotterShader 1 ; DEAD

	elseif ( creatureREF.IsInList SUBkillList )	
	creatureREF.PMS	SUBIndicatedforshotSHADER 1 ;  indicated for shot

	elseif(creatureREF.Getdistance SUBflagREF <= 250 ) ; indicated for shot
	creatureREF.PMS	SUBIndicatedforshotSHADER 1 ;  indicated for shot
	set SUBskillcostREF.indicatorREF to creatureREF
	creatureREF.listaddreference SUBkillList 0
	set rTimer to 3

	elseif(creatureREF.GetCurrentAIProcedure == 8) ;sleeping -> blue
	creatureREF.PMS	SUBsleepSpotterShader 1 ; sleep

	elseif(creatureREF.GetCurrentAIProcedure == 16) ;fleeing -> pink
	creatureREF.PMS SUBfleeSpotterShader 1 ; flee

	elseif (creatureREF.GetCombatTarget == player)	 ;attacks player -> red fast blink
	creatureREF.PMS	SUBSpotterShader 1 ; ATTACKING

	elseif ( creatureREF.GetFactionRelation player == 2)	 ;ally -> green
	creatureREF.PMS SUBFriendSpotterShader 1 ; ally

	elseif (creatureREF.GetFactionRelation player == 1)	 ;enemy with player-> orange fast blink
	creatureREF.PMS SUBEnemySpotterShader 1 ; hostile

	elseif (creatureREF.GetFactionRelation player == 0 && creatureREF.GetAV Aggression >= 2)	 ;neutral but verry aggressive -> orange fast blink
	creatureREF.PMS SUBEnemySpotterShader 1 ; hostile

	else	 ;any actor alife -> grey
	creatureREF.PMS SUBNeutral 1     ; neutral
	endif

endif

label 5
if creatureREFcount > 0
	set creatureREF to GetNextRef
	if (creatureREF.GetDistance player < 10000)

		creatureREF.sms NightkinCloakFXShader

		if ( creatureREF.getdead )	 ;dead -> BLACK
		creatureREF.PMS SUBDeadSpotterShader 1 ; DEAD

		elseif ( creatureREF.IsInList SUBkillList )	
		creatureREF.PMS	SUBIndicatedforshotSHADER 1 ; indicated for shot

		elseif(creatureREF.Getdistance SUBflagREF <= 250 ) ; indicated for shot
		creatureREF.PMS	SUBIndicatedforshotSHADER 1 ; indicated for shot
		set SUBskillcostREF.indicatorREF to creatureREF
		creatureREF.listaddreference SUBkillList 0
		set rTimer to 3

		elseif(creatureREF.GetCurrentAIProcedure == 8) ;sleeping -> blue
		creatureREF.PMS	SUBsleepSpotterShader 1 ; sleep

		elseif(creatureREF.GetCurrentAIProcedure == 16) ;fleeing -> pink
		creatureREF.PMS SUBfleeSpotterShader 1 ; flee

		elseif (creatureREF.GetCombatTarget == player)	 ;attacks player -> red fast blink
		creatureREF.PMS	SUBSpotterShader 1 ; ATTACKING

		elseif ( creatureREF.GetFactionRelation player == 2)	 ;ally -> green
		creatureREF.PMS SUBFriendSpotterShader 1 ; ALLY

		elseif (creatureREF.GetFactionRelation player == 1)	 ;enemy with player-> orange fast blink
		creatureREF.PMS SUBEnemySpotterShader 1 ; hostile

		elseif (creatureREF.GetFactionRelation player == 0 && creatureREF.GetAV Aggression >= 2)	 ;neutral but verry aggressive -> orange fast blink
		creatureREF.PMS SUBEnemySpotterShader 1 ; hostile

		else	 ;any actor alife -> grey
		creatureREF.PMS SUBNeutral 1     ; neutral
		endif

	endif
	set creatureREFcount to creatureREFcount - 1
	goto 5
endif

set creatureREFcount to GetNumRefs 201 1
set creatureREF to GetFirstRef 201 1
if (creatureREF.GetDistance player < 5000)
	creatureREF.PMS SUBItemSpotterShader 1
endif
label 6
if creatureREFcount > 0
	set creatureREF to GetNextRef
	if (creatureREF.GetDistance player < 5000)
		creatureREF.PMS SUBItemSpotterShader 1
	endif
	set creatureREFcount to creatureREFcount - 1
	goto 6
endif
if SUBskillcostREF.indicatorREF
	showmessage SUBtestmessageMSG
endif
END

 

Link to comment
Share on other sites

  • Recently Browsing   0 members

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